diff --git a/.generation/Dockerfile b/.generation/Dockerfile index 16b82c7b..ff7fb287 100644 --- a/.generation/Dockerfile +++ b/.generation/Dockerfile @@ -1,5 +1,5 @@ # Patched version of openapi-generator-cli with python3 support -FROM docker.io/openapitools/openapi-generator-cli:v7.0.1 +FROM docker.io/openapitools/openapi-generator-cli:v7.11.0 RUN apt-get update && apt-get install -y python3 diff --git a/.generation/README.md b/.generation/README.md index 0ba2770b..b294658e 100644 --- a/.generation/README.md +++ b/.generation/README.md @@ -26,7 +26,7 @@ From the root of the repository run: To fetch the OpenAPI spec from the backend, run: ```bash -cargo run --features pro +cargo run wget http://localhost:3030/api/api-docs/openapi.json -O - \ | python -m json.tool --indent 2 > .generation/input/openapi.json ``` diff --git a/.generation/config.ini b/.generation/config.ini index 68ffcf0a..bcd822eb 100644 --- a/.generation/config.ini +++ b/.generation/config.ini @@ -6,9 +6,9 @@ githubUrl = https://github.com/geo-engine/openapi-client [python] name = geoengine_openapi_client -version = 0.0.20 +version = 0.0.21 [typescript] name = @geoengine/openapi-client -version = 0.0.20 +version = 0.0.21 diff --git a/.generation/generate.py b/.generation/generate.py index 11e5a63d..8effc286 100755 --- a/.generation/generate.py +++ b/.generation/generate.py @@ -106,6 +106,10 @@ def fetch_spec(*, ge_backend_tag: str) -> None: # "-p", "3030:8080", f"quay.io/geoengine/geoengine:{ge_backend_tag}", ], + env={ + 'GEOENGINE__POSTGRES__CLEAR_DATABASE_ON_START': 'true', + 'PATH': os.environ['PATH'], + }, ) for _ in range(180): # <3 minutes diff --git a/.generation/post-process/python.py b/.generation/post-process/python.py index 296c7bda..c58cfcf6 100644 --- a/.generation/post-process/python.py +++ b/.generation/post-process/python.py @@ -6,37 +6,23 @@ import sys from pathlib import Path -from typing import Generator, List +from typing import List, Literal, Callable, Generator from textwrap import dedent, indent -from util import pairwise, modify_file, version +from util import modify_file, version INDENT = ' ' HALF_INDENT = ' ' def api_client_py(file_contents: List[str]) -> Generator[str, None, None]: '''Modify the api_client.py file.''' - for (prev_line, line) in pairwise(file_contents): + for line in file_contents: dedented_line = dedent(line) - dedented_prev_line = dedent(prev_line) if dedented_line.startswith('self.user_agent = '): line = indent(dedent(f'''\ self.user_agent = 'geoengine/openapi-client/python/{version('python')}' '''), 2 * INDENT) - elif dedented_prev_line.startswith('response_data.data = response_data.data') \ - and dedented_line.startswith('else:'): - line = indent(dedent('''\ - elif response_data.data is not None: - # Note: fixed handling of empty responses - '''), 2 * INDENT + HALF_INDENT) - - elif dedented_line.startswith('if not async_req:'): - line = indent(dedent('''\ - # Note: remove query string in path part for ogc endpoints - resource_path = resource_path.partition("?")[0] - '''), 2 * INDENT) + '\n' + line - yield line def exceptions_py(file_contents: List[str]) -> Generator[str, None, None]: @@ -53,29 +39,6 @@ def exceptions_py(file_contents: List[str]) -> Generator[str, None, None]: yield line -def palette_colorizer_py(file_contents: List[str]) -> Generator[str, None, None]: - '''Modify the palette_colorizer.py file.''' - for line in file_contents: - if dedent(line).startswith('# override the default output'): - line = indent(dedent('''\ - # Note: fixed wrong handling of colors field - return _dict - '''), 2 * INDENT) + '\n' + line - - yield line - -def raster_dataset_from_workflow_py(file_contents: List[str]) -> Generator[str, None, None]: - '''Modify the raster_dataset_from_workflow.py file.''' - for line in file_contents: - if dedent(line).startswith('exclude_none=True)'): - line = indent(dedent('''\ - exclude_none=True, - # Note: remove as_cog when set to default - exclude_defaults=True) - '''), 6 * INDENT + HALF_INDENT) - - yield line - def task_status_with_id_py(file_contents: List[str]) -> Generator[str, None, None]: '''Modify the task_status_with_id.py file.''' for line in file_contents: @@ -98,10 +61,10 @@ def task_status_with_id_py(file_contents: List[str]) -> Generator[str, None, Non if getattr(self.actual_instance, "error", None) is None and "error" in self.actual_instance.__fields_set__: '''), 2 * INDENT) - elif dedented_line.startswith('_obj = TaskStatusWithId.parse_obj({'): + elif dedented_line.startswith('_obj = cls.model_validate({'): line = indent(dedent('''\ # Note: fixed handling of actual_instance - _obj = TaskStatusWithId.parse_obj({ + _obj = cls.model_validate({ "actual_instance": TaskStatus.from_dict(obj).actual_instance, "task_id": obj.get("taskId") }) @@ -110,19 +73,83 @@ def task_status_with_id_py(file_contents: List[str]) -> Generator[str, None, Non yield line +EARLY_RETURN_EMPTY_HTTP_RESPONSE = indent(dedent('''\ + # Note: fixed handling of empty responses + if response_data.data is None: + return None + '''), 2 * INDENT) + +def tasks_api_py(file_contents: List[str]) -> Generator[str, None, None]: + '''Modify the tasks_api.py file.''' + state: Literal[None, 'abort_handler'] = None + for line in file_contents: + dedented_line = dedent(line) + if state is None and dedented_line.startswith('def abort_handler('): + state = 'abort_handler' + + elif state == 'abort_handler' and \ + dedented_line.startswith('return self.api_client.response_deserialize('): + line = EARLY_RETURN_EMPTY_HTTP_RESPONSE + '\n' + line + state = None + + yield line + +def layers_api_py(file_contents: List[str]) -> Generator[str, None, None]: + '''Modify the tasks_api.py file.''' + state: Literal[ + None, + 'add_early_return_empty_http_response', + ] = None + for line in file_contents: + dedented_line = dedent(line) + if state is None and ( + dedented_line.startswith('def add_existing_layer_to_collection(') + or + dedented_line.startswith('def add_existing_collection_to_collection(') + or + dedented_line.startswith('def remove_collection_from_collection(') + or + dedented_line.startswith('def remove_layer_from_collection(') + or + dedented_line.startswith('def remove_collection(') + ): + state = 'add_early_return_empty_http_response' + + elif state == 'add_early_return_empty_http_response' and \ + dedented_line.startswith('return self.api_client.response_deserialize('): + line = EARLY_RETURN_EMPTY_HTTP_RESPONSE + '\n' + line + state = None + + yield line + +def ogc_xyz_api_py(ogc_api: Literal['wfs', 'wms']) -> Callable[[List[str]], Generator[str, None, None]]: + def ogc_wfs_api_py(file_contents: List[str]) -> Generator[str, None, None]: + '''Modify the ogc_wfs_api.py file.''' + for line in file_contents: + dedented_line = dedent(line) + if dedented_line.startswith(f"resource_path='/{ogc_api}/{{workflow}}?request="): + line = indent(dedent(f'''\ + # Note: remove query string in path part for ogc endpoints + resource_path='/{ogc_api}/{{workflow}}', + '''), 3 * INDENT) + + yield line + return ogc_wfs_api_py input_file = Path(sys.argv[1]) -if input_file.name == 'api_client.py': - modify_file(input_file, api_client_py) -elif input_file.name == 'exceptions.py': - modify_file(input_file, exceptions_py) -elif input_file.name == 'palette_colorizer.py': - modify_file(input_file, palette_colorizer_py) -elif input_file.name == 'raster_dataset_from_workflow.py': - modify_file(input_file, raster_dataset_from_workflow_py) -elif input_file.name == 'task_status_with_id.py': - modify_file(input_file, task_status_with_id_py) +file_modifications = { + 'api_client.py': api_client_py, + 'exceptions.py': exceptions_py, + 'layers_api.py': layers_api_py, + 'ogcwfs_api.py': ogc_xyz_api_py('wfs'), + 'ogcwms_api.py': ogc_xyz_api_py('wms'), + 'task_status_with_id.py': task_status_with_id_py, + 'tasks_api.py': tasks_api_py, +} + +if modifier_function := file_modifications.get(input_file.name): + modify_file(input_file, modifier_function) else: pass # leave file untouched diff --git a/.generation/post-process/typescript.py b/.generation/post-process/typescript.py index cc1c4020..bb74d521 100644 --- a/.generation/post-process/typescript.py +++ b/.generation/post-process/typescript.py @@ -26,37 +26,13 @@ def runtime_ts(file_contents: List[str]) -> Generator[str, None, None]: yield line -# fixes due to https://github.com/OpenAPITools/openapi-generator/issues/14831 -def project_update_token_ts(file_contents: List[str]) -> Generator[str, None, None]: - '''Modify the ProjectUpdateToken.ts file.''' - for line in file_contents: - - if line.startswith('export function ProjectUpdateTokenToJSON'): - line = dedent('''\ - export function instanceOfProjectUpdateToken(value: any): boolean { - return value === ProjectUpdateToken.None || value === ProjectUpdateToken.Delete; - } - ''') + '\n' + line - - yield line - # fixes due to https://github.com/OpenAPITools/openapi-generator/issues/14831 def plot_update_ts(file_contents: List[str]) -> Generator[str, None, None]: '''Modify the PlotUpdate.ts file.''' for line in file_contents: dedented_line = dedent(line) - if dedented_line.startswith('return { ...PlotFromJSONTyped(json, true)'): - line = indent(dedent('''\ - if (json === ProjectUpdateToken.None) { - return ProjectUpdateToken.None; - } else if (json === ProjectUpdateToken.Delete) { - return ProjectUpdateToken.Delete; - } else { - return { ...PlotFromJSONTyped(json, true) }; - } - '''), INDENT) - elif dedented_line.startswith('if (instanceOfPlot(value))'): + if dedented_line.startswith('if (instanceOfPlot(value))'): line = indent(dedent('''\ if (typeof value === 'object' && instanceOfPlot(value)) { '''), INDENT) @@ -69,17 +45,7 @@ def layer_update_ts(file_contents: List[str]) -> Generator[str, None, None]: for line in file_contents: dedented_line = dedent(line) - if dedented_line.startswith('return { ...ProjectLayerFromJSONTyped(json, true)'): - line = indent(dedent('''\ - if (json === ProjectUpdateToken.None) { - return ProjectUpdateToken.None; - } else if (json === ProjectUpdateToken.Delete) { - return ProjectUpdateToken.Delete; - } else { - return { ...ProjectLayerFromJSONTyped(json, true) }; - } - '''), INDENT) - elif dedented_line.startswith('if (instanceOfProjectLayer(value))'): + if dedented_line.startswith('if (instanceOfProjectLayer(value))'): line = indent(dedent('''\ if (typeof value === 'object' && instanceOfProjectLayer(value)) { '''), INDENT) @@ -104,16 +70,14 @@ def task_status_with_id_ts(file_contents: List[str]) -> Generator[str, None, Non input_file = Path(sys.argv[1]) -if input_file.name == 'runtime.ts': - modify_file(input_file, runtime_ts) -if input_file.name == 'ProjectUpdateToken.ts': - modify_file(input_file, project_update_token_ts) -elif input_file.name == 'PlotUpdate.ts': - modify_file(input_file, plot_update_ts) -elif input_file.name == 'LayerUpdate.ts': - modify_file(input_file, layer_update_ts) -elif input_file.name == 'TaskStatusWithId.ts': - modify_file(input_file, task_status_with_id_ts) +file_modifications = { + 'LayerUpdate.ts': layer_update_ts, + 'PlotUpdate.ts': plot_update_ts, + 'runtime.ts': runtime_ts, + 'TaskStatusWithId.ts': task_status_with_id_ts, +} +if modifier_function := file_modifications.get(input_file.name): + modify_file(input_file, modifier_function) else: pass # leave file untouched diff --git a/python/.github/workflows/python.yml b/python/.github/workflows/python.yml index a02d9803..1cd345df 100644 --- a/python/.github/workflows/python.yml +++ b/python/.github/workflows/python.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -24,15 +24,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + pip install -r requirements.txt + pip install -r test-requirements.txt - name: Test with pytest run: | - pytest + pytest --cov={{packageName}} diff --git a/python/.gitlab-ci.yml b/python/.gitlab-ci.yml index 6a189db0..94769389 100644 --- a/python/.gitlab-ci.yml +++ b/python/.gitlab-ci.yml @@ -14,9 +14,6 @@ stages: - pip install -r test-requirements.txt - pytest --cov=geoengine_openapi_client -pytest-3.7: - extends: .pytest - image: python:3.7-alpine pytest-3.8: extends: .pytest image: python:3.8-alpine @@ -29,3 +26,6 @@ pytest-3.10: pytest-3.11: extends: .pytest image: python:3.11-alpine +pytest-3.12: + extends: .pytest + image: python:3.12-alpine diff --git a/python/.openapi-generator/FILES b/python/.openapi-generator/FILES index 553a46e3..9f8aa2b0 100644 --- a/python/.openapi-generator/FILES +++ b/python/.openapi-generator/FILES @@ -69,6 +69,7 @@ docs/GetLegendGraphicRequest.md docs/GetMapExceptionFormat.md docs/GetMapFormat.md docs/GetMapRequest.md +docs/InlineObject.md docs/InternalDataId.md docs/Layer.md docs/LayerCollection.md @@ -330,6 +331,7 @@ geoengine_openapi_client/models/get_legend_graphic_request.py geoengine_openapi_client/models/get_map_exception_format.py geoengine_openapi_client/models/get_map_format.py geoengine_openapi_client/models/get_map_request.py +geoengine_openapi_client/models/inline_object.py geoengine_openapi_client/models/internal_data_id.py geoengine_openapi_client/models/layer.py geoengine_openapi_client/models/layer_collection.py @@ -565,6 +567,7 @@ test/test_get_legend_graphic_request.py test/test_get_map_exception_format.py test/test_get_map_format.py test/test_get_map_request.py +test/test_inline_object.py test/test_internal_data_id.py test/test_layer.py test/test_layer_collection.py diff --git a/python/.openapi-generator/VERSION b/python/.openapi-generator/VERSION index 73a86b19..b23eb275 100644 --- a/python/.openapi-generator/VERSION +++ b/python/.openapi-generator/VERSION @@ -1 +1 @@ -7.0.1 \ No newline at end of file +7.11.0 diff --git a/python/.travis.yml b/python/.travis.yml index df26d6f0..ba59ea96 100644 --- a/python/.travis.yml +++ b/python/.travis.yml @@ -1,13 +1,13 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" + - "3.12" # uncomment the following if needed - #- "3.11-dev" # 3.11 development branch + #- "3.12-dev" # 3.12 development branch #- "nightly" # nightly build # command to install dependencies install: diff --git a/python/README.md b/python/README.md index 12fc4d89..56255a0d 100644 --- a/python/README.md +++ b/python/README.md @@ -4,12 +4,13 @@ No description provided (generated by Openapi Generator https://github.com/opena This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 0.8.0 -- Package version: 0.0.20 +- Package version: 0.0.21 +- Generator version: 7.11.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. -Python 3.7+ +Python 3.8+ ## Installation & Usage ### pip install @@ -50,7 +51,6 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python -import time import geoengine_openapi_client from geoengine_openapi_client.rest import ApiException from pprint import pprint @@ -251,6 +251,7 @@ Class | Method | HTTP request | Description - [GetMapExceptionFormat](docs/GetMapExceptionFormat.md) - [GetMapFormat](docs/GetMapFormat.md) - [GetMapRequest](docs/GetMapRequest.md) + - [InlineObject](docs/InlineObject.md) - [InternalDataId](docs/InternalDataId.md) - [Layer](docs/Layer.md) - [LayerCollection](docs/LayerCollection.md) diff --git a/python/geoengine_openapi_client/__init__.py b/python/geoengine_openapi_client/__init__.py index f8573e0d..83eb6daa 100644 --- a/python/geoengine_openapi_client/__init__.py +++ b/python/geoengine_openapi_client/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "0.0.20" +__version__ = "0.0.21" # import apis into sdk package from geoengine_openapi_client.api.datasets_api import DatasetsApi @@ -111,6 +111,7 @@ from geoengine_openapi_client.models.get_map_exception_format import GetMapExceptionFormat from geoengine_openapi_client.models.get_map_format import GetMapFormat from geoengine_openapi_client.models.get_map_request import GetMapRequest +from geoengine_openapi_client.models.inline_object import InlineObject from geoengine_openapi_client.models.internal_data_id import InternalDataId from geoengine_openapi_client.models.layer import Layer from geoengine_openapi_client.models.layer_collection import LayerCollection diff --git a/python/geoengine_openapi_client/api/datasets_api.py b/python/geoengine_openapi_client/api/datasets_api.py index 5c30aedd..86fd941d 100644 --- a/python/geoengine_openapi_client/api/datasets_api.py +++ b/python/geoengine_openapi_client/api/datasets_api.py @@ -12,18 +12,14 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint, conlist +from pydantic import Field, StrictStr from typing import List, Optional - +from typing_extensions import Annotated from geoengine_openapi_client.models.auto_create_dataset import AutoCreateDataset from geoengine_openapi_client.models.create_dataset import CreateDataset from geoengine_openapi_client.models.create_dataset_handler200_response import CreateDatasetHandler200Response @@ -39,12 +35,9 @@ from geoengine_openapi_client.models.volume import Volume from geoengine_openapi_client.models.volume_file_layers_response import VolumeFileLayersResponse -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class DatasetsApi: @@ -59,730 +52,1379 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def auto_create_dataset_handler(self, auto_create_dataset : AutoCreateDataset, **kwargs) -> CreateDatasetHandler200Response: # noqa: E501 - """Creates a new dataset using previously uploaded files. # noqa: E501 - The format of the files will be automatically detected when possible. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def auto_create_dataset_handler( + self, + auto_create_dataset: AutoCreateDataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateDatasetHandler200Response: + """Creates a new dataset using previously uploaded files. - >>> thread = api.auto_create_dataset_handler(auto_create_dataset, async_req=True) - >>> result = thread.get() + The format of the files will be automatically detected when possible. :param auto_create_dataset: (required) :type auto_create_dataset: AutoCreateDataset - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CreateDatasetHandler200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the auto_create_dataset_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.auto_create_dataset_handler_with_http_info(auto_create_dataset, **kwargs) # noqa: E501 - - @validate_arguments - def auto_create_dataset_handler_with_http_info(self, auto_create_dataset : AutoCreateDataset, **kwargs) -> ApiResponse: # noqa: E501 - """Creates a new dataset using previously uploaded files. # noqa: E501 - - The format of the files will be automatically detected when possible. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.auto_create_dataset_handler_with_http_info(auto_create_dataset, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._auto_create_dataset_handler_serialize( + auto_create_dataset=auto_create_dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateDatasetHandler200Response", + '400': "ErrorResponse", + '401': "ErrorResponse", + '413': "ErrorResponse", + '415': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def auto_create_dataset_handler_with_http_info( + self, + auto_create_dataset: AutoCreateDataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateDatasetHandler200Response]: + """Creates a new dataset using previously uploaded files. + + The format of the files will be automatically detected when possible. :param auto_create_dataset: (required) :type auto_create_dataset: AutoCreateDataset - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CreateDatasetHandler200Response, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._auto_create_dataset_handler_serialize( + auto_create_dataset=auto_create_dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateDatasetHandler200Response", + '400': "ErrorResponse", + '401': "ErrorResponse", + '413': "ErrorResponse", + '415': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'auto_create_dataset' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def auto_create_dataset_handler_without_preload_content( + self, + auto_create_dataset: AutoCreateDataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Creates a new dataset using previously uploaded files. + + The format of the files will be automatically detected when possible. + + :param auto_create_dataset: (required) + :type auto_create_dataset: AutoCreateDataset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._auto_create_dataset_handler_serialize( + auto_create_dataset=auto_create_dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method auto_create_dataset_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateDatasetHandler200Response", + '400': "ErrorResponse", + '401': "ErrorResponse", + '413': "ErrorResponse", + '415': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _auto_create_dataset_handler_serialize( + self, + auto_create_dataset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['auto_create_dataset'] is not None: - _body_params = _params['auto_create_dataset'] + if auto_create_dataset is not None: + _body_params = auto_create_dataset + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { - '200': "CreateDatasetHandler200Response", - '400': "ErrorResponse", - '401': "ErrorResponse", - '413': "ErrorResponse", - '415': "ErrorResponse", - } + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/dataset/auto', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/dataset/auto', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def create_dataset_handler(self, create_dataset : CreateDataset, **kwargs) -> CreateDatasetHandler200Response: # noqa: E501 - """Creates a new dataset referencing files. # noqa: E501 - Users can reference previously uploaded files. Admins can reference files from a volume. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_dataset_handler(create_dataset, async_req=True) - >>> result = thread.get() + @validate_call + def create_dataset_handler( + self, + create_dataset: CreateDataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateDatasetHandler200Response: + """Creates a new dataset referencing files. + + Users can reference previously uploaded files. Admins can reference files from a volume. :param create_dataset: (required) :type create_dataset: CreateDataset - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CreateDatasetHandler200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_dataset_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_dataset_handler_with_http_info(create_dataset, **kwargs) # noqa: E501 - - @validate_arguments - def create_dataset_handler_with_http_info(self, create_dataset : CreateDataset, **kwargs) -> ApiResponse: # noqa: E501 - """Creates a new dataset referencing files. # noqa: E501 - - Users can reference previously uploaded files. Admins can reference files from a volume. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_dataset_handler_with_http_info(create_dataset, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_dataset_handler_serialize( + create_dataset=create_dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateDatasetHandler200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_dataset_handler_with_http_info( + self, + create_dataset: CreateDataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateDatasetHandler200Response]: + """Creates a new dataset referencing files. + + Users can reference previously uploaded files. Admins can reference files from a volume. :param create_dataset: (required) :type create_dataset: CreateDataset - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CreateDatasetHandler200Response, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_dataset_handler_serialize( + create_dataset=create_dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateDatasetHandler200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'create_dataset' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_dataset_handler_without_preload_content( + self, + create_dataset: CreateDataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Creates a new dataset referencing files. + + Users can reference previously uploaded files. Admins can reference files from a volume. + + :param create_dataset: (required) + :type create_dataset: CreateDataset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_dataset_handler_serialize( + create_dataset=create_dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_dataset_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateDatasetHandler200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _create_dataset_handler_serialize( + self, + create_dataset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['create_dataset'] is not None: - _body_params = _params['create_dataset'] + if create_dataset is not None: + _body_params = create_dataset + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { - '200': "CreateDatasetHandler200Response", - } + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/dataset', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/dataset', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def delete_dataset_handler(self, dataset : Annotated[StrictStr, Field(..., description="Dataset id")], **kwargs) -> None: # noqa: E501 - """Delete a dataset # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_dataset_handler(dataset, async_req=True) - >>> result = thread.get() + @validate_call + def delete_dataset_handler( + self, + dataset: Annotated[StrictStr, Field(description="Dataset id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a dataset + :param dataset: Dataset id (required) :type dataset: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_dataset_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_dataset_handler_with_http_info(dataset, **kwargs) # noqa: E501 - - @validate_arguments - def delete_dataset_handler_with_http_info(self, dataset : Annotated[StrictStr, Field(..., description="Dataset id")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete a dataset # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_dataset_handler_with_http_info(dataset, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_dataset_handler_serialize( + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_dataset_handler_with_http_info( + self, + dataset: Annotated[StrictStr, Field(description="Dataset id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a dataset + :param dataset: Dataset id (required) :type dataset: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_dataset_handler_serialize( + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'dataset' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_dataset_handler_without_preload_content( + self, + dataset: Annotated[StrictStr, Field(description="Dataset id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a dataset + + + :param dataset: Dataset id (required) + :type dataset: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_dataset_handler_serialize( + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_dataset_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['dataset']: - _path_params['dataset'] = _params['dataset'] + def _delete_dataset_handler_serialize( + self, + dataset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if dataset is not None: + _path_params['dataset'] = dataset # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/dataset/{dataset}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/dataset/{dataset}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_dataset_handler(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], **kwargs) -> Dataset: # noqa: E501 - """Retrieves details about a dataset using the internal name. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dataset_handler(dataset, async_req=True) - >>> result = thread.get() - :param dataset: Dataset Name (required) - :type dataset: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Dataset - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_dataset_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_dataset_handler_with_http_info(dataset, **kwargs) # noqa: E501 - - @validate_arguments - def get_dataset_handler_with_http_info(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves details about a dataset using the internal name. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_dataset_handler_with_http_info(dataset, async_req=True) - >>> result = thread.get() + @validate_call + def get_dataset_handler( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dataset: + """Retrieves details about a dataset using the internal name. + :param dataset: Dataset Name (required) :type dataset: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Dataset, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'dataset' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._get_dataset_handler_serialize( + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_dataset_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['dataset']: - _path_params['dataset'] = _params['dataset'] - + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dataset", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_dataset_handler_with_http_info( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dataset]: + """Retrieves details about a dataset using the internal name. - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 + :param dataset: Dataset Name (required) + :type dataset: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_dataset_handler_serialize( + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '200': "Dataset", '400': "ErrorResponse", '401': "ErrorResponse", } - - return self.api_client.call_api( - '/dataset/{dataset}', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def get_loading_info_handler(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], **kwargs) -> MetaDataDefinition: # noqa: E501 - """Retrieves the loading information of a dataset # noqa: E501 + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_loading_info_handler(dataset, async_req=True) - >>> result = thread.get() + @validate_call + def get_dataset_handler_without_preload_content( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves details about a dataset using the internal name. - :param dataset: Dataset Name (required) - :type dataset: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: MetaDataDefinition - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_loading_info_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_loading_info_handler_with_http_info(dataset, **kwargs) # noqa: E501 - - @validate_arguments - def get_loading_info_handler_with_http_info(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves the loading information of a dataset # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_loading_info_handler_with_http_info(dataset, async_req=True) - >>> result = thread.get() :param dataset: Dataset Name (required) :type dataset: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MetaDataDefinition, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._get_dataset_handler_serialize( + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'dataset' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dataset", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_loading_info_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _get_dataset_handler_serialize( + self, + dataset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['dataset']: - _path_params['dataset'] = _params['dataset'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if dataset is not None: + _path_params['dataset'] = dataset # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "MetaDataDefinition", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/dataset/{dataset}/loadingInfo', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/dataset/{dataset}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_datasets_handler(self, order : OrderBy, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), filter : Optional[StrictStr] = None, tags : Optional[conlist(StrictStr)] = None, **kwargs) -> List[DatasetListing]: # noqa: E501 - """Lists available datasets. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_datasets_handler(order, offset, limit, filter, tags, async_req=True) - >>> result = thread.get() - :param order: (required) - :type order: OrderBy + @validate_call + def get_loading_info_handler( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MetaDataDefinition: + """Retrieves the loading information of a dataset + + + :param dataset: Dataset Name (required) + :type dataset: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_loading_info_handler_serialize( + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaDataDefinition", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_loading_info_handler_with_http_info( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MetaDataDefinition]: + """Retrieves the loading information of a dataset + + + :param dataset: Dataset Name (required) + :type dataset: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_loading_info_handler_serialize( + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaDataDefinition", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_loading_info_handler_without_preload_content( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves the loading information of a dataset + + + :param dataset: Dataset Name (required) + :type dataset: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_loading_info_handler_serialize( + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaDataDefinition", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_loading_info_handler_serialize( + self, + dataset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if dataset is not None: + _path_params['dataset'] = dataset + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/dataset/{dataset}/loadingInfo', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_datasets_handler( + self, + order: OrderBy, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + filter: Optional[StrictStr] = None, + tags: Optional[List[StrictStr]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[DatasetListing]: + """Lists available datasets. + + + :param order: (required) + :type order: OrderBy :param offset: (required) :type offset: int :param limit: (required) @@ -791,32 +1433,79 @@ def list_datasets_handler(self, order : OrderBy, offset : conint(strict=True, ge :type filter: str :param tags: :type tags: List[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[DatasetListing] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_datasets_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_datasets_handler_with_http_info(order, offset, limit, filter, tags, **kwargs) # noqa: E501 - - @validate_arguments - def list_datasets_handler_with_http_info(self, order : OrderBy, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), filter : Optional[StrictStr] = None, tags : Optional[conlist(StrictStr)] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Lists available datasets. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_datasets_handler_with_http_info(order, offset, limit, filter, tags, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_datasets_handler_serialize( + order=order, + offset=offset, + limit=limit, + filter=filter, + tags=tags, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[DatasetListing]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_datasets_handler_with_http_info( + self, + order: OrderBy, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + filter: Optional[StrictStr] = None, + tags: Optional[List[StrictStr]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[DatasetListing]]: + """Lists available datasets. + :param order: (required) :type order: OrderBy @@ -828,1148 +1517,2185 @@ def list_datasets_handler_with_http_info(self, order : OrderBy, offset : conint( :type filter: str :param tags: :type tags: List[str] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[DatasetListing], status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'order', - 'offset', - 'limit', - 'filter', - 'tags' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_datasets_handler_serialize( + order=order, + offset=offset, + limit=limit, + filter=filter, + tags=tags, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_datasets_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[DatasetListing]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the path parameters - _path_params = {} - # process the query parameters - _query_params = [] - if _params.get('filter') is not None: # noqa: E501 - _query_params.append(('filter', _params['filter'])) + @validate_call + def list_datasets_handler_without_preload_content( + self, + order: OrderBy, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + filter: Optional[StrictStr] = None, + tags: Optional[List[StrictStr]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Lists available datasets. - if _params.get('order') is not None: # noqa: E501 - _query_params.append(('order', _params['order'].value)) - if _params.get('offset') is not None: # noqa: E501 - _query_params.append(('offset', _params['offset'])) + :param order: (required) + :type order: OrderBy + :param offset: (required) + :type offset: int + :param limit: (required) + :type limit: int + :param filter: + :type filter: str + :param tags: + :type tags: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_datasets_handler_serialize( + order=order, + offset=offset, + limit=limit, + filter=filter, + tags=tags, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('limit') is not None: # noqa: E501 - _query_params.append(('limit', _params['limit'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[DatasetListing]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_datasets_handler_serialize( + self, + order, + offset, + limit, + filter, + tags, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'tags': 'multi', + } - if _params.get('tags') is not None: # noqa: E501 - _query_params.append(('tags', _params['tags'])) - _collection_formats['tags'] = 'multi' + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if filter is not None: + + _query_params.append(('filter', filter)) + + if order is not None: + + _query_params.append(('order', order.value)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if tags is not None: + + _query_params.append(('tags', tags)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "List[DatasetListing]", - '400': "ErrorResponse", - '401': "ErrorResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/datasets', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/datasets', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_volume_file_layers_handler(self, volume_name : Annotated[StrictStr, Field(..., description="Volume name")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> VolumeFileLayersResponse: # noqa: E501 - """List the layers of a file in a volume. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_volume_file_layers_handler(volume_name, file_name, async_req=True) - >>> result = thread.get() + + @validate_call + def list_volume_file_layers_handler( + self, + volume_name: Annotated[StrictStr, Field(description="Volume name")], + file_name: Annotated[StrictStr, Field(description="File name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VolumeFileLayersResponse: + """List the layers of a file in a volume. + :param volume_name: Volume name (required) :type volume_name: str :param file_name: File name (required) :type file_name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: VolumeFileLayersResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_volume_file_layers_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_volume_file_layers_handler_with_http_info(volume_name, file_name, **kwargs) # noqa: E501 - - @validate_arguments - def list_volume_file_layers_handler_with_http_info(self, volume_name : Annotated[StrictStr, Field(..., description="Volume name")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> ApiResponse: # noqa: E501 - """List the layers of a file in a volume. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_volume_file_layers_handler_with_http_info(volume_name, file_name, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_volume_file_layers_handler_serialize( + volume_name=volume_name, + file_name=file_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VolumeFileLayersResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_volume_file_layers_handler_with_http_info( + self, + volume_name: Annotated[StrictStr, Field(description="Volume name")], + file_name: Annotated[StrictStr, Field(description="File name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VolumeFileLayersResponse]: + """List the layers of a file in a volume. + :param volume_name: Volume name (required) :type volume_name: str :param file_name: File name (required) :type file_name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(VolumeFileLayersResponse, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_volume_file_layers_handler_serialize( + volume_name=volume_name, + file_name=file_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VolumeFileLayersResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'volume_name', - 'file_name' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def list_volume_file_layers_handler_without_preload_content( + self, + volume_name: Annotated[StrictStr, Field(description="Volume name")], + file_name: Annotated[StrictStr, Field(description="File name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the layers of a file in a volume. + + + :param volume_name: Volume name (required) + :type volume_name: str + :param file_name: File name (required) + :type file_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_volume_file_layers_handler_serialize( + volume_name=volume_name, + file_name=file_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_volume_file_layers_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "VolumeFileLayersResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['volume_name']: - _path_params['volume_name'] = _params['volume_name'] + def _list_volume_file_layers_handler_serialize( + self, + volume_name, + file_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['file_name']: - _path_params['file_name'] = _params['file_name'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if volume_name is not None: + _path_params['volume_name'] = volume_name + if file_name is not None: + _path_params['file_name'] = file_name # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "VolumeFileLayersResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/dataset/volumes/{volume_name}/files/{file_name}/layers', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/dataset/volumes/{volume_name}/files/{file_name}/layers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_volumes_handler(self, **kwargs) -> List[Volume]: # noqa: E501 - """Lists available volumes. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_volumes_handler(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def list_volumes_handler( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Volume]: + """Lists available volumes. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[Volume] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_volumes_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_volumes_handler_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def list_volumes_handler_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Lists available volumes. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_volumes_handler_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._list_volumes_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Volume]", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_volumes_handler_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Volume]]: + """Lists available volumes. + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[Volume], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._list_volumes_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Volume]", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_volumes_handler_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Lists available volumes. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_volumes_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_volumes_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Volume]", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _list_volumes_handler_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "List[Volume]", - '401': "ErrorResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/dataset/volumes', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/dataset/volumes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + + - @validate_arguments - def suggest_meta_data_handler(self, suggest_meta_data : SuggestMetaData, **kwargs) -> MetaDataSuggestion: # noqa: E501 - """Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. # noqa: E501 + @validate_call + def suggest_meta_data_handler( + self, + suggest_meta_data: SuggestMetaData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MetaDataSuggestion: + """Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. + + Tries to automatically detect the main file and layer name if not specified. + + :param suggest_meta_data: (required) + :type suggest_meta_data: SuggestMetaData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._suggest_meta_data_handler_serialize( + suggest_meta_data=suggest_meta_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaDataSuggestion", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def suggest_meta_data_handler_with_http_info( + self, + suggest_meta_data: SuggestMetaData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MetaDataSuggestion]: + """Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. + + Tries to automatically detect the main file and layer name if not specified. + + :param suggest_meta_data: (required) + :type suggest_meta_data: SuggestMetaData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._suggest_meta_data_handler_serialize( + suggest_meta_data=suggest_meta_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaDataSuggestion", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - Tries to automatically detect the main file and layer name if not specified. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.suggest_meta_data_handler(suggest_meta_data, async_req=True) - >>> result = thread.get() + @validate_call + def suggest_meta_data_handler_without_preload_content( + self, + suggest_meta_data: SuggestMetaData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. - :param suggest_meta_data: (required) - :type suggest_meta_data: SuggestMetaData - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: MetaDataSuggestion - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the suggest_meta_data_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.suggest_meta_data_handler_with_http_info(suggest_meta_data, **kwargs) # noqa: E501 - - @validate_arguments - def suggest_meta_data_handler_with_http_info(self, suggest_meta_data : SuggestMetaData, **kwargs) -> ApiResponse: # noqa: E501 - """Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. # noqa: E501 - - Tries to automatically detect the main file and layer name if not specified. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.suggest_meta_data_handler_with_http_info(suggest_meta_data, async_req=True) - >>> result = thread.get() + Tries to automatically detect the main file and layer name if not specified. :param suggest_meta_data: (required) :type suggest_meta_data: SuggestMetaData - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MetaDataSuggestion, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._suggest_meta_data_handler_serialize( + suggest_meta_data=suggest_meta_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'suggest_meta_data' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaDataSuggestion", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method suggest_meta_data_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _suggest_meta_data_handler_serialize( + self, + suggest_meta_data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['suggest_meta_data'] is not None: - _body_params = _params['suggest_meta_data'] + if suggest_meta_data is not None: + _body_params = suggest_meta_data + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { - '200': "MetaDataSuggestion", - '400': "ErrorResponse", - '401': "ErrorResponse", - } + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/dataset/suggest', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/dataset/suggest', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def update_dataset_handler(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], update_dataset : UpdateDataset, **kwargs) -> None: # noqa: E501 - """Update details about a dataset using the internal name. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def update_dataset_handler( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + update_dataset: UpdateDataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Update details about a dataset using the internal name. - >>> thread = api.update_dataset_handler(dataset, update_dataset, async_req=True) - >>> result = thread.get() :param dataset: Dataset Name (required) :type dataset: str :param update_dataset: (required) :type update_dataset: UpdateDataset - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_dataset_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_dataset_handler_with_http_info(dataset, update_dataset, **kwargs) # noqa: E501 - - @validate_arguments - def update_dataset_handler_with_http_info(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], update_dataset : UpdateDataset, **kwargs) -> ApiResponse: # noqa: E501 - """Update details about a dataset using the internal name. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_dataset_handler_with_http_info(dataset, update_dataset, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_dataset_handler_serialize( + dataset=dataset, + update_dataset=update_dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_dataset_handler_with_http_info( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + update_dataset: UpdateDataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Update details about a dataset using the internal name. + :param dataset: Dataset Name (required) :type dataset: str :param update_dataset: (required) :type update_dataset: UpdateDataset - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_dataset_handler_serialize( + dataset=dataset, + update_dataset=update_dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'dataset', - 'update_dataset' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def update_dataset_handler_without_preload_content( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + update_dataset: UpdateDataset, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update details about a dataset using the internal name. + + + :param dataset: Dataset Name (required) + :type dataset: str + :param update_dataset: (required) + :type update_dataset: UpdateDataset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dataset_handler_serialize( + dataset=dataset, + update_dataset=update_dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_dataset_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['dataset']: - _path_params['dataset'] = _params['dataset'] + def _update_dataset_handler_serialize( + self, + dataset, + update_dataset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if dataset is not None: + _path_params['dataset'] = dataset # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['update_dataset'] is not None: - _body_params = _params['update_dataset'] + if update_dataset is not None: + _body_params = update_dataset + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/dataset/{dataset}', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/dataset/{dataset}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def update_dataset_provenance_handler(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], provenances : Provenances, **kwargs) -> None: # noqa: E501 - """update_dataset_provenance_handler # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def update_dataset_provenance_handler( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + provenances: Provenances, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """update_dataset_provenance_handler - >>> thread = api.update_dataset_provenance_handler(dataset, provenances, async_req=True) - >>> result = thread.get() :param dataset: Dataset Name (required) :type dataset: str :param provenances: (required) :type provenances: Provenances - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_dataset_provenance_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_dataset_provenance_handler_with_http_info(dataset, provenances, **kwargs) # noqa: E501 - - @validate_arguments - def update_dataset_provenance_handler_with_http_info(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], provenances : Provenances, **kwargs) -> ApiResponse: # noqa: E501 - """update_dataset_provenance_handler # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_dataset_provenance_handler_with_http_info(dataset, provenances, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_dataset_provenance_handler_serialize( + dataset=dataset, + provenances=provenances, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_dataset_provenance_handler_with_http_info( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + provenances: Provenances, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """update_dataset_provenance_handler + :param dataset: Dataset Name (required) :type dataset: str :param provenances: (required) :type provenances: Provenances - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_dataset_provenance_handler_serialize( + dataset=dataset, + provenances=provenances, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'dataset', - 'provenances' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def update_dataset_provenance_handler_without_preload_content( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + provenances: Provenances, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """update_dataset_provenance_handler + + + :param dataset: Dataset Name (required) + :type dataset: str + :param provenances: (required) + :type provenances: Provenances + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dataset_provenance_handler_serialize( + dataset=dataset, + provenances=provenances, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_dataset_provenance_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['dataset']: - _path_params['dataset'] = _params['dataset'] + def _update_dataset_provenance_handler_serialize( + self, + dataset, + provenances, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if dataset is not None: + _path_params['dataset'] = dataset # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['provenances'] is not None: - _body_params = _params['provenances'] + if provenances is not None: + _body_params = provenances + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/dataset/{dataset}/provenance', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/dataset/{dataset}/provenance', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def update_dataset_symbology_handler(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], symbology : Symbology, **kwargs) -> None: # noqa: E501 - """Updates the dataset's symbology # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def update_dataset_symbology_handler( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + symbology: Symbology, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Updates the dataset's symbology - >>> thread = api.update_dataset_symbology_handler(dataset, symbology, async_req=True) - >>> result = thread.get() :param dataset: Dataset Name (required) :type dataset: str :param symbology: (required) :type symbology: Symbology - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_dataset_symbology_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_dataset_symbology_handler_with_http_info(dataset, symbology, **kwargs) # noqa: E501 - - @validate_arguments - def update_dataset_symbology_handler_with_http_info(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], symbology : Symbology, **kwargs) -> ApiResponse: # noqa: E501 - """Updates the dataset's symbology # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_dataset_symbology_handler_with_http_info(dataset, symbology, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_dataset_symbology_handler_serialize( + dataset=dataset, + symbology=symbology, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_dataset_symbology_handler_with_http_info( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + symbology: Symbology, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Updates the dataset's symbology + :param dataset: Dataset Name (required) :type dataset: str :param symbology: (required) :type symbology: Symbology - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_dataset_symbology_handler_serialize( + dataset=dataset, + symbology=symbology, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'dataset', - 'symbology' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def update_dataset_symbology_handler_without_preload_content( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + symbology: Symbology, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Updates the dataset's symbology + + + :param dataset: Dataset Name (required) + :type dataset: str + :param symbology: (required) + :type symbology: Symbology + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_dataset_symbology_handler_serialize( + dataset=dataset, + symbology=symbology, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_dataset_symbology_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['dataset']: - _path_params['dataset'] = _params['dataset'] + def _update_dataset_symbology_handler_serialize( + self, + dataset, + symbology, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if dataset is not None: + _path_params['dataset'] = dataset # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['symbology'] is not None: - _body_params = _params['symbology'] + if symbology is not None: + _body_params = symbology + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/dataset/{dataset}/symbology', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/dataset/{dataset}/symbology', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def update_loading_info_handler(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], meta_data_definition : MetaDataDefinition, **kwargs) -> None: # noqa: E501 - """Updates the dataset's loading info # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def update_loading_info_handler( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + meta_data_definition: MetaDataDefinition, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Updates the dataset's loading info - >>> thread = api.update_loading_info_handler(dataset, meta_data_definition, async_req=True) - >>> result = thread.get() :param dataset: Dataset Name (required) :type dataset: str :param meta_data_definition: (required) :type meta_data_definition: MetaDataDefinition - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_loading_info_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_loading_info_handler_with_http_info(dataset, meta_data_definition, **kwargs) # noqa: E501 - - @validate_arguments - def update_loading_info_handler_with_http_info(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], meta_data_definition : MetaDataDefinition, **kwargs) -> ApiResponse: # noqa: E501 - """Updates the dataset's loading info # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_loading_info_handler_with_http_info(dataset, meta_data_definition, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_loading_info_handler_serialize( + dataset=dataset, + meta_data_definition=meta_data_definition, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_loading_info_handler_with_http_info( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + meta_data_definition: MetaDataDefinition, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Updates the dataset's loading info + :param dataset: Dataset Name (required) :type dataset: str :param meta_data_definition: (required) :type meta_data_definition: MetaDataDefinition - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_loading_info_handler_serialize( + dataset=dataset, + meta_data_definition=meta_data_definition, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'dataset', - 'meta_data_definition' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def update_loading_info_handler_without_preload_content( + self, + dataset: Annotated[StrictStr, Field(description="Dataset Name")], + meta_data_definition: MetaDataDefinition, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Updates the dataset's loading info + + + :param dataset: Dataset Name (required) + :type dataset: str + :param meta_data_definition: (required) + :type meta_data_definition: MetaDataDefinition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_loading_info_handler_serialize( + dataset=dataset, + meta_data_definition=meta_data_definition, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_loading_info_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['dataset']: - _path_params['dataset'] = _params['dataset'] + def _update_loading_info_handler_serialize( + self, + dataset, + meta_data_definition, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if dataset is not None: + _path_params['dataset'] = dataset # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['meta_data_definition'] is not None: - _body_params = _params['meta_data_definition'] + if meta_data_definition is not None: + _body_params = meta_data_definition + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/dataset/{dataset}/loadingInfo', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/dataset/{dataset}/loadingInfo', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/general_api.py b/python/geoengine_openapi_client/api/general_api.py index 3d0a0f88..aa468d0c 100644 --- a/python/geoengine_openapi_client/api/general_api.py +++ b/python/geoengine_openapi_client/api/general_api.py @@ -12,21 +12,16 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated from geoengine_openapi_client.models.server_info import ServerInfo -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class GeneralApi: @@ -41,256 +36,479 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def available_handler(self, **kwargs) -> None: # noqa: E501 - """Server availablity check. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def available_handler( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Server availablity check. - >>> thread = api.available_handler(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the available_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.available_handler_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def available_handler_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Server availablity check. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.available_handler_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._available_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def available_handler_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Server availablity check. + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 - _params = locals() + _param = self._available_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def available_handler_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Server availablity check. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._available_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method available_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _available_handler_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/available', 'GET', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/available', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def server_info_handler(self, **kwargs) -> ServerInfo: # noqa: E501 - """Shows information about the server software version. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.server_info_handler(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def server_info_handler( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServerInfo: + """Shows information about the server software version. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ServerInfo - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the server_info_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.server_info_handler_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def server_info_handler_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Shows information about the server software version. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.server_info_handler_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._server_info_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServerInfo", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def server_info_handler_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServerInfo]: + """Shows information about the server software version. + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ServerInfo, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._server_info_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServerInfo", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def server_info_handler_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Shows information about the server software version. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._server_info_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method server_info_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ServerInfo", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _server_info_handler_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "ServerInfo", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/info', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/info', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/layers_api.py b/python/geoengine_openapi_client/api/layers_api.py index 1d4668de..692309b0 100644 --- a/python/geoengine_openapi_client/api/layers_api.py +++ b/python/geoengine_openapi_client/api/layers_api.py @@ -12,18 +12,14 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint +from pydantic import Field, StrictStr from typing import List - +from typing_extensions import Annotated from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response from geoengine_openapi_client.models.add_layer import AddLayer from geoengine_openapi_client.models.add_layer_collection import AddLayerCollection @@ -35,12 +31,9 @@ from geoengine_openapi_client.models.update_layer import UpdateLayer from geoengine_openapi_client.models.update_layer_collection import UpdateLayerCollection -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class LayersApi: @@ -55,601 +48,1143 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def add_collection(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], add_layer_collection : AddLayerCollection, **kwargs) -> AddCollection200Response: # noqa: E501 - """Add a new collection to an existing collection # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_collection( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + add_layer_collection: AddLayerCollection, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AddCollection200Response: + """Add a new collection to an existing collection - >>> thread = api.add_collection(collection, add_layer_collection, async_req=True) - >>> result = thread.get() :param collection: Layer collection id (required) :type collection: str :param add_layer_collection: (required) :type add_layer_collection: AddLayerCollection - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AddCollection200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the add_collection_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.add_collection_with_http_info(collection, add_layer_collection, **kwargs) # noqa: E501 - - @validate_arguments - def add_collection_with_http_info(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], add_layer_collection : AddLayerCollection, **kwargs) -> ApiResponse: # noqa: E501 - """Add a new collection to an existing collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_collection_with_http_info(collection, add_layer_collection, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._add_collection_serialize( + collection=collection, + add_layer_collection=add_layer_collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_collection_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + add_layer_collection: AddLayerCollection, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AddCollection200Response]: + """Add a new collection to an existing collection + :param collection: Layer collection id (required) :type collection: str :param add_layer_collection: (required) :type add_layer_collection: AddLayerCollection - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AddCollection200Response, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._add_collection_serialize( + collection=collection, + add_layer_collection=add_layer_collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'collection', - 'add_layer_collection' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def add_collection_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + add_layer_collection: AddLayerCollection, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a new collection to an existing collection + + + :param collection: Layer collection id (required) + :type collection: str + :param add_layer_collection: (required) + :type add_layer_collection: AddLayerCollection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_collection_serialize( + collection=collection, + add_layer_collection=add_layer_collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_collection" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['collection']: - _path_params['collection'] = _params['collection'] + def _add_collection_serialize( + self, + collection, + add_layer_collection, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if collection is not None: + _path_params['collection'] = collection # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['add_layer_collection'] is not None: - _body_params = _params['add_layer_collection'] + if add_layer_collection is not None: + _body_params = add_layer_collection + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { - '200': "AddCollection200Response", - } + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/layerDb/collections/{collection}/collections', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/layerDb/collections/{collection}/collections', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def add_existing_collection_to_collection(self, parent : Annotated[StrictStr, Field(..., description="Parent layer collection id")], collection : Annotated[StrictStr, Field(..., description="Layer collection id")], **kwargs) -> None: # noqa: E501 - """Add an existing collection to a collection # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_existing_collection_to_collection( + self, + parent: Annotated[StrictStr, Field(description="Parent layer collection id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Add an existing collection to a collection - >>> thread = api.add_existing_collection_to_collection(parent, collection, async_req=True) - >>> result = thread.get() :param parent: Parent layer collection id (required) :type parent: str :param collection: Layer collection id (required) :type collection: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the add_existing_collection_to_collection_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.add_existing_collection_to_collection_with_http_info(parent, collection, **kwargs) # noqa: E501 - - @validate_arguments - def add_existing_collection_to_collection_with_http_info(self, parent : Annotated[StrictStr, Field(..., description="Parent layer collection id")], collection : Annotated[StrictStr, Field(..., description="Layer collection id")], **kwargs) -> ApiResponse: # noqa: E501 - """Add an existing collection to a collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_existing_collection_to_collection_with_http_info(parent, collection, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._add_existing_collection_to_collection_serialize( + parent=parent, + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + # Note: fixed handling of empty responses + if response_data.data is None: + return None + + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_existing_collection_to_collection_with_http_info( + self, + parent: Annotated[StrictStr, Field(description="Parent layer collection id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Add an existing collection to a collection + :param parent: Parent layer collection id (required) :type parent: str :param collection: Layer collection id (required) :type collection: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._add_existing_collection_to_collection_serialize( + parent=parent, + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'parent', - 'collection' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def add_existing_collection_to_collection_without_preload_content( + self, + parent: Annotated[StrictStr, Field(description="Parent layer collection id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add an existing collection to a collection + + + :param parent: Parent layer collection id (required) + :type parent: str + :param collection: Layer collection id (required) + :type collection: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_existing_collection_to_collection_serialize( + parent=parent, + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_existing_collection_to_collection" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['parent']: - _path_params['parent'] = _params['parent'] + def _add_existing_collection_to_collection_serialize( + self, + parent, + collection, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['collection']: - _path_params['collection'] = _params['collection'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if parent is not None: + _path_params['parent'] = parent + if collection is not None: + _path_params['collection'] = collection # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/layerDb/collections/{parent}/collections/{collection}', 'POST', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/layerDb/collections/{parent}/collections/{collection}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def add_existing_layer_to_collection(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> None: # noqa: E501 - """Add an existing layer to a collection # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_existing_layer_to_collection( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Add an existing layer to a collection - >>> thread = api.add_existing_layer_to_collection(collection, layer, async_req=True) - >>> result = thread.get() :param collection: Layer collection id (required) :type collection: str :param layer: Layer id (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the add_existing_layer_to_collection_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.add_existing_layer_to_collection_with_http_info(collection, layer, **kwargs) # noqa: E501 - - @validate_arguments - def add_existing_layer_to_collection_with_http_info(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> ApiResponse: # noqa: E501 - """Add an existing layer to a collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_existing_layer_to_collection_with_http_info(collection, layer, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._add_existing_layer_to_collection_serialize( + collection=collection, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + # Note: fixed handling of empty responses + if response_data.data is None: + return None + + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_existing_layer_to_collection_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Add an existing layer to a collection + :param collection: Layer collection id (required) :type collection: str :param layer: Layer id (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._add_existing_layer_to_collection_serialize( + collection=collection, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'collection', - 'layer' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def add_existing_layer_to_collection_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add an existing layer to a collection + + + :param collection: Layer collection id (required) + :type collection: str + :param layer: Layer id (required) + :type layer: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_existing_layer_to_collection_serialize( + collection=collection, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_existing_layer_to_collection" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['collection']: - _path_params['collection'] = _params['collection'] + def _add_existing_layer_to_collection_serialize( + self, + collection, + layer, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['layer']: - _path_params['layer'] = _params['layer'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if collection is not None: + _path_params['collection'] = collection + if layer is not None: + _path_params['layer'] = layer # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/layerDb/collections/{collection}/layers/{layer}', 'POST', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/layerDb/collections/{collection}/layers/{layer}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def add_layer(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], add_layer : AddLayer, **kwargs) -> AddCollection200Response: # noqa: E501 - """Add a new layer to a collection # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_layer( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + add_layer: AddLayer, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AddCollection200Response: + """Add a new layer to a collection - >>> thread = api.add_layer(collection, add_layer, async_req=True) - >>> result = thread.get() :param collection: Layer collection id (required) :type collection: str :param add_layer: (required) :type add_layer: AddLayer - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AddCollection200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the add_layer_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.add_layer_with_http_info(collection, add_layer, **kwargs) # noqa: E501 - - @validate_arguments - def add_layer_with_http_info(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], add_layer : AddLayer, **kwargs) -> ApiResponse: # noqa: E501 - """Add a new layer to a collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_layer_with_http_info(collection, add_layer, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._add_layer_serialize( + collection=collection, + add_layer=add_layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_layer_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + add_layer: AddLayer, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AddCollection200Response]: + """Add a new layer to a collection + :param collection: Layer collection id (required) :type collection: str :param add_layer: (required) :type add_layer: AddLayer - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AddCollection200Response, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._add_layer_serialize( + collection=collection, + add_layer=add_layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'collection', - 'add_layer' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def add_layer_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + add_layer: AddLayer, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a new layer to a collection + + + :param collection: Layer collection id (required) + :type collection: str + :param add_layer: (required) + :type add_layer: AddLayer + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_layer_serialize( + collection=collection, + add_layer=add_layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_layer" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['collection']: - _path_params['collection'] = _params['collection'] + def _add_layer_serialize( + self, + collection, + add_layer, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if collection is not None: + _path_params['collection'] = collection # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['add_layer'] is not None: - _body_params = _params['add_layer'] + if add_layer is not None: + _body_params = add_layer + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { - '200': "AddCollection200Response", - } + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/layerDb/collections/{collection}/layers', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/layerDb/collections/{collection}/layers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def autocomplete_handler(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], collection : Annotated[StrictStr, Field(..., description="Layer collection id")], search_type : SearchType, search_string : StrictStr, limit : conint(strict=True, ge=0), offset : conint(strict=True, ge=0), **kwargs) -> List[str]: # noqa: E501 - """Autocompletes the search on the contents of the collection of the given provider # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.autocomplete_handler(provider, collection, search_type, search_string, limit, offset, async_req=True) - >>> result = thread.get() + @validate_call + def autocomplete_handler( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + search_type: SearchType, + search_string: StrictStr, + limit: Annotated[int, Field(strict=True, ge=0)], + offset: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[str]: + """Autocompletes the search on the contents of the collection of the given provider + :param provider: Data provider id (required) :type provider: str @@ -663,32 +1198,79 @@ def autocomplete_handler(self, provider : Annotated[StrictStr, Field(..., descri :type limit: int :param offset: (required) :type offset: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[str] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the autocomplete_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.autocomplete_handler_with_http_info(provider, collection, search_type, search_string, limit, offset, **kwargs) # noqa: E501 - - @validate_arguments - def autocomplete_handler_with_http_info(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], collection : Annotated[StrictStr, Field(..., description="Layer collection id")], search_type : SearchType, search_string : StrictStr, limit : conint(strict=True, ge=0), offset : conint(strict=True, ge=0), **kwargs) -> ApiResponse: # noqa: E501 - """Autocompletes the search on the contents of the collection of the given provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.autocomplete_handler_with_http_info(provider, collection, search_type, search_string, limit, offset, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._autocomplete_handler_serialize( + provider=provider, + collection=collection, + search_type=search_type, + search_string=search_string, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def autocomplete_handler_with_http_info( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + search_type: SearchType, + search_string: StrictStr, + limit: Annotated[int, Field(strict=True, ge=0)], + offset: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[str]]: + """Autocompletes the search on the contents of the collection of the given provider + :param provider: Data provider id (required) :type provider: str @@ -702,570 +1284,1065 @@ def autocomplete_handler_with_http_info(self, provider : Annotated[StrictStr, Fi :type limit: int :param offset: (required) :type offset: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[str], status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'provider', - 'collection', - 'search_type', - 'search_string', - 'limit', - 'offset' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._autocomplete_handler_serialize( + provider=provider, + collection=collection, + search_type=search_type, + search_string=search_string, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method autocomplete_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['provider']: - _path_params['provider'] = _params['provider'] - - if _params['collection']: - _path_params['collection'] = _params['collection'] - - - # process the query parameters - _query_params = [] - if _params.get('search_type') is not None: # noqa: E501 - _query_params.append(('searchType', _params['search_type'].value)) - - if _params.get('search_string') is not None: # noqa: E501 - _query_params.append(('searchString', _params['search_string'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('limit') is not None: # noqa: E501 - _query_params.append(('limit', _params['limit'])) - if _params.get('offset') is not None: # noqa: E501 - _query_params.append(('offset', _params['offset'])) + @validate_call + def autocomplete_handler_without_preload_content( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + search_type: SearchType, + search_string: StrictStr, + limit: Annotated[int, Field(strict=True, ge=0)], + offset: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Autocompletes the search on the contents of the collection of the given provider - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 + :param provider: Data provider id (required) + :type provider: str + :param collection: Layer collection id (required) + :type collection: str + :param search_type: (required) + :type search_type: SearchType + :param search_string: (required) + :type search_string: str + :param limit: (required) + :type limit: int + :param offset: (required) + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._autocomplete_handler_serialize( + provider=provider, + collection=collection, + search_type=search_type, + search_string=search_string, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '200': "List[str]", } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _autocomplete_handler_serialize( + self, + provider, + collection, + search_type, + search_string, + limit, + offset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if provider is not None: + _path_params['provider'] = provider + if collection is not None: + _path_params['collection'] = collection + # process the query parameters + if search_type is not None: + + _query_params.append(('searchType', search_type.value)) + + if search_string is not None: + + _query_params.append(('searchString', search_string)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - return self.api_client.call_api( - '/layers/collections/search/autocomplete/{provider}/{collection}', 'GET', - _path_params, - _query_params, - _header_params, + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/layers/collections/search/autocomplete/{provider}/{collection}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def layer_handler(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> Layer: # noqa: E501 - """Retrieves the layer of the given provider # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def layer_handler( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Layer: + """Retrieves the layer of the given provider - >>> thread = api.layer_handler(provider, layer, async_req=True) - >>> result = thread.get() :param provider: Data provider id (required) :type provider: str :param layer: Layer id (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Layer - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the layer_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.layer_handler_with_http_info(provider, layer, **kwargs) # noqa: E501 - - @validate_arguments - def layer_handler_with_http_info(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves the layer of the given provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.layer_handler_with_http_info(provider, layer, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._layer_handler_serialize( + provider=provider, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Layer", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def layer_handler_with_http_info( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Layer]: + """Retrieves the layer of the given provider + :param provider: Data provider id (required) :type provider: str :param layer: Layer id (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Layer, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._layer_handler_serialize( + provider=provider, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Layer", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'provider', - 'layer' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def layer_handler_without_preload_content( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves the layer of the given provider + + + :param provider: Data provider id (required) + :type provider: str + :param layer: Layer id (required) + :type layer: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._layer_handler_serialize( + provider=provider, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method layer_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Layer", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['provider']: - _path_params['provider'] = _params['provider'] + def _layer_handler_serialize( + self, + provider, + layer, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['layer']: - _path_params['layer'] = _params['layer'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if provider is not None: + _path_params['provider'] = provider + if layer is not None: + _path_params['layer'] = layer # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "Layer", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/layers/{provider}/{layer}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/layers/{provider}/{layer}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def layer_to_dataset(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> TaskResponse: # noqa: E501 - """Persist a raster layer from a provider as a dataset. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.layer_to_dataset(provider, layer, async_req=True) - >>> result = thread.get() + @validate_call + def layer_to_dataset( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TaskResponse: + """Persist a raster layer from a provider as a dataset. + :param provider: Data provider id (required) :type provider: str :param layer: Layer id (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: TaskResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the layer_to_dataset_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.layer_to_dataset_with_http_info(provider, layer, **kwargs) # noqa: E501 - - @validate_arguments - def layer_to_dataset_with_http_info(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> ApiResponse: # noqa: E501 - """Persist a raster layer from a provider as a dataset. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.layer_to_dataset_with_http_info(provider, layer, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._layer_to_dataset_serialize( + provider=provider, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def layer_to_dataset_with_http_info( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TaskResponse]: + """Persist a raster layer from a provider as a dataset. + :param provider: Data provider id (required) :type provider: str :param layer: Layer id (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(TaskResponse, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._layer_to_dataset_serialize( + provider=provider, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'provider', - 'layer' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def layer_to_dataset_without_preload_content( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Persist a raster layer from a provider as a dataset. + + + :param provider: Data provider id (required) + :type provider: str + :param layer: Layer id (required) + :type layer: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._layer_to_dataset_serialize( + provider=provider, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method layer_to_dataset" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['provider']: - _path_params['provider'] = _params['provider'] + def _layer_to_dataset_serialize( + self, + provider, + layer, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['layer']: - _path_params['layer'] = _params['layer'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if provider is not None: + _path_params['provider'] = provider + if layer is not None: + _path_params['layer'] = layer # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "TaskResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/layers/{provider}/{layer}/dataset', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/layers/{provider}/{layer}/dataset', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def layer_to_workflow_id_handler(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> AddCollection200Response: # noqa: E501 - """Registers a layer from a provider as a workflow and returns the workflow id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.layer_to_workflow_id_handler(provider, layer, async_req=True) - >>> result = thread.get() + + @validate_call + def layer_to_workflow_id_handler( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AddCollection200Response: + """Registers a layer from a provider as a workflow and returns the workflow id + :param provider: Data provider id (required) :type provider: str :param layer: Layer id (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AddCollection200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the layer_to_workflow_id_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.layer_to_workflow_id_handler_with_http_info(provider, layer, **kwargs) # noqa: E501 - - @validate_arguments - def layer_to_workflow_id_handler_with_http_info(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> ApiResponse: # noqa: E501 - """Registers a layer from a provider as a workflow and returns the workflow id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.layer_to_workflow_id_handler_with_http_info(provider, layer, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._layer_to_workflow_id_handler_serialize( + provider=provider, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def layer_to_workflow_id_handler_with_http_info( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AddCollection200Response]: + """Registers a layer from a provider as a workflow and returns the workflow id + :param provider: Data provider id (required) :type provider: str :param layer: Layer id (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AddCollection200Response, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._layer_to_workflow_id_handler_serialize( + provider=provider, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'provider', - 'layer' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def layer_to_workflow_id_handler_without_preload_content( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Registers a layer from a provider as a workflow and returns the workflow id + + + :param provider: Data provider id (required) + :type provider: str + :param layer: Layer id (required) + :type layer: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._layer_to_workflow_id_handler_serialize( + provider=provider, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method layer_to_workflow_id_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['provider']: - _path_params['provider'] = _params['provider'] + def _layer_to_workflow_id_handler_serialize( + self, + provider, + layer, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['layer']: - _path_params['layer'] = _params['layer'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if provider is not None: + _path_params['provider'] = provider + if layer is not None: + _path_params['layer'] = layer # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "AddCollection200Response", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/layers/{provider}/{layer}/workflowId', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/layers/{provider}/{layer}/workflowId', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_collection_handler(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], collection : Annotated[StrictStr, Field(..., description="Layer collection id")], offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> LayerCollection: # noqa: E501 - """List the contents of the collection of the given provider # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_collection_handler(provider, collection, offset, limit, async_req=True) - >>> result = thread.get() + @validate_call + def list_collection_handler( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LayerCollection: + """List the contents of the collection of the given provider + :param provider: Data provider id (required) :type provider: str @@ -1275,32 +2352,75 @@ def list_collection_handler(self, provider : Annotated[StrictStr, Field(..., des :type offset: int :param limit: (required) :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: LayerCollection - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_collection_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_collection_handler_with_http_info(provider, collection, offset, limit, **kwargs) # noqa: E501 - - @validate_arguments - def list_collection_handler_with_http_info(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], collection : Annotated[StrictStr, Field(..., description="Layer collection id")], offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> ApiResponse: # noqa: E501 - """List the contents of the collection of the given provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_collection_handler_with_http_info(provider, collection, offset, limit, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_collection_handler_serialize( + provider=provider, + collection=collection, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LayerCollection", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_collection_handler_with_http_info( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LayerCollection]: + """List the contents of the collection of the given provider + :param provider: Data provider id (required) :type provider: str @@ -1310,952 +2430,1809 @@ def list_collection_handler_with_http_info(self, provider : Annotated[StrictStr, :type offset: int :param limit: (required) :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(LayerCollection, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'provider', - 'collection', - 'offset', - 'limit' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_collection_handler_serialize( + provider=provider, + collection=collection, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_collection_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['provider']: - _path_params['provider'] = _params['provider'] - - if _params['collection']: - _path_params['collection'] = _params['collection'] - - - # process the query parameters - _query_params = [] - if _params.get('offset') is not None: # noqa: E501 - _query_params.append(('offset', _params['offset'])) - - if _params.get('limit') is not None: # noqa: E501 - _query_params.append(('limit', _params['limit'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '200': "LayerCollection", } - - return self.api_client.call_api( - '/layers/collections/{provider}/{collection}', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + ) - @validate_arguments - def list_root_collections_handler(self, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> LayerCollection: # noqa: E501 - """List all layer collections # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_collection_handler_without_preload_content( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the contents of the collection of the given provider - >>> thread = api.list_root_collections_handler(offset, limit, async_req=True) - >>> result = thread.get() + :param provider: Data provider id (required) + :type provider: str + :param collection: Layer collection id (required) + :type collection: str :param offset: (required) :type offset: int :param limit: (required) :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: LayerCollection - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_root_collections_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_root_collections_handler_with_http_info(offset, limit, **kwargs) # noqa: E501 - - @validate_arguments - def list_root_collections_handler_with_http_info(self, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> ApiResponse: # noqa: E501 - """List all layer collections # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_root_collections_handler_with_http_info(offset, limit, async_req=True) - >>> result = thread.get() - - :param offset: (required) - :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_collection_handler_serialize( + provider=provider, + collection=collection, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LayerCollection", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_collection_handler_serialize( + self, + provider, + collection, + offset, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if provider is not None: + _path_params['provider'] = provider + if collection is not None: + _path_params['collection'] = collection + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/layers/collections/{provider}/{collection}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_root_collections_handler( + self, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LayerCollection: + """List all layer collections + + + :param offset: (required) + :type offset: int :param limit: (required) :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(LayerCollection, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_root_collections_handler_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "LayerCollection", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_root_collections_handler_with_http_info( + self, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LayerCollection]: + """List all layer collections - _all_params = [ - 'offset', - 'limit' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + :param offset: (required) + :type offset: int + :param limit: (required) + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_root_collections_handler_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LayerCollection", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_root_collections_handler_without_preload_content( + self, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all layer collections + + + :param offset: (required) + :type offset: int + :param limit: (required) + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_root_collections_handler_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_root_collections_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "LayerCollection", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _list_root_collections_handler_serialize( + self, + offset, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('offset') is not None: # noqa: E501 - _query_params.append(('offset', _params['offset'])) + _host = None - if _params.get('limit') is not None: # noqa: E501 - _query_params.append(('limit', _params['limit'])) + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "LayerCollection", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/layers/collections', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/layers/collections', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def provider_capabilities_handler(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], **kwargs) -> ProviderCapabilities: # noqa: E501 - """provider_capabilities_handler # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def provider_capabilities_handler( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProviderCapabilities: + """provider_capabilities_handler - >>> thread = api.provider_capabilities_handler(provider, async_req=True) - >>> result = thread.get() :param provider: Data provider id (required) :type provider: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ProviderCapabilities - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the provider_capabilities_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.provider_capabilities_handler_with_http_info(provider, **kwargs) # noqa: E501 - - @validate_arguments - def provider_capabilities_handler_with_http_info(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], **kwargs) -> ApiResponse: # noqa: E501 - """provider_capabilities_handler # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.provider_capabilities_handler_with_http_info(provider, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._provider_capabilities_handler_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProviderCapabilities", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def provider_capabilities_handler_with_http_info( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProviderCapabilities]: + """provider_capabilities_handler + :param provider: Data provider id (required) :type provider: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ProviderCapabilities, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._provider_capabilities_handler_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProviderCapabilities", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'provider' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def provider_capabilities_handler_without_preload_content( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """provider_capabilities_handler + + + :param provider: Data provider id (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._provider_capabilities_handler_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method provider_capabilities_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProviderCapabilities", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['provider']: - _path_params['provider'] = _params['provider'] + def _provider_capabilities_handler_serialize( + self, + provider, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if provider is not None: + _path_params['provider'] = provider # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "ProviderCapabilities", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/layers/{provider}/capabilities', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/layers/{provider}/capabilities', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def remove_collection(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], **kwargs) -> None: # noqa: E501 - """Remove a collection # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_collection(collection, async_req=True) - >>> result = thread.get() + @validate_call + def remove_collection( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove a collection + :param collection: Layer collection id (required) :type collection: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the remove_collection_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.remove_collection_with_http_info(collection, **kwargs) # noqa: E501 - - @validate_arguments - def remove_collection_with_http_info(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], **kwargs) -> ApiResponse: # noqa: E501 - """Remove a collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.remove_collection_with_http_info(collection, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._remove_collection_serialize( + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + # Note: fixed handling of empty responses + if response_data.data is None: + return None + + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remove_collection_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove a collection + :param collection: Layer collection id (required) :type collection: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._remove_collection_serialize( + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'collection' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def remove_collection_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove a collection + + + :param collection: Layer collection id (required) + :type collection: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_collection_serialize( + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_collection" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['collection']: - _path_params['collection'] = _params['collection'] + def _remove_collection_serialize( + self, + collection, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if collection is not None: + _path_params['collection'] = collection # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/layerDb/collections/{collection}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/layerDb/collections/{collection}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def remove_collection_from_collection(self, parent : Annotated[StrictStr, Field(..., description="Parent layer collection id")], collection : Annotated[StrictStr, Field(..., description="Layer collection id")], **kwargs) -> None: # noqa: E501 - """Delete a collection from a collection # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_collection_from_collection(parent, collection, async_req=True) - >>> result = thread.get() + + @validate_call + def remove_collection_from_collection( + self, + parent: Annotated[StrictStr, Field(description="Parent layer collection id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a collection from a collection + :param parent: Parent layer collection id (required) :type parent: str :param collection: Layer collection id (required) :type collection: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the remove_collection_from_collection_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.remove_collection_from_collection_with_http_info(parent, collection, **kwargs) # noqa: E501 - - @validate_arguments - def remove_collection_from_collection_with_http_info(self, parent : Annotated[StrictStr, Field(..., description="Parent layer collection id")], collection : Annotated[StrictStr, Field(..., description="Layer collection id")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete a collection from a collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.remove_collection_from_collection_with_http_info(parent, collection, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._remove_collection_from_collection_serialize( + parent=parent, + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + # Note: fixed handling of empty responses + if response_data.data is None: + return None + + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remove_collection_from_collection_with_http_info( + self, + parent: Annotated[StrictStr, Field(description="Parent layer collection id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a collection from a collection + + + :param parent: Parent layer collection id (required) + :type parent: str + :param collection: Layer collection id (required) + :type collection: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_collection_from_collection_serialize( + parent=parent, + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def remove_collection_from_collection_without_preload_content( + self, + parent: Annotated[StrictStr, Field(description="Parent layer collection id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a collection from a collection + :param parent: Parent layer collection id (required) :type parent: str :param collection: Layer collection id (required) :type collection: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_collection_from_collection_serialize( + parent=parent, + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_collection_from_collection_serialize( + self, + parent, + collection, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if parent is not None: + _path_params['parent'] = parent + if collection is not None: + _path_params['collection'] = collection + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/layerDb/collections/{parent}/collections/{collection}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def remove_layer( + self, + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove a collection + + + :param layer: Layer id (required) + :type layer: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_layer_serialize( + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remove_layer_with_http_info( + self, + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove a collection + + + :param layer: Layer id (required) + :type layer: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_layer_serialize( + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def remove_layer_without_preload_content( + self, + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove a collection + + + :param layer: Layer id (required) + :type layer: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() + """ # noqa: E501 + + _param = self._remove_layer_serialize( + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'parent', - 'collection' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_collection_from_collection" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _remove_layer_serialize( + self, + layer, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['parent']: - _path_params['parent'] = _params['parent'] + _host = None - if _params['collection']: - _path_params['collection'] = _params['collection'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if layer is not None: + _path_params['layer'] = layer # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/layerDb/collections/{parent}/collections/{collection}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/layerDb/layers/{layer}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def remove_layer(self, layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> None: # noqa: E501 - """Remove a collection # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_layer(layer, async_req=True) - >>> result = thread.get() - :param layer: Layer id (required) - :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the remove_layer_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.remove_layer_with_http_info(layer, **kwargs) # noqa: E501 - - @validate_arguments - def remove_layer_with_http_info(self, layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> ApiResponse: # noqa: E501 - """Remove a collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.remove_layer_with_http_info(layer, async_req=True) - >>> result = thread.get() + @validate_call + def remove_layer_from_collection( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove a layer from a collection + + :param collection: Layer collection id (required) + :type collection: str :param layer: Layer id (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'layer' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._remove_layer_from_collection_serialize( + collection=collection, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_layer" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['layer']: - _path_params['layer'] = _params['layer'] - - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = {} + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + # Note: fixed handling of empty responses + if response_data.data is None: + return None - return self.api_client.call_api( - '/layerDb/layers/{layer}', 'DELETE', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def remove_layer_from_collection(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> None: # noqa: E501 - """Remove a layer from a collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def remove_layer_from_collection_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove a layer from a collection - >>> thread = api.remove_layer_from_collection(collection, layer, async_req=True) - >>> result = thread.get() :param collection: Layer collection id (required) :type collection: str :param layer: Layer id (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the remove_layer_from_collection_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.remove_layer_from_collection_with_http_info(collection, layer, **kwargs) # noqa: E501 - - @validate_arguments - def remove_layer_from_collection_with_http_info(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], layer : Annotated[StrictStr, Field(..., description="Layer id")], **kwargs) -> ApiResponse: # noqa: E501 - """Remove a layer from a collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.remove_layer_from_collection_with_http_info(collection, layer, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._remove_layer_from_collection_serialize( + collection=collection, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def remove_layer_from_collection_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + layer: Annotated[StrictStr, Field(description="Layer id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove a layer from a collection + :param collection: Layer collection id (required) :type collection: str :param layer: Layer id (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() + """ # noqa: E501 + + _param = self._remove_layer_from_collection_serialize( + collection=collection, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'collection', - 'layer' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_layer_from_collection" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _remove_layer_from_collection_serialize( + self, + collection, + layer, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['collection']: - _path_params['collection'] = _params['collection'] + _host = None - if _params['layer']: - _path_params['layer'] = _params['layer'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if collection is not None: + _path_params['collection'] = collection + if layer is not None: + _path_params['layer'] = layer # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/layerDb/collections/{collection}/layers/{layer}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/layerDb/collections/{collection}/layers/{layer}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def search_handler(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], collection : Annotated[StrictStr, Field(..., description="Layer collection id")], search_type : SearchType, search_string : StrictStr, limit : conint(strict=True, ge=0), offset : conint(strict=True, ge=0), **kwargs) -> LayerCollection: # noqa: E501 - """Searches the contents of the collection of the given provider # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_handler(provider, collection, search_type, search_string, limit, offset, async_req=True) - >>> result = thread.get() + @validate_call + def search_handler( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + search_type: SearchType, + search_string: StrictStr, + limit: Annotated[int, Field(strict=True, ge=0)], + offset: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LayerCollection: + """Searches the contents of the collection of the given provider + :param provider: Data provider id (required) :type provider: str @@ -2269,32 +4246,79 @@ def search_handler(self, provider : Annotated[StrictStr, Field(..., description= :type limit: int :param offset: (required) :type offset: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: LayerCollection - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the search_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.search_handler_with_http_info(provider, collection, search_type, search_string, limit, offset, **kwargs) # noqa: E501 - - @validate_arguments - def search_handler_with_http_info(self, provider : Annotated[StrictStr, Field(..., description="Data provider id")], collection : Annotated[StrictStr, Field(..., description="Layer collection id")], search_type : SearchType, search_string : StrictStr, limit : conint(strict=True, ge=0), offset : conint(strict=True, ge=0), **kwargs) -> ApiResponse: # noqa: E501 - """Searches the contents of the collection of the given provider # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_handler_with_http_info(provider, collection, search_type, search_string, limit, offset, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._search_handler_serialize( + provider=provider, + collection=collection, + search_type=search_type, + search_string=search_string, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LayerCollection", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_handler_with_http_info( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + search_type: SearchType, + search_string: StrictStr, + limit: Annotated[int, Field(strict=True, ge=0)], + offset: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LayerCollection]: + """Searches the contents of the collection of the given provider + :param provider: Data provider id (required) :type provider: str @@ -2308,413 +4332,777 @@ def search_handler_with_http_info(self, provider : Annotated[StrictStr, Field(.. :type limit: int :param offset: (required) :type offset: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(LayerCollection, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'provider', - 'collection', - 'search_type', - 'search_string', - 'limit', - 'offset' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._search_handler_serialize( + provider=provider, + collection=collection, + search_type=search_type, + search_string=search_string, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method search_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['provider']: - _path_params['provider'] = _params['provider'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "LayerCollection", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params['collection']: - _path_params['collection'] = _params['collection'] + @validate_call + def search_handler_without_preload_content( + self, + provider: Annotated[StrictStr, Field(description="Data provider id")], + collection: Annotated[StrictStr, Field(description="Layer collection id")], + search_type: SearchType, + search_string: StrictStr, + limit: Annotated[int, Field(strict=True, ge=0)], + offset: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Searches the contents of the collection of the given provider - # process the query parameters - _query_params = [] - if _params.get('search_type') is not None: # noqa: E501 - _query_params.append(('searchType', _params['search_type'].value)) - if _params.get('search_string') is not None: # noqa: E501 - _query_params.append(('searchString', _params['search_string'])) + :param provider: Data provider id (required) + :type provider: str + :param collection: Layer collection id (required) + :type collection: str + :param search_type: (required) + :type search_type: SearchType + :param search_string: (required) + :type search_string: str + :param limit: (required) + :type limit: int + :param offset: (required) + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_handler_serialize( + provider=provider, + collection=collection, + search_type=search_type, + search_string=search_string, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('limit') is not None: # noqa: E501 - _query_params.append(('limit', _params['limit'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "LayerCollection", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_handler_serialize( + self, + provider, + collection, + search_type, + search_string, + limit, + offset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('offset') is not None: # noqa: E501 - _query_params.append(('offset', _params['offset'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if provider is not None: + _path_params['provider'] = provider + if collection is not None: + _path_params['collection'] = collection + # process the query parameters + if search_type is not None: + + _query_params.append(('searchType', search_type.value)) + + if search_string is not None: + + _query_params.append(('searchString', search_string)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "LayerCollection", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/layers/collections/search/{provider}/{collection}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/layers/collections/search/{provider}/{collection}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def update_collection(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], update_layer_collection : UpdateLayerCollection, **kwargs) -> None: # noqa: E501 - """Update a collection # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_collection(collection, update_layer_collection, async_req=True) - >>> result = thread.get() + + @validate_call + def update_collection( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + update_layer_collection: UpdateLayerCollection, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Update a collection + :param collection: Layer collection id (required) :type collection: str :param update_layer_collection: (required) :type update_layer_collection: UpdateLayerCollection - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_collection_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_collection_with_http_info(collection, update_layer_collection, **kwargs) # noqa: E501 - - @validate_arguments - def update_collection_with_http_info(self, collection : Annotated[StrictStr, Field(..., description="Layer collection id")], update_layer_collection : UpdateLayerCollection, **kwargs) -> ApiResponse: # noqa: E501 - """Update a collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_collection_with_http_info(collection, update_layer_collection, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_collection_serialize( + collection=collection, + update_layer_collection=update_layer_collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_collection_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + update_layer_collection: UpdateLayerCollection, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Update a collection + :param collection: Layer collection id (required) :type collection: str :param update_layer_collection: (required) :type update_layer_collection: UpdateLayerCollection - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_collection_serialize( + collection=collection, + update_layer_collection=update_layer_collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'collection', - 'update_layer_collection' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def update_collection_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Layer collection id")], + update_layer_collection: UpdateLayerCollection, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a collection + + + :param collection: Layer collection id (required) + :type collection: str + :param update_layer_collection: (required) + :type update_layer_collection: UpdateLayerCollection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_collection_serialize( + collection=collection, + update_layer_collection=update_layer_collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_collection" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['collection']: - _path_params['collection'] = _params['collection'] + def _update_collection_serialize( + self, + collection, + update_layer_collection, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if collection is not None: + _path_params['collection'] = collection # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['update_layer_collection'] is not None: - _body_params = _params['update_layer_collection'] + if update_layer_collection is not None: + _body_params = update_layer_collection + + # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/layerDb/collections/{collection}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/layerDb/collections/{collection}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def update_layer(self, layer : Annotated[StrictStr, Field(..., description="Layer id")], update_layer : UpdateLayer, **kwargs) -> None: # noqa: E501 - """Update a layer # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_layer(layer, update_layer, async_req=True) - >>> result = thread.get() + @validate_call + def update_layer( + self, + layer: Annotated[StrictStr, Field(description="Layer id")], + update_layer: UpdateLayer, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Update a layer + :param layer: Layer id (required) :type layer: str :param update_layer: (required) :type update_layer: UpdateLayer - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_layer_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_layer_with_http_info(layer, update_layer, **kwargs) # noqa: E501 - - @validate_arguments - def update_layer_with_http_info(self, layer : Annotated[StrictStr, Field(..., description="Layer id")], update_layer : UpdateLayer, **kwargs) -> ApiResponse: # noqa: E501 - """Update a layer # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_layer_with_http_info(layer, update_layer, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_layer_serialize( + layer=layer, + update_layer=update_layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_layer_with_http_info( + self, + layer: Annotated[StrictStr, Field(description="Layer id")], + update_layer: UpdateLayer, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Update a layer + :param layer: Layer id (required) :type layer: str :param update_layer: (required) :type update_layer: UpdateLayer - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_layer_serialize( + layer=layer, + update_layer=update_layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'layer', - 'update_layer' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def update_layer_without_preload_content( + self, + layer: Annotated[StrictStr, Field(description="Layer id")], + update_layer: UpdateLayer, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a layer + + + :param layer: Layer id (required) + :type layer: str + :param update_layer: (required) + :type update_layer: UpdateLayer + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_layer_serialize( + layer=layer, + update_layer=update_layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_layer" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['layer']: - _path_params['layer'] = _params['layer'] + def _update_layer_serialize( + self, + layer, + update_layer, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if layer is not None: + _path_params['layer'] = layer # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['update_layer'] is not None: - _body_params = _params['update_layer'] + if update_layer is not None: + _body_params = update_layer + + # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/layerDb/layers/{layer}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/layerDb/layers/{layer}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/ml_api.py b/python/geoengine_openapi_client/api/ml_api.py index c0ef41b6..1f9d40dc 100644 --- a/python/geoengine_openapi_client/api/ml_api.py +++ b/python/geoengine_openapi_client/api/ml_api.py @@ -12,27 +12,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr +from pydantic import Field, StrictStr from typing import List - +from typing_extensions import Annotated from geoengine_openapi_client.models.ml_model import MlModel from geoengine_openapi_client.models.ml_model_name_response import MlModelNameResponse -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class MLApi: @@ -47,415 +40,774 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def add_ml_model(self, ml_model : MlModel, **kwargs) -> MlModelNameResponse: # noqa: E501 - """Create a new ml model. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_ml_model( + self, + ml_model: MlModel, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MlModelNameResponse: + """Create a new ml model. - >>> thread = api.add_ml_model(ml_model, async_req=True) - >>> result = thread.get() :param ml_model: (required) :type ml_model: MlModel - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: MlModelNameResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the add_ml_model_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.add_ml_model_with_http_info(ml_model, **kwargs) # noqa: E501 - - @validate_arguments - def add_ml_model_with_http_info(self, ml_model : MlModel, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new ml model. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_ml_model_with_http_info(ml_model, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._add_ml_model_serialize( + ml_model=ml_model, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MlModelNameResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_ml_model_with_http_info( + self, + ml_model: MlModel, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MlModelNameResponse]: + """Create a new ml model. + :param ml_model: (required) :type ml_model: MlModel - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MlModelNameResponse, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._add_ml_model_serialize( + ml_model=ml_model, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "MlModelNameResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'ml_model' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def add_ml_model_without_preload_content( + self, + ml_model: MlModel, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new ml model. + + + :param ml_model: (required) + :type ml_model: MlModel + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_ml_model_serialize( + ml_model=ml_model, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_ml_model" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MlModelNameResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _add_ml_model_serialize( + self, + ml_model, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['ml_model'] is not None: - _body_params = _params['ml_model'] + if ml_model is not None: + _body_params = ml_model + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { - '200': "MlModelNameResponse", - } + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/ml/models', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/ml/models', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_ml_model(self, model_name : Annotated[StrictStr, Field(..., description="Ml Model Name")], **kwargs) -> MlModel: # noqa: E501 - """Get ml model by name. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_ml_model(model_name, async_req=True) - >>> result = thread.get() + + @validate_call + def get_ml_model( + self, + model_name: Annotated[StrictStr, Field(description="Ml Model Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MlModel: + """Get ml model by name. + :param model_name: Ml Model Name (required) :type model_name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: MlModel - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_ml_model_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_ml_model_with_http_info(model_name, **kwargs) # noqa: E501 - - @validate_arguments - def get_ml_model_with_http_info(self, model_name : Annotated[StrictStr, Field(..., description="Ml Model Name")], **kwargs) -> ApiResponse: # noqa: E501 - """Get ml model by name. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_ml_model_with_http_info(model_name, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_ml_model_serialize( + model_name=model_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MlModel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_ml_model_with_http_info( + self, + model_name: Annotated[StrictStr, Field(description="Ml Model Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MlModel]: + """Get ml model by name. + :param model_name: Ml Model Name (required) :type model_name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MlModel, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_ml_model_serialize( + model_name=model_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MlModel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'model_name' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_ml_model_without_preload_content( + self, + model_name: Annotated[StrictStr, Field(description="Ml Model Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get ml model by name. + + + :param model_name: Ml Model Name (required) + :type model_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_ml_model_serialize( + model_name=model_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_ml_model" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MlModel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['model_name']: - _path_params['model_name'] = _params['model_name'] + def _get_ml_model_serialize( + self, + model_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if model_name is not None: + _path_params['model_name'] = model_name # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "MlModel", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/ml/models/{model_name}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/ml/models/{model_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_ml_models(self, **kwargs) -> List[MlModel]: # noqa: E501 - """List ml models. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_ml_models(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + @validate_call + def list_ml_models( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[MlModel]: + """List ml models. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[MlModel] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_ml_models_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_ml_models_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def list_ml_models_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """List ml models. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_ml_models_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._list_ml_models_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[MlModel]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_ml_models_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[MlModel]]: + """List ml models. + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[MlModel], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._list_ml_models_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[MlModel]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_ml_models_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List ml models. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_ml_models_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_ml_models" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[MlModel]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _list_ml_models_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "List[MlModel]", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/ml/models', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/ml/models', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/ogcwcs_api.py b/python/geoengine_openapi_client/api/ogcwcs_api.py index b968e241..c88abd70 100644 --- a/python/geoengine_openapi_client/api/ogcwcs_api.py +++ b/python/geoengine_openapi_client/api/ogcwcs_api.py @@ -12,18 +12,14 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictFloat, StrictInt, StrictStr - -from typing import Any, Optional, Union +from pydantic import Field, StrictBytes, StrictFloat, StrictInt, StrictStr +from typing import Any, Optional, Tuple, Union +from typing_extensions import Annotated from geoengine_openapi_client.models.describe_coverage_request import DescribeCoverageRequest from geoengine_openapi_client.models.get_capabilities_request import GetCapabilitiesRequest from geoengine_openapi_client.models.get_coverage_format import GetCoverageFormat @@ -31,12 +27,9 @@ from geoengine_openapi_client.models.wcs_service import WcsService from geoengine_openapi_client.models.wcs_version import WcsVersion -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class OGCWCSApi: @@ -51,15 +44,29 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def wcs_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], service : WcsService, request : GetCapabilitiesRequest, version : Optional[Any] = None, **kwargs) -> str: # noqa: E501 - """Get WCS Capabilities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def wcs_capabilities_handler( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + service: WcsService, + request: GetCapabilitiesRequest, + version: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Get WCS Capabilities - >>> thread = api.wcs_capabilities_handler(workflow, service, request, version, async_req=True) - >>> result = thread.get() :param workflow: Workflow id (required) :type workflow: str @@ -69,32 +76,75 @@ def wcs_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., de :type request: GetCapabilitiesRequest :param version: :type version: WcsVersion - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the wcs_capabilities_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.wcs_capabilities_handler_with_http_info(workflow, service, request, version, **kwargs) # noqa: E501 - - @validate_arguments - def wcs_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], service : WcsService, request : GetCapabilitiesRequest, version : Optional[Any] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Get WCS Capabilities # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.wcs_capabilities_handler_with_http_info(workflow, service, request, version, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._wcs_capabilities_handler_serialize( + workflow=workflow, + service=service, + request=request, + version=version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def wcs_capabilities_handler_with_http_info( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + service: WcsService, + request: GetCapabilitiesRequest, + version: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Get WCS Capabilities + :param workflow: Workflow id (required) :type workflow: str @@ -104,124 +154,229 @@ def wcs_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr :type request: GetCapabilitiesRequest :param version: :type version: WcsVersion - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'workflow', - 'service', - 'request', - 'version' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._wcs_capabilities_handler_serialize( + workflow=workflow, + service=service, + request=request, + version=version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method wcs_capabilities_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['workflow']: - _path_params['workflow'] = _params['workflow'] + @validate_call + def wcs_capabilities_handler_without_preload_content( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + service: WcsService, + request: GetCapabilitiesRequest, + version: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get WCS Capabilities - # process the query parameters - _query_params = [] - if _params.get('version') is not None: # noqa: E501 - _query_params.append(('version', _params['version'].value)) + :param workflow: Workflow id (required) + :type workflow: str + :param service: (required) + :type service: WcsService + :param request: (required) + :type request: GetCapabilitiesRequest + :param version: + :type version: WcsVersion + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._wcs_capabilities_handler_serialize( + workflow=workflow, + service=service, + request=request, + version=version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('service') is not None: # noqa: E501 - _query_params.append(('service', _params['service'].value)) + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params.get('request') is not None: # noqa: E501 - _query_params.append(('request', _params['request'].value)) + def _wcs_capabilities_handler_serialize( + self, + workflow, + service, + request, + version, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workflow is not None: + _path_params['workflow'] = workflow + # process the query parameters + if version is not None: + + _query_params.append(('version', version.value)) + + if service is not None: + + _query_params.append(('service', service.value)) + + if request is not None: + + _query_params.append(('request', request.value)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['text/xml']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/xml' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "str", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/wcs/{workflow}?request=GetCapabilities', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/wcs/{workflow}?request=GetCapabilities', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def wcs_describe_coverage_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : WcsVersion, service : WcsService, request : DescribeCoverageRequest, identifiers : StrictStr, **kwargs) -> str: # noqa: E501 - """Get WCS Coverage Description # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.wcs_describe_coverage_handler(workflow, version, service, request, identifiers, async_req=True) - >>> result = thread.get() + + @validate_call + def wcs_describe_coverage_handler( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WcsVersion, + service: WcsService, + request: DescribeCoverageRequest, + identifiers: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Get WCS Coverage Description + :param workflow: Workflow id (required) :type workflow: str @@ -233,32 +388,77 @@ def wcs_describe_coverage_handler(self, workflow : Annotated[StrictStr, Field(.. :type request: DescribeCoverageRequest :param identifiers: (required) :type identifiers: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the wcs_describe_coverage_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.wcs_describe_coverage_handler_with_http_info(workflow, version, service, request, identifiers, **kwargs) # noqa: E501 - - @validate_arguments - def wcs_describe_coverage_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : WcsVersion, service : WcsService, request : DescribeCoverageRequest, identifiers : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Get WCS Coverage Description # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.wcs_describe_coverage_handler_with_http_info(workflow, version, service, request, identifiers, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._wcs_describe_coverage_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + identifiers=identifiers, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def wcs_describe_coverage_handler_with_http_info( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WcsVersion, + service: WcsService, + request: DescribeCoverageRequest, + identifiers: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Get WCS Coverage Description + :param workflow: Workflow id (required) :type workflow: str @@ -270,128 +470,248 @@ def wcs_describe_coverage_handler_with_http_info(self, workflow : Annotated[Stri :type request: DescribeCoverageRequest :param identifiers: (required) :type identifiers: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'workflow', - 'version', - 'service', - 'request', - 'identifiers' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._wcs_describe_coverage_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + identifiers=identifiers, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method wcs_describe_coverage_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['workflow']: - _path_params['workflow'] = _params['workflow'] + @validate_call + def wcs_describe_coverage_handler_without_preload_content( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WcsVersion, + service: WcsService, + request: DescribeCoverageRequest, + identifiers: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get WCS Coverage Description - # process the query parameters - _query_params = [] - if _params.get('version') is not None: # noqa: E501 - _query_params.append(('version', _params['version'].value)) + :param workflow: Workflow id (required) + :type workflow: str + :param version: (required) + :type version: WcsVersion + :param service: (required) + :type service: WcsService + :param request: (required) + :type request: DescribeCoverageRequest + :param identifiers: (required) + :type identifiers: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._wcs_describe_coverage_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + identifiers=identifiers, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _wcs_describe_coverage_handler_serialize( + self, + workflow, + version, + service, + request, + identifiers, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params.get('service') is not None: # noqa: E501 - _query_params.append(('service', _params['service'].value)) + _host = None - if _params.get('request') is not None: # noqa: E501 - _query_params.append(('request', _params['request'].value)) + _collection_formats: Dict[str, str] = { + } - if _params.get('identifiers') is not None: # noqa: E501 - _query_params.append(('identifiers', _params['identifiers'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if workflow is not None: + _path_params['workflow'] = workflow + # process the query parameters + if version is not None: + + _query_params.append(('version', version.value)) + + if service is not None: + + _query_params.append(('service', service.value)) + + if request is not None: + + _query_params.append(('request', request.value)) + + if identifiers is not None: + + _query_params.append(('identifiers', identifiers)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['text/xml']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/xml' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "str", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/wcs/{workflow}?request=DescribeCoverage', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/wcs/{workflow}?request=DescribeCoverage', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def wcs_get_coverage_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : WcsVersion, service : WcsService, request : GetCoverageRequest, format : GetCoverageFormat, identifier : StrictStr, boundingbox : StrictStr, gridbasecrs : StrictStr, gridorigin : Optional[StrictStr] = None, gridoffsets : Optional[StrictStr] = None, time : Optional[StrictStr] = None, resx : Optional[Union[StrictFloat, StrictInt]] = None, resy : Optional[Union[StrictFloat, StrictInt]] = None, nodatavalue : Optional[Union[StrictFloat, StrictInt]] = None, **kwargs) -> bytearray: # noqa: E501 - """Get WCS Coverage # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def wcs_get_coverage_handler( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WcsVersion, + service: WcsService, + request: GetCoverageRequest, + format: GetCoverageFormat, + identifier: StrictStr, + boundingbox: StrictStr, + gridbasecrs: StrictStr, + gridorigin: Optional[StrictStr] = None, + gridoffsets: Optional[StrictStr] = None, + time: Optional[StrictStr] = None, + resx: Optional[Union[StrictFloat, StrictInt]] = None, + resy: Optional[Union[StrictFloat, StrictInt]] = None, + nodatavalue: Optional[Union[StrictFloat, StrictInt]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """Get WCS Coverage - >>> thread = api.wcs_get_coverage_handler(workflow, version, service, request, format, identifier, boundingbox, gridbasecrs, gridorigin, gridoffsets, time, resx, resy, nodatavalue, async_req=True) - >>> result = thread.get() :param workflow: Workflow id (required) :type workflow: str @@ -421,32 +741,95 @@ def wcs_get_coverage_handler(self, workflow : Annotated[StrictStr, Field(..., de :type resy: float :param nodatavalue: :type nodatavalue: float - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: bytearray - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the wcs_get_coverage_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.wcs_get_coverage_handler_with_http_info(workflow, version, service, request, format, identifier, boundingbox, gridbasecrs, gridorigin, gridoffsets, time, resx, resy, nodatavalue, **kwargs) # noqa: E501 - - @validate_arguments - def wcs_get_coverage_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : WcsVersion, service : WcsService, request : GetCoverageRequest, format : GetCoverageFormat, identifier : StrictStr, boundingbox : StrictStr, gridbasecrs : StrictStr, gridorigin : Optional[StrictStr] = None, gridoffsets : Optional[StrictStr] = None, time : Optional[StrictStr] = None, resx : Optional[Union[StrictFloat, StrictInt]] = None, resy : Optional[Union[StrictFloat, StrictInt]] = None, nodatavalue : Optional[Union[StrictFloat, StrictInt]] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Get WCS Coverage # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.wcs_get_coverage_handler_with_http_info(workflow, version, service, request, format, identifier, boundingbox, gridbasecrs, gridorigin, gridoffsets, time, resx, resy, nodatavalue, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._wcs_get_coverage_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + format=format, + identifier=identifier, + boundingbox=boundingbox, + gridbasecrs=gridbasecrs, + gridorigin=gridorigin, + gridoffsets=gridoffsets, + time=time, + resx=resx, + resy=resy, + nodatavalue=nodatavalue, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def wcs_get_coverage_handler_with_http_info( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WcsVersion, + service: WcsService, + request: GetCoverageRequest, + format: GetCoverageFormat, + identifier: StrictStr, + boundingbox: StrictStr, + gridbasecrs: StrictStr, + gridorigin: Optional[StrictStr] = None, + gridoffsets: Optional[StrictStr] = None, + time: Optional[StrictStr] = None, + resx: Optional[Union[StrictFloat, StrictInt]] = None, + resy: Optional[Union[StrictFloat, StrictInt]] = None, + nodatavalue: Optional[Union[StrictFloat, StrictInt]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """Get WCS Coverage + :param workflow: Workflow id (required) :type workflow: str @@ -476,151 +859,301 @@ def wcs_get_coverage_handler_with_http_info(self, workflow : Annotated[StrictStr :type resy: float :param nodatavalue: :type nodatavalue: float - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'workflow', - 'version', - 'service', - 'request', - 'format', - 'identifier', - 'boundingbox', - 'gridbasecrs', - 'gridorigin', - 'gridoffsets', - 'time', - 'resx', - 'resy', - 'nodatavalue' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._wcs_get_coverage_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + format=format, + identifier=identifier, + boundingbox=boundingbox, + gridbasecrs=gridbasecrs, + gridorigin=gridorigin, + gridoffsets=gridoffsets, + time=time, + resx=resx, + resy=resy, + nodatavalue=nodatavalue, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method wcs_get_coverage_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['workflow']: - _path_params['workflow'] = _params['workflow'] - - - # process the query parameters - _query_params = [] - if _params.get('version') is not None: # noqa: E501 - _query_params.append(('version', _params['version'].value)) - - if _params.get('service') is not None: # noqa: E501 - _query_params.append(('service', _params['service'].value)) - - if _params.get('request') is not None: # noqa: E501 - _query_params.append(('request', _params['request'].value)) - - if _params.get('format') is not None: # noqa: E501 - _query_params.append(('format', _params['format'].value)) - - if _params.get('identifier') is not None: # noqa: E501 - _query_params.append(('identifier', _params['identifier'])) - - if _params.get('boundingbox') is not None: # noqa: E501 - _query_params.append(('boundingbox', _params['boundingbox'])) - - if _params.get('gridbasecrs') is not None: # noqa: E501 - _query_params.append(('gridbasecrs', _params['gridbasecrs'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('gridorigin') is not None: # noqa: E501 - _query_params.append(('gridorigin', _params['gridorigin'])) - if _params.get('gridoffsets') is not None: # noqa: E501 - _query_params.append(('gridoffsets', _params['gridoffsets'])) + @validate_call + def wcs_get_coverage_handler_without_preload_content( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WcsVersion, + service: WcsService, + request: GetCoverageRequest, + format: GetCoverageFormat, + identifier: StrictStr, + boundingbox: StrictStr, + gridbasecrs: StrictStr, + gridorigin: Optional[StrictStr] = None, + gridoffsets: Optional[StrictStr] = None, + time: Optional[StrictStr] = None, + resx: Optional[Union[StrictFloat, StrictInt]] = None, + resy: Optional[Union[StrictFloat, StrictInt]] = None, + nodatavalue: Optional[Union[StrictFloat, StrictInt]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get WCS Coverage - if _params.get('time') is not None: # noqa: E501 - _query_params.append(('time', _params['time'])) - if _params.get('resx') is not None: # noqa: E501 - _query_params.append(('resx', _params['resx'])) + :param workflow: Workflow id (required) + :type workflow: str + :param version: (required) + :type version: WcsVersion + :param service: (required) + :type service: WcsService + :param request: (required) + :type request: GetCoverageRequest + :param format: (required) + :type format: GetCoverageFormat + :param identifier: (required) + :type identifier: str + :param boundingbox: (required) + :type boundingbox: str + :param gridbasecrs: (required) + :type gridbasecrs: str + :param gridorigin: + :type gridorigin: str + :param gridoffsets: + :type gridoffsets: str + :param time: + :type time: str + :param resx: + :type resx: float + :param resy: + :type resy: float + :param nodatavalue: + :type nodatavalue: float + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._wcs_get_coverage_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + format=format, + identifier=identifier, + boundingbox=boundingbox, + gridbasecrs=gridbasecrs, + gridorigin=gridorigin, + gridoffsets=gridoffsets, + time=time, + resx=resx, + resy=resy, + nodatavalue=nodatavalue, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('resy') is not None: # noqa: E501 - _query_params.append(('resy', _params['resy'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _wcs_get_coverage_handler_serialize( + self, + workflow, + version, + service, + request, + format, + identifier, + boundingbox, + gridbasecrs, + gridorigin, + gridoffsets, + time, + resx, + resy, + nodatavalue, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('nodatavalue') is not None: # noqa: E501 - _query_params.append(('nodatavalue', _params['nodatavalue'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if workflow is not None: + _path_params['workflow'] = workflow + # process the query parameters + if version is not None: + + _query_params.append(('version', version.value)) + + if service is not None: + + _query_params.append(('service', service.value)) + + if request is not None: + + _query_params.append(('request', request.value)) + + if format is not None: + + _query_params.append(('format', format.value)) + + if identifier is not None: + + _query_params.append(('identifier', identifier)) + + if boundingbox is not None: + + _query_params.append(('boundingbox', boundingbox)) + + if gridbasecrs is not None: + + _query_params.append(('gridbasecrs', gridbasecrs)) + + if gridorigin is not None: + + _query_params.append(('gridorigin', gridorigin)) + + if gridoffsets is not None: + + _query_params.append(('gridoffsets', gridoffsets)) + + if time is not None: + + _query_params.append(('time', time)) + + if resx is not None: + + _query_params.append(('resx', resx)) + + if resy is not None: + + _query_params.append(('resy', resy)) + + if nodatavalue is not None: + + _query_params.append(('nodatavalue', nodatavalue)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['image/png']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'image/png' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "bytearray", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/wcs/{workflow}?request=GetCoverage', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/wcs/{workflow}?request=GetCoverage', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/ogcwfs_api.py b/python/geoengine_openapi_client/api/ogcwfs_api.py index 08c98e08..7e94d3d9 100644 --- a/python/geoengine_openapi_client/api/ogcwfs_api.py +++ b/python/geoengine_openapi_client/api/ogcwfs_api.py @@ -12,29 +12,22 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint +from pydantic import Field, StrictStr from typing import Any, Optional - +from typing_extensions import Annotated from geoengine_openapi_client.models.geo_json import GeoJson from geoengine_openapi_client.models.get_capabilities_request import GetCapabilitiesRequest from geoengine_openapi_client.models.get_feature_request import GetFeatureRequest from geoengine_openapi_client.models.wfs_service import WfsService -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class OGCWFSApi: @@ -49,15 +42,29 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def wfs_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : Optional[Any], service : WfsService, request : GetCapabilitiesRequest, **kwargs) -> str: # noqa: E501 - """Get WFS Capabilities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def wfs_capabilities_handler( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: Optional[Any], + service: WfsService, + request: GetCapabilitiesRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Get WFS Capabilities - >>> thread = api.wfs_capabilities_handler(workflow, version, service, request, async_req=True) - >>> result = thread.get() :param workflow: Workflow id (required) :type workflow: str @@ -67,32 +74,75 @@ def wfs_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., de :type service: WfsService :param request: (required) :type request: GetCapabilitiesRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the wfs_capabilities_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.wfs_capabilities_handler_with_http_info(workflow, version, service, request, **kwargs) # noqa: E501 - - @validate_arguments - def wfs_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : Optional[Any], service : WfsService, request : GetCapabilitiesRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Get WFS Capabilities # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.wfs_capabilities_handler_with_http_info(workflow, version, service, request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._wfs_capabilities_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def wfs_capabilities_handler_with_http_info( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: Optional[Any], + service: WfsService, + request: GetCapabilitiesRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Get WFS Capabilities + :param workflow: Workflow id (required) :type workflow: str @@ -102,124 +152,234 @@ def wfs_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr :type service: WfsService :param request: (required) :type request: GetCapabilitiesRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'workflow', - 'version', - 'service', - 'request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._wfs_capabilities_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method wfs_capabilities_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + @validate_call + def wfs_capabilities_handler_without_preload_content( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: Optional[Any], + service: WfsService, + request: GetCapabilitiesRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get WFS Capabilities - # process the path parameters - _path_params = {} - if _params['workflow']: - _path_params['workflow'] = _params['workflow'] - if _params['version']: - _path_params['version'] = _params['version'] + :param workflow: Workflow id (required) + :type workflow: str + :param version: (required) + :type version: WfsVersion + :param service: (required) + :type service: WfsService + :param request: (required) + :type request: GetCapabilitiesRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._wfs_capabilities_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + - if _params['service']: - _path_params['service'] = _params['service'] + def _wfs_capabilities_handler_serialize( + self, + workflow, + version, + service, + request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['request']: - _path_params['request'] = _params['request'] + _host = None + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workflow is not None: + _path_params['workflow'] = workflow + if version is not None: + _path_params['version'] = version.value + if service is not None: + _path_params['service'] = service.value + if request is not None: + _path_params['request'] = request.value # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['text/xml']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/xml' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "str", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/wfs/{workflow}?request=GetCapabilities', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + # Note: remove query string in path part for ogc endpoints + resource_path='/wfs/{workflow}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def wfs_feature_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], service : WfsService, request : GetFeatureRequest, type_names : StrictStr, bbox : StrictStr, version : Optional[Any] = None, time : Optional[StrictStr] = None, srs_name : Optional[StrictStr] = None, namespaces : Optional[StrictStr] = None, count : Optional[conint(strict=True, ge=0)] = None, sort_by : Optional[StrictStr] = None, result_type : Optional[StrictStr] = None, filter : Optional[StrictStr] = None, property_name : Optional[StrictStr] = None, query_resolution : Annotated[Optional[Any], Field(description="Vendor parameter for specifying a spatial query resolution")] = None, **kwargs) -> GeoJson: # noqa: E501 - """Get WCS Features # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.wfs_feature_handler(workflow, service, request, type_names, bbox, version, time, srs_name, namespaces, count, sort_by, result_type, filter, property_name, query_resolution, async_req=True) - >>> result = thread.get() + @validate_call + def wfs_feature_handler( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + service: WfsService, + request: GetFeatureRequest, + type_names: StrictStr, + bbox: StrictStr, + version: Optional[Any] = None, + time: Optional[StrictStr] = None, + srs_name: Optional[StrictStr] = None, + namespaces: Optional[StrictStr] = None, + count: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + sort_by: Optional[StrictStr] = None, + result_type: Optional[StrictStr] = None, + filter: Optional[StrictStr] = None, + property_name: Optional[StrictStr] = None, + query_resolution: Annotated[Optional[Any], Field(description="Vendor parameter for specifying a spatial query resolution")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GeoJson: + """Get WCS Features + :param workflow: Workflow id (required) :type workflow: str @@ -251,32 +411,97 @@ def wfs_feature_handler(self, workflow : Annotated[StrictStr, Field(..., descrip :type property_name: str :param query_resolution: Vendor parameter for specifying a spatial query resolution :type query_resolution: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: GeoJson - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the wfs_feature_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.wfs_feature_handler_with_http_info(workflow, service, request, type_names, bbox, version, time, srs_name, namespaces, count, sort_by, result_type, filter, property_name, query_resolution, **kwargs) # noqa: E501 - - @validate_arguments - def wfs_feature_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], service : WfsService, request : GetFeatureRequest, type_names : StrictStr, bbox : StrictStr, version : Optional[Any] = None, time : Optional[StrictStr] = None, srs_name : Optional[StrictStr] = None, namespaces : Optional[StrictStr] = None, count : Optional[conint(strict=True, ge=0)] = None, sort_by : Optional[StrictStr] = None, result_type : Optional[StrictStr] = None, filter : Optional[StrictStr] = None, property_name : Optional[StrictStr] = None, query_resolution : Annotated[Optional[Any], Field(description="Vendor parameter for specifying a spatial query resolution")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Get WCS Features # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.wfs_feature_handler_with_http_info(workflow, service, request, type_names, bbox, version, time, srs_name, namespaces, count, sort_by, result_type, filter, property_name, query_resolution, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._wfs_feature_handler_serialize( + workflow=workflow, + service=service, + request=request, + type_names=type_names, + bbox=bbox, + version=version, + time=time, + srs_name=srs_name, + namespaces=namespaces, + count=count, + sort_by=sort_by, + result_type=result_type, + filter=filter, + property_name=property_name, + query_resolution=query_resolution, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GeoJson", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def wfs_feature_handler_with_http_info( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + service: WfsService, + request: GetFeatureRequest, + type_names: StrictStr, + bbox: StrictStr, + version: Optional[Any] = None, + time: Optional[StrictStr] = None, + srs_name: Optional[StrictStr] = None, + namespaces: Optional[StrictStr] = None, + count: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + sort_by: Optional[StrictStr] = None, + result_type: Optional[StrictStr] = None, + filter: Optional[StrictStr] = None, + property_name: Optional[StrictStr] = None, + query_resolution: Annotated[Optional[Any], Field(description="Vendor parameter for specifying a spatial query resolution")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GeoJson]: + """Get WCS Features + :param workflow: Workflow id (required) :type workflow: str @@ -308,155 +533,312 @@ def wfs_feature_handler_with_http_info(self, workflow : Annotated[StrictStr, Fie :type property_name: str :param query_resolution: Vendor parameter for specifying a spatial query resolution :type query_resolution: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(GeoJson, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'workflow', - 'service', - 'request', - 'type_names', - 'bbox', - 'version', - 'time', - 'srs_name', - 'namespaces', - 'count', - 'sort_by', - 'result_type', - 'filter', - 'property_name', - 'query_resolution' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._wfs_feature_handler_serialize( + workflow=workflow, + service=service, + request=request, + type_names=type_names, + bbox=bbox, + version=version, + time=time, + srs_name=srs_name, + namespaces=namespaces, + count=count, + sort_by=sort_by, + result_type=result_type, + filter=filter, + property_name=property_name, + query_resolution=query_resolution, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method wfs_feature_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['workflow']: - _path_params['workflow'] = _params['workflow'] - - - # process the query parameters - _query_params = [] - if _params.get('version') is not None: # noqa: E501 - _query_params.append(('version', _params['version'].value)) - - if _params.get('service') is not None: # noqa: E501 - _query_params.append(('service', _params['service'].value)) - - if _params.get('request') is not None: # noqa: E501 - _query_params.append(('request', _params['request'].value)) - - if _params.get('type_names') is not None: # noqa: E501 - _query_params.append(('typeNames', _params['type_names'])) - - if _params.get('bbox') is not None: # noqa: E501 - _query_params.append(('bbox', _params['bbox'])) - - if _params.get('time') is not None: # noqa: E501 - _query_params.append(('time', _params['time'])) - - if _params.get('srs_name') is not None: # noqa: E501 - _query_params.append(('srsName', _params['srs_name'])) - - if _params.get('namespaces') is not None: # noqa: E501 - _query_params.append(('namespaces', _params['namespaces'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "GeoJson", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('count') is not None: # noqa: E501 - _query_params.append(('count', _params['count'])) - if _params.get('sort_by') is not None: # noqa: E501 - _query_params.append(('sortBy', _params['sort_by'])) + @validate_call + def wfs_feature_handler_without_preload_content( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + service: WfsService, + request: GetFeatureRequest, + type_names: StrictStr, + bbox: StrictStr, + version: Optional[Any] = None, + time: Optional[StrictStr] = None, + srs_name: Optional[StrictStr] = None, + namespaces: Optional[StrictStr] = None, + count: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + sort_by: Optional[StrictStr] = None, + result_type: Optional[StrictStr] = None, + filter: Optional[StrictStr] = None, + property_name: Optional[StrictStr] = None, + query_resolution: Annotated[Optional[Any], Field(description="Vendor parameter for specifying a spatial query resolution")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get WCS Features - if _params.get('result_type') is not None: # noqa: E501 - _query_params.append(('resultType', _params['result_type'])) - if _params.get('filter') is not None: # noqa: E501 - _query_params.append(('filter', _params['filter'])) + :param workflow: Workflow id (required) + :type workflow: str + :param service: (required) + :type service: WfsService + :param request: (required) + :type request: GetFeatureRequest + :param type_names: (required) + :type type_names: str + :param bbox: (required) + :type bbox: str + :param version: + :type version: WfsVersion + :param time: + :type time: str + :param srs_name: + :type srs_name: str + :param namespaces: + :type namespaces: str + :param count: + :type count: int + :param sort_by: + :type sort_by: str + :param result_type: + :type result_type: str + :param filter: + :type filter: str + :param property_name: + :type property_name: str + :param query_resolution: Vendor parameter for specifying a spatial query resolution + :type query_resolution: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._wfs_feature_handler_serialize( + workflow=workflow, + service=service, + request=request, + type_names=type_names, + bbox=bbox, + version=version, + time=time, + srs_name=srs_name, + namespaces=namespaces, + count=count, + sort_by=sort_by, + result_type=result_type, + filter=filter, + property_name=property_name, + query_resolution=query_resolution, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('property_name') is not None: # noqa: E501 - _query_params.append(('propertyName', _params['property_name'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "GeoJson", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _wfs_feature_handler_serialize( + self, + workflow, + service, + request, + type_names, + bbox, + version, + time, + srs_name, + namespaces, + count, + sort_by, + result_type, + filter, + property_name, + query_resolution, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('query_resolution') is not None: # noqa: E501 - _query_params.append(('queryResolution', _params['query_resolution'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if workflow is not None: + _path_params['workflow'] = workflow + # process the query parameters + if version is not None: + + _query_params.append(('version', version.value)) + + if service is not None: + + _query_params.append(('service', service.value)) + + if request is not None: + + _query_params.append(('request', request.value)) + + if type_names is not None: + + _query_params.append(('typeNames', type_names)) + + if bbox is not None: + + _query_params.append(('bbox', bbox)) + + if time is not None: + + _query_params.append(('time', time)) + + if srs_name is not None: + + _query_params.append(('srsName', srs_name)) + + if namespaces is not None: + + _query_params.append(('namespaces', namespaces)) + + if count is not None: + + _query_params.append(('count', count)) + + if sort_by is not None: + + _query_params.append(('sortBy', sort_by)) + + if result_type is not None: + + _query_params.append(('resultType', result_type)) + + if filter is not None: + + _query_params.append(('filter', filter)) + + if property_name is not None: + + _query_params.append(('propertyName', property_name)) + + if query_resolution is not None: + + _query_params.append(('queryResolution', query_resolution)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "GeoJson", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/wfs/{workflow}?request=GetFeature', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + # Note: remove query string in path part for ogc endpoints + resource_path='/wfs/{workflow}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/ogcwms_api.py b/python/geoengine_openapi_client/api/ogcwms_api.py index 5c2e343a..333b7c10 100644 --- a/python/geoengine_openapi_client/api/ogcwms_api.py +++ b/python/geoengine_openapi_client/api/ogcwms_api.py @@ -12,18 +12,14 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint - -from typing import Any, Optional, Union +from pydantic import Field, StrictBool, StrictBytes, StrictStr +from typing import Any, Optional, Tuple, Union +from typing_extensions import Annotated from geoengine_openapi_client.models.get_capabilities_request import GetCapabilitiesRequest from geoengine_openapi_client.models.get_legend_graphic_request import GetLegendGraphicRequest from geoengine_openapi_client.models.get_map_format import GetMapFormat @@ -31,12 +27,9 @@ from geoengine_openapi_client.models.wms_service import WmsService from geoengine_openapi_client.models.wms_version import WmsVersion -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class OGCWMSApi: @@ -51,15 +44,30 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def wms_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : Optional[Any], service : WmsService, request : GetCapabilitiesRequest, format : Optional[Any], **kwargs) -> str: # noqa: E501 - """Get WMS Capabilities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def wms_capabilities_handler( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: Optional[Any], + service: WmsService, + request: GetCapabilitiesRequest, + format: Optional[Any], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Get WMS Capabilities - >>> thread = api.wms_capabilities_handler(workflow, version, service, request, format, async_req=True) - >>> result = thread.get() :param workflow: Workflow id (required) :type workflow: str @@ -71,32 +79,77 @@ def wms_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., de :type request: GetCapabilitiesRequest :param format: (required) :type format: GetCapabilitiesFormat - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the wms_capabilities_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.wms_capabilities_handler_with_http_info(workflow, version, service, request, format, **kwargs) # noqa: E501 - - @validate_arguments - def wms_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : Optional[Any], service : WmsService, request : GetCapabilitiesRequest, format : Optional[Any], **kwargs) -> ApiResponse: # noqa: E501 - """Get WMS Capabilities # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.wms_capabilities_handler_with_http_info(workflow, version, service, request, format, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._wms_capabilities_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + format=format, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def wms_capabilities_handler_with_http_info( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: Optional[Any], + service: WmsService, + request: GetCapabilitiesRequest, + format: Optional[Any], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Get WMS Capabilities + :param workflow: Workflow id (required) :type workflow: str @@ -108,128 +161,232 @@ def wms_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr :type request: GetCapabilitiesRequest :param format: (required) :type format: GetCapabilitiesFormat - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'workflow', - 'version', - 'service', - 'request', - 'format' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._wms_capabilities_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + format=format, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method wms_capabilities_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['workflow']: - _path_params['workflow'] = _params['workflow'] + @validate_call + def wms_capabilities_handler_without_preload_content( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: Optional[Any], + service: WmsService, + request: GetCapabilitiesRequest, + format: Optional[Any], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get WMS Capabilities + + + :param workflow: Workflow id (required) + :type workflow: str + :param version: (required) + :type version: WmsVersion + :param service: (required) + :type service: WmsService + :param request: (required) + :type request: GetCapabilitiesRequest + :param format: (required) + :type format: GetCapabilitiesFormat + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._wms_capabilities_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + format=format, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params['version']: - _path_params['version'] = _params['version'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params['service']: - _path_params['service'] = _params['service'] - if _params['request']: - _path_params['request'] = _params['request'] + def _wms_capabilities_handler_serialize( + self, + workflow, + version, + service, + request, + format, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['format']: - _path_params['format'] = _params['format'] + _host = None + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workflow is not None: + _path_params['workflow'] = workflow + if version is not None: + _path_params['version'] = version.value + if service is not None: + _path_params['service'] = service.value + if request is not None: + _path_params['request'] = request.value + if format is not None: + _path_params['format'] = format.value # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['text/xml']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/xml' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "str", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/wms/{workflow}?request=GetCapabilities', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + # Note: remove query string in path part for ogc endpoints + resource_path='/wms/{workflow}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def wms_legend_graphic_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : WmsVersion, service : WmsService, request : GetLegendGraphicRequest, layer : StrictStr, **kwargs) -> None: # noqa: E501 - """Get WMS Legend Graphic # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.wms_legend_graphic_handler(workflow, version, service, request, layer, async_req=True) - >>> result = thread.get() + @validate_call + def wms_legend_graphic_handler( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WmsVersion, + service: WmsService, + request: GetLegendGraphicRequest, + layer: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Get WMS Legend Graphic + :param workflow: Workflow id (required) :type workflow: str @@ -241,32 +398,77 @@ def wms_legend_graphic_handler(self, workflow : Annotated[StrictStr, Field(..., :type request: GetLegendGraphicRequest :param layer: (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the wms_legend_graphic_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.wms_legend_graphic_handler_with_http_info(workflow, version, service, request, layer, **kwargs) # noqa: E501 - - @validate_arguments - def wms_legend_graphic_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : WmsVersion, service : WmsService, request : GetLegendGraphicRequest, layer : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Get WMS Legend Graphic # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.wms_legend_graphic_handler_with_http_info(workflow, version, service, request, layer, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._wms_legend_graphic_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '501': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def wms_legend_graphic_handler_with_http_info( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WmsVersion, + service: WmsService, + request: GetLegendGraphicRequest, + layer: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Get WMS Legend Graphic + :param workflow: Workflow id (required) :type workflow: str @@ -278,122 +480,238 @@ def wms_legend_graphic_handler_with_http_info(self, workflow : Annotated[StrictS :type request: GetLegendGraphicRequest :param layer: (required) :type layer: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'workflow', - 'version', - 'service', - 'request', - 'layer' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._wms_legend_graphic_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '501': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method wms_legend_graphic_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + @validate_call + def wms_legend_graphic_handler_without_preload_content( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WmsVersion, + service: WmsService, + request: GetLegendGraphicRequest, + layer: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get WMS Legend Graphic - # process the path parameters - _path_params = {} - if _params['workflow']: - _path_params['workflow'] = _params['workflow'] - if _params['version']: - _path_params['version'] = _params['version'] + :param workflow: Workflow id (required) + :type workflow: str + :param version: (required) + :type version: WmsVersion + :param service: (required) + :type service: WmsService + :param request: (required) + :type request: GetLegendGraphicRequest + :param layer: (required) + :type layer: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._wms_legend_graphic_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + layer=layer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '501': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + - if _params['service']: - _path_params['service'] = _params['service'] + def _wms_legend_graphic_handler_serialize( + self, + workflow, + version, + service, + request, + layer, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['request']: - _path_params['request'] = _params['request'] + _host = None - if _params['layer']: - _path_params['layer'] = _params['layer'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if workflow is not None: + _path_params['workflow'] = workflow + if version is not None: + _path_params['version'] = version.value + if service is not None: + _path_params['service'] = service.value + if request is not None: + _path_params['request'] = request.value + if layer is not None: + _path_params['layer'] = layer # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/wms/{workflow}?request=GetLegendGraphic', 'GET', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='GET', + # Note: remove query string in path part for ogc endpoints + resource_path='/wms/{workflow}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def wms_map_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : WmsVersion, service : WmsService, request : GetMapRequest, width : conint(strict=True, ge=0), height : conint(strict=True, ge=0), bbox : StrictStr, format : GetMapFormat, layers : StrictStr, styles : StrictStr, crs : Optional[StrictStr] = None, time : Optional[StrictStr] = None, transparent : Optional[StrictBool] = None, bgcolor : Optional[StrictStr] = None, sld : Optional[StrictStr] = None, sld_body : Optional[StrictStr] = None, elevation : Optional[StrictStr] = None, exceptions : Optional[Any] = None, **kwargs) -> bytearray: # noqa: E501 - """Get WMS Map # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.wms_map_handler(workflow, version, service, request, width, height, bbox, format, layers, styles, crs, time, transparent, bgcolor, sld, sld_body, elevation, exceptions, async_req=True) - >>> result = thread.get() + + @validate_call + def wms_map_handler( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WmsVersion, + service: WmsService, + request: GetMapRequest, + width: Annotated[int, Field(strict=True, ge=0)], + height: Annotated[int, Field(strict=True, ge=0)], + bbox: StrictStr, + format: GetMapFormat, + layers: StrictStr, + styles: StrictStr, + crs: Optional[StrictStr] = None, + time: Optional[StrictStr] = None, + transparent: Optional[StrictBool] = None, + bgcolor: Optional[StrictStr] = None, + sld: Optional[StrictStr] = None, + sld_body: Optional[StrictStr] = None, + elevation: Optional[StrictStr] = None, + exceptions: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """Get WMS Map + :param workflow: Workflow id (required) :type workflow: str @@ -431,32 +749,103 @@ def wms_map_handler(self, workflow : Annotated[StrictStr, Field(..., description :type elevation: str :param exceptions: :type exceptions: GetMapExceptionFormat - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: bytearray - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the wms_map_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.wms_map_handler_with_http_info(workflow, version, service, request, width, height, bbox, format, layers, styles, crs, time, transparent, bgcolor, sld, sld_body, elevation, exceptions, **kwargs) # noqa: E501 - - @validate_arguments - def wms_map_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : WmsVersion, service : WmsService, request : GetMapRequest, width : conint(strict=True, ge=0), height : conint(strict=True, ge=0), bbox : StrictStr, format : GetMapFormat, layers : StrictStr, styles : StrictStr, crs : Optional[StrictStr] = None, time : Optional[StrictStr] = None, transparent : Optional[StrictBool] = None, bgcolor : Optional[StrictStr] = None, sld : Optional[StrictStr] = None, sld_body : Optional[StrictStr] = None, elevation : Optional[StrictStr] = None, exceptions : Optional[Any] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Get WMS Map # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.wms_map_handler_with_http_info(workflow, version, service, request, width, height, bbox, format, layers, styles, crs, time, transparent, bgcolor, sld, sld_body, elevation, exceptions, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._wms_map_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + width=width, + height=height, + bbox=bbox, + format=format, + layers=layers, + styles=styles, + crs=crs, + time=time, + transparent=transparent, + bgcolor=bgcolor, + sld=sld, + sld_body=sld_body, + elevation=elevation, + exceptions=exceptions, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def wms_map_handler_with_http_info( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WmsVersion, + service: WmsService, + request: GetMapRequest, + width: Annotated[int, Field(strict=True, ge=0)], + height: Annotated[int, Field(strict=True, ge=0)], + bbox: StrictStr, + format: GetMapFormat, + layers: StrictStr, + styles: StrictStr, + crs: Optional[StrictStr] = None, + time: Optional[StrictStr] = None, + transparent: Optional[StrictBool] = None, + bgcolor: Optional[StrictStr] = None, + sld: Optional[StrictStr] = None, + sld_body: Optional[StrictStr] = None, + elevation: Optional[StrictStr] = None, + exceptions: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """Get WMS Map + :param workflow: Workflow id (required) :type workflow: str @@ -494,167 +883,342 @@ def wms_map_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(. :type elevation: str :param exceptions: :type exceptions: GetMapExceptionFormat - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'workflow', - 'version', - 'service', - 'request', - 'width', - 'height', - 'bbox', - 'format', - 'layers', - 'styles', - 'crs', - 'time', - 'transparent', - 'bgcolor', - 'sld', - 'sld_body', - 'elevation', - 'exceptions' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._wms_map_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + width=width, + height=height, + bbox=bbox, + format=format, + layers=layers, + styles=styles, + crs=crs, + time=time, + transparent=transparent, + bgcolor=bgcolor, + sld=sld, + sld_body=sld_body, + elevation=elevation, + exceptions=exceptions, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method wms_map_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['workflow']: - _path_params['workflow'] = _params['workflow'] - - - # process the query parameters - _query_params = [] - if _params.get('version') is not None: # noqa: E501 - _query_params.append(('version', _params['version'].value)) - - if _params.get('service') is not None: # noqa: E501 - _query_params.append(('service', _params['service'].value)) - - if _params.get('request') is not None: # noqa: E501 - _query_params.append(('request', _params['request'].value)) - - if _params.get('width') is not None: # noqa: E501 - _query_params.append(('width', _params['width'])) - - if _params.get('height') is not None: # noqa: E501 - _query_params.append(('height', _params['height'])) - - if _params.get('bbox') is not None: # noqa: E501 - _query_params.append(('bbox', _params['bbox'])) - - if _params.get('format') is not None: # noqa: E501 - _query_params.append(('format', _params['format'].value)) - - if _params.get('layers') is not None: # noqa: E501 - _query_params.append(('layers', _params['layers'])) - - if _params.get('crs') is not None: # noqa: E501 - _query_params.append(('crs', _params['crs'])) - - if _params.get('styles') is not None: # noqa: E501 - _query_params.append(('styles', _params['styles'])) - - if _params.get('time') is not None: # noqa: E501 - _query_params.append(('time', _params['time'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('transparent') is not None: # noqa: E501 - _query_params.append(('transparent', _params['transparent'])) - if _params.get('bgcolor') is not None: # noqa: E501 - _query_params.append(('bgcolor', _params['bgcolor'])) + @validate_call + def wms_map_handler_without_preload_content( + self, + workflow: Annotated[StrictStr, Field(description="Workflow id")], + version: WmsVersion, + service: WmsService, + request: GetMapRequest, + width: Annotated[int, Field(strict=True, ge=0)], + height: Annotated[int, Field(strict=True, ge=0)], + bbox: StrictStr, + format: GetMapFormat, + layers: StrictStr, + styles: StrictStr, + crs: Optional[StrictStr] = None, + time: Optional[StrictStr] = None, + transparent: Optional[StrictBool] = None, + bgcolor: Optional[StrictStr] = None, + sld: Optional[StrictStr] = None, + sld_body: Optional[StrictStr] = None, + elevation: Optional[StrictStr] = None, + exceptions: Optional[Any] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get WMS Map - if _params.get('sld') is not None: # noqa: E501 - _query_params.append(('sld', _params['sld'])) - if _params.get('sld_body') is not None: # noqa: E501 - _query_params.append(('sld_body', _params['sld_body'])) + :param workflow: Workflow id (required) + :type workflow: str + :param version: (required) + :type version: WmsVersion + :param service: (required) + :type service: WmsService + :param request: (required) + :type request: GetMapRequest + :param width: (required) + :type width: int + :param height: (required) + :type height: int + :param bbox: (required) + :type bbox: str + :param format: (required) + :type format: GetMapFormat + :param layers: (required) + :type layers: str + :param styles: (required) + :type styles: str + :param crs: + :type crs: str + :param time: + :type time: str + :param transparent: + :type transparent: bool + :param bgcolor: + :type bgcolor: str + :param sld: + :type sld: str + :param sld_body: + :type sld_body: str + :param elevation: + :type elevation: str + :param exceptions: + :type exceptions: GetMapExceptionFormat + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._wms_map_handler_serialize( + workflow=workflow, + version=version, + service=service, + request=request, + width=width, + height=height, + bbox=bbox, + format=format, + layers=layers, + styles=styles, + crs=crs, + time=time, + transparent=transparent, + bgcolor=bgcolor, + sld=sld, + sld_body=sld_body, + elevation=elevation, + exceptions=exceptions, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('elevation') is not None: # noqa: E501 - _query_params.append(('elevation', _params['elevation'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _wms_map_handler_serialize( + self, + workflow, + version, + service, + request, + width, + height, + bbox, + format, + layers, + styles, + crs, + time, + transparent, + bgcolor, + sld, + sld_body, + elevation, + exceptions, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('exceptions') is not None: # noqa: E501 - _query_params.append(('exceptions', _params['exceptions'].value)) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if workflow is not None: + _path_params['workflow'] = workflow + # process the query parameters + if version is not None: + + _query_params.append(('version', version.value)) + + if service is not None: + + _query_params.append(('service', service.value)) + + if request is not None: + + _query_params.append(('request', request.value)) + + if width is not None: + + _query_params.append(('width', width)) + + if height is not None: + + _query_params.append(('height', height)) + + if bbox is not None: + + _query_params.append(('bbox', bbox)) + + if format is not None: + + _query_params.append(('format', format.value)) + + if layers is not None: + + _query_params.append(('layers', layers)) + + if crs is not None: + + _query_params.append(('crs', crs)) + + if styles is not None: + + _query_params.append(('styles', styles)) + + if time is not None: + + _query_params.append(('time', time)) + + if transparent is not None: + + _query_params.append(('transparent', transparent)) + + if bgcolor is not None: + + _query_params.append(('bgcolor', bgcolor)) + + if sld is not None: + + _query_params.append(('sld', sld)) + + if sld_body is not None: + + _query_params.append(('sld_body', sld_body)) + + if elevation is not None: + + _query_params.append(('elevation', elevation)) + + if exceptions is not None: + + _query_params.append(('exceptions', exceptions.value)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['image/png']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'image/png' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "bytearray", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/wms/{workflow}?request=GetMap', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + # Note: remove query string in path part for ogc endpoints + resource_path='/wms/{workflow}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/permissions_api.py b/python/geoengine_openapi_client/api/permissions_api.py index 1ed22602..384bac8a 100644 --- a/python/geoengine_openapi_client/api/permissions_api.py +++ b/python/geoengine_openapi_client/api/permissions_api.py @@ -12,27 +12,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint +from pydantic import Field, StrictStr from typing import List - +from typing_extensions import Annotated from geoengine_openapi_client.models.permission_listing import PermissionListing from geoengine_openapi_client.models.permission_request import PermissionRequest -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class PermissionsApi: @@ -47,154 +40,293 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def add_permission_handler(self, permission_request : PermissionRequest, **kwargs) -> None: # noqa: E501 - """Adds a new permission. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_permission_handler( + self, + permission_request: PermissionRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Adds a new permission. - >>> thread = api.add_permission_handler(permission_request, async_req=True) - >>> result = thread.get() :param permission_request: (required) :type permission_request: PermissionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the add_permission_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.add_permission_handler_with_http_info(permission_request, **kwargs) # noqa: E501 - - @validate_arguments - def add_permission_handler_with_http_info(self, permission_request : PermissionRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Adds a new permission. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_permission_handler_with_http_info(permission_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._add_permission_handler_serialize( + permission_request=permission_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_permission_handler_with_http_info( + self, + permission_request: PermissionRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Adds a new permission. + :param permission_request: (required) :type permission_request: PermissionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._add_permission_handler_serialize( + permission_request=permission_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'permission_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def add_permission_handler_without_preload_content( + self, + permission_request: PermissionRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Adds a new permission. + + + :param permission_request: (required) + :type permission_request: PermissionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_permission_handler_serialize( + permission_request=permission_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_permission_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _add_permission_handler_serialize( + self, + permission_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['permission_request'] is not None: - _body_params = _params['permission_request'] + if permission_request is not None: + _body_params = permission_request + + # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/permissions', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/permissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_resource_permissions_handler(self, resource_type : Annotated[StrictStr, Field(..., description="Resource Type")], resource_id : Annotated[StrictStr, Field(..., description="Resource Id")], limit : conint(strict=True, ge=0), offset : conint(strict=True, ge=0), **kwargs) -> List[PermissionListing]: # noqa: E501 - """Lists permission for a given resource. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_resource_permissions_handler(resource_type, resource_id, limit, offset, async_req=True) - >>> result = thread.get() + + @validate_call + def get_resource_permissions_handler( + self, + resource_type: Annotated[StrictStr, Field(description="Resource Type")], + resource_id: Annotated[StrictStr, Field(description="Resource Id")], + limit: Annotated[int, Field(strict=True, ge=0)], + offset: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[PermissionListing]: + """Lists permission for a given resource. + :param resource_type: Resource Type (required) :type resource_type: str @@ -204,32 +336,75 @@ def get_resource_permissions_handler(self, resource_type : Annotated[StrictStr, :type limit: int :param offset: (required) :type offset: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[PermissionListing] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_resource_permissions_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_resource_permissions_handler_with_http_info(resource_type, resource_id, limit, offset, **kwargs) # noqa: E501 - - @validate_arguments - def get_resource_permissions_handler_with_http_info(self, resource_type : Annotated[StrictStr, Field(..., description="Resource Type")], resource_id : Annotated[StrictStr, Field(..., description="Resource Id")], limit : conint(strict=True, ge=0), offset : conint(strict=True, ge=0), **kwargs) -> ApiResponse: # noqa: E501 - """Lists permission for a given resource. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_resource_permissions_handler_with_http_info(resource_type, resource_id, limit, offset, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_resource_permissions_handler_serialize( + resource_type=resource_type, + resource_id=resource_id, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PermissionListing]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_resource_permissions_handler_with_http_info( + self, + resource_type: Annotated[StrictStr, Field(description="Resource Type")], + resource_id: Annotated[StrictStr, Field(description="Resource Id")], + limit: Annotated[int, Field(strict=True, ge=0)], + offset: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[PermissionListing]]: + """Lists permission for a given resource. + :param resource_type: Resource Type (required) :type resource_type: str @@ -239,250 +414,463 @@ def get_resource_permissions_handler_with_http_info(self, resource_type : Annota :type limit: int :param offset: (required) :type offset: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[PermissionListing], status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'resource_type', - 'resource_id', - 'limit', - 'offset' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._get_resource_permissions_handler_serialize( + resource_type=resource_type, + resource_id=resource_id, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_resource_permissions_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PermissionListing]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['resource_type']: - _path_params['resource_type'] = _params['resource_type'] + @validate_call + def get_resource_permissions_handler_without_preload_content( + self, + resource_type: Annotated[StrictStr, Field(description="Resource Type")], + resource_id: Annotated[StrictStr, Field(description="Resource Id")], + limit: Annotated[int, Field(strict=True, ge=0)], + offset: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Lists permission for a given resource. + + + :param resource_type: Resource Type (required) + :type resource_type: str + :param resource_id: Resource Id (required) + :type resource_id: str + :param limit: (required) + :type limit: int + :param offset: (required) + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_resource_permissions_handler_serialize( + resource_type=resource_type, + resource_id=resource_id, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[PermissionListing]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params['resource_id']: - _path_params['resource_id'] = _params['resource_id'] + def _get_resource_permissions_handler_serialize( + self, + resource_type, + resource_id, + limit, + offset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('limit') is not None: # noqa: E501 - _query_params.append(('limit', _params['limit'])) + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('offset') is not None: # noqa: E501 - _query_params.append(('offset', _params['offset'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if resource_type is not None: + _path_params['resource_type'] = resource_type + if resource_id is not None: + _path_params['resource_id'] = resource_id + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "List[PermissionListing]", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/permissions/resources/{resource_type}/{resource_id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/permissions/resources/{resource_type}/{resource_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def remove_permission_handler(self, permission_request : PermissionRequest, **kwargs) -> None: # noqa: E501 - """Removes an existing permission. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_permission_handler(permission_request, async_req=True) - >>> result = thread.get() + + @validate_call + def remove_permission_handler( + self, + permission_request: PermissionRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Removes an existing permission. + :param permission_request: (required) :type permission_request: PermissionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the remove_permission_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.remove_permission_handler_with_http_info(permission_request, **kwargs) # noqa: E501 - - @validate_arguments - def remove_permission_handler_with_http_info(self, permission_request : PermissionRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Removes an existing permission. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.remove_permission_handler_with_http_info(permission_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._remove_permission_handler_serialize( + permission_request=permission_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remove_permission_handler_with_http_info( + self, + permission_request: PermissionRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Removes an existing permission. + :param permission_request: (required) :type permission_request: PermissionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._remove_permission_handler_serialize( + permission_request=permission_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'permission_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def remove_permission_handler_without_preload_content( + self, + permission_request: PermissionRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Removes an existing permission. + + + :param permission_request: (required) + :type permission_request: PermissionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_permission_handler_serialize( + permission_request=permission_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_permission_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _remove_permission_handler_serialize( + self, + permission_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['permission_request'] is not None: - _body_params = _params['permission_request'] + if permission_request is not None: + _body_params = permission_request + + # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/permissions', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/permissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/plots_api.py b/python/geoengine_openapi_client/api/plots_api.py index 36189e66..cca1138d 100644 --- a/python/geoengine_openapi_client/api/plots_api.py +++ b/python/geoengine_openapi_client/api/plots_api.py @@ -12,26 +12,19 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr +from pydantic import Field, StrictStr from typing import Optional - +from typing_extensions import Annotated from geoengine_openapi_client.models.wrapped_plot_output import WrappedPlotOutput -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class PlotsApi: @@ -46,16 +39,31 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def get_plot_handler(self, bbox : StrictStr, time : StrictStr, spatial_resolution : StrictStr, id : Annotated[StrictStr, Field(..., description="Workflow id")], crs : Optional[StrictStr] = None, **kwargs) -> WrappedPlotOutput: # noqa: E501 - """Generates a plot. # noqa: E501 - # Example 1. Upload the file `plain_data.csv` with the following content: ```csv a 1 2 ``` 2. Create a dataset from it using the \"Plain Data\" example at `/dataset`. 3. Create a statistics workflow using the \"Statistics Plot\" example at `/workflow`. 4. Generate the plot with this handler. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_plot_handler( + self, + bbox: StrictStr, + time: StrictStr, + spatial_resolution: StrictStr, + id: Annotated[StrictStr, Field(description="Workflow id")], + crs: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WrappedPlotOutput: + """Generates a plot. - >>> thread = api.get_plot_handler(bbox, time, spatial_resolution, id, crs, async_req=True) - >>> result = thread.get() + # Example 1. Upload the file `plain_data.csv` with the following content: ```csv a 1 2 ``` 2. Create a dataset from it using the \"Plain Data\" example at `/dataset`. 3. Create a statistics workflow using the \"Statistics Plot\" example at `/workflow`. 4. Generate the plot with this handler. :param bbox: (required) :type bbox: str @@ -67,33 +75,78 @@ def get_plot_handler(self, bbox : StrictStr, time : StrictStr, spatial_resolutio :type id: str :param crs: :type crs: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: WrappedPlotOutput - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_plot_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_plot_handler_with_http_info(bbox, time, spatial_resolution, id, crs, **kwargs) # noqa: E501 - - @validate_arguments - def get_plot_handler_with_http_info(self, bbox : StrictStr, time : StrictStr, spatial_resolution : StrictStr, id : Annotated[StrictStr, Field(..., description="Workflow id")], crs : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Generates a plot. # noqa: E501 - - # Example 1. Upload the file `plain_data.csv` with the following content: ```csv a 1 2 ``` 2. Create a dataset from it using the \"Plain Data\" example at `/dataset`. 3. Create a statistics workflow using the \"Statistics Plot\" example at `/workflow`. 4. Generate the plot with this handler. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_plot_handler_with_http_info(bbox, time, spatial_resolution, id, crs, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_plot_handler_serialize( + bbox=bbox, + time=time, + spatial_resolution=spatial_resolution, + id=id, + crs=crs, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WrappedPlotOutput", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_plot_handler_with_http_info( + self, + bbox: StrictStr, + time: StrictStr, + spatial_resolution: StrictStr, + id: Annotated[StrictStr, Field(description="Workflow id")], + crs: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WrappedPlotOutput]: + """Generates a plot. + + # Example 1. Upload the file `plain_data.csv` with the following content: ```csv a 1 2 ``` 2. Create a dataset from it using the \"Plain Data\" example at `/dataset`. 3. Create a statistics workflow using the \"Statistics Plot\" example at `/workflow`. 4. Generate the plot with this handler. :param bbox: (required) :type bbox: str @@ -105,115 +158,212 @@ def get_plot_handler_with_http_info(self, bbox : StrictStr, time : StrictStr, sp :type id: str :param crs: :type crs: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(WrappedPlotOutput, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'bbox', - 'time', - 'spatial_resolution', - 'id', - 'crs' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._get_plot_handler_serialize( + bbox=bbox, + time=time, + spatial_resolution=spatial_resolution, + id=id, + crs=crs, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_plot_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "WrappedPlotOutput", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + @validate_call + def get_plot_handler_without_preload_content( + self, + bbox: StrictStr, + time: StrictStr, + spatial_resolution: StrictStr, + id: Annotated[StrictStr, Field(description="Workflow id")], + crs: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generates a plot. + # Example 1. Upload the file `plain_data.csv` with the following content: ```csv a 1 2 ``` 2. Create a dataset from it using the \"Plain Data\" example at `/dataset`. 3. Create a statistics workflow using the \"Statistics Plot\" example at `/workflow`. 4. Generate the plot with this handler. - # process the query parameters - _query_params = [] - if _params.get('bbox') is not None: # noqa: E501 - _query_params.append(('bbox', _params['bbox'])) + :param bbox: (required) + :type bbox: str + :param time: (required) + :type time: str + :param spatial_resolution: (required) + :type spatial_resolution: str + :param id: Workflow id (required) + :type id: str + :param crs: + :type crs: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_plot_handler_serialize( + bbox=bbox, + time=time, + spatial_resolution=spatial_resolution, + id=id, + crs=crs, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('crs') is not None: # noqa: E501 - _query_params.append(('crs', _params['crs'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "WrappedPlotOutput", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params.get('time') is not None: # noqa: E501 - _query_params.append(('time', _params['time'])) - if _params.get('spatial_resolution') is not None: # noqa: E501 - _query_params.append(('spatialResolution', _params['spatial_resolution'])) + def _get_plot_handler_serialize( + self, + bbox, + time, + spatial_resolution, + id, + crs, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if bbox is not None: + + _query_params.append(('bbox', bbox)) + + if crs is not None: + + _query_params.append(('crs', crs)) + + if time is not None: + + _query_params.append(('time', time)) + + if spatial_resolution is not None: + + _query_params.append(('spatialResolution', spatial_resolution)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "WrappedPlotOutput", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/plot/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/plot/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/projects_api.py b/python/geoengine_openapi_client/api/projects_api.py index 99ed0a52..037cd987 100644 --- a/python/geoengine_openapi_client/api/projects_api.py +++ b/python/geoengine_openapi_client/api/projects_api.py @@ -12,18 +12,14 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint +from pydantic import Field, StrictStr from typing import List - +from typing_extensions import Annotated from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response from geoengine_openapi_client.models.create_project import CreateProject from geoengine_openapi_client.models.order_by import OrderBy @@ -32,12 +28,9 @@ from geoengine_openapi_client.models.project_version import ProjectVersion from geoengine_openapi_client.models.update_project import UpdateProject -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class ProjectsApi: @@ -52,292 +45,550 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_project_handler(self, create_project : CreateProject, **kwargs) -> AddCollection200Response: # noqa: E501 - """Create a new project for the user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_project_handler( + self, + create_project: CreateProject, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AddCollection200Response: + """Create a new project for the user. - >>> thread = api.create_project_handler(create_project, async_req=True) - >>> result = thread.get() :param create_project: (required) :type create_project: CreateProject - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AddCollection200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_project_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_project_handler_with_http_info(create_project, **kwargs) # noqa: E501 - - @validate_arguments - def create_project_handler_with_http_info(self, create_project : CreateProject, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new project for the user. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_project_handler_with_http_info(create_project, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_project_handler_serialize( + create_project=create_project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_project_handler_with_http_info( + self, + create_project: CreateProject, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AddCollection200Response]: + """Create a new project for the user. + :param create_project: (required) :type create_project: CreateProject - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AddCollection200Response, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_project_handler_serialize( + create_project=create_project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'create_project' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_project_handler_without_preload_content( + self, + create_project: CreateProject, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new project for the user. + + + :param create_project: (required) + :type create_project: CreateProject + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_handler_serialize( + create_project=create_project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_project_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _create_project_handler_serialize( + self, + create_project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['create_project'] is not None: - _body_params = _params['create_project'] + if create_project is not None: + _body_params = create_project + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { - '200': "AddCollection200Response", - } + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/project', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/project', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_project_handler(self, project : Annotated[StrictStr, Field(..., description="Project id")], **kwargs) -> None: # noqa: E501 - """Deletes a project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_project_handler(project, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_project_handler( + self, + project: Annotated[StrictStr, Field(description="Project id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Deletes a project. + :param project: Project id (required) :type project: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_project_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_project_handler_with_http_info(project, **kwargs) # noqa: E501 - - @validate_arguments - def delete_project_handler_with_http_info(self, project : Annotated[StrictStr, Field(..., description="Project id")], **kwargs) -> ApiResponse: # noqa: E501 - """Deletes a project. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_project_handler_with_http_info(project, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_project_handler_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_project_handler_with_http_info( + self, + project: Annotated[StrictStr, Field(description="Project id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Deletes a project. + :param project: Project id (required) :type project: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_project_handler_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'project' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_project_handler_without_preload_content( + self, + project: Annotated[StrictStr, Field(description="Project id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Deletes a project. + + + :param project: Project id (required) + :type project: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_handler_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_project_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project']: - _path_params['project'] = _params['project'] + def _delete_project_handler_serialize( + self, + project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project is not None: + _path_params['project'] = project # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/project/{project}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/project/{project}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_projects_handler(self, order : OrderBy, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> List[ProjectListing]: # noqa: E501 - """List all projects accessible to the user that match the selected criteria. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_projects_handler(order, offset, limit, async_req=True) - >>> result = thread.get() + + @validate_call + def list_projects_handler( + self, + order: OrderBy, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ProjectListing]: + """List all projects accessible to the user that match the selected criteria. + :param order: (required) :type order: OrderBy @@ -345,32 +596,73 @@ def list_projects_handler(self, order : OrderBy, offset : conint(strict=True, ge :type offset: int :param limit: (required) :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ProjectListing] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_projects_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_projects_handler_with_http_info(order, offset, limit, **kwargs) # noqa: E501 - - @validate_arguments - def list_projects_handler_with_http_info(self, order : OrderBy, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> ApiResponse: # noqa: E501 - """List all projects accessible to the user that match the selected criteria. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_projects_handler_with_http_info(order, offset, limit, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_projects_handler_serialize( + order=order, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectListing]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_projects_handler_with_http_info( + self, + order: OrderBy, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ProjectListing]]: + """List all projects accessible to the user that match the selected criteria. + :param order: (required) :type order: OrderBy @@ -378,678 +670,1258 @@ def list_projects_handler_with_http_info(self, order : OrderBy, offset : conint( :type offset: int :param limit: (required) :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ProjectListing], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_projects_handler_serialize( + order=order, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectListing]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'order', - 'offset', - 'limit' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def list_projects_handler_without_preload_content( + self, + order: OrderBy, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all projects accessible to the user that match the selected criteria. + + + :param order: (required) + :type order: OrderBy + :param offset: (required) + :type offset: int + :param limit: (required) + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_projects_handler_serialize( + order=order, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_projects_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectListing]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['order']: - _path_params['order'] = _params['order'] + def _list_projects_handler_serialize( + self, + order, + offset, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['offset']: - _path_params['offset'] = _params['offset'] + _host = None - if _params['limit']: - _path_params['limit'] = _params['limit'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if order is not None: + _path_params['order'] = order.value + if offset is not None: + _path_params['offset'] = offset + if limit is not None: + _path_params['limit'] = limit # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "List[ProjectListing]", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/projects', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def load_project_latest_handler(self, project : Annotated[StrictStr, Field(..., description="Project id")], **kwargs) -> Project: # noqa: E501 - """Retrieves details about the latest version of a project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.load_project_latest_handler(project, async_req=True) - >>> result = thread.get() + @validate_call + def load_project_latest_handler( + self, + project: Annotated[StrictStr, Field(description="Project id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Retrieves details about the latest version of a project. + :param project: Project id (required) :type project: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Project - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the load_project_latest_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.load_project_latest_handler_with_http_info(project, **kwargs) # noqa: E501 - - @validate_arguments - def load_project_latest_handler_with_http_info(self, project : Annotated[StrictStr, Field(..., description="Project id")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves details about the latest version of a project. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.load_project_latest_handler_with_http_info(project, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._load_project_latest_handler_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def load_project_latest_handler_with_http_info( + self, + project: Annotated[StrictStr, Field(description="Project id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Retrieves details about the latest version of a project. + :param project: Project id (required) :type project: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Project, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._load_project_latest_handler_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def load_project_latest_handler_without_preload_content( + self, + project: Annotated[StrictStr, Field(description="Project id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves details about the latest version of a project. + + + :param project: Project id (required) + :type project: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._load_project_latest_handler_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method load_project_latest_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project']: - _path_params['project'] = _params['project'] + def _load_project_latest_handler_serialize( + self, + project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project is not None: + _path_params['project'] = project # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "Project", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/project/{project}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/project/{project}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def load_project_version_handler(self, project : Annotated[StrictStr, Field(..., description="Project id")], version : Annotated[StrictStr, Field(..., description="Version id")], **kwargs) -> Project: # noqa: E501 - """Retrieves details about the given version of a project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.load_project_version_handler(project, version, async_req=True) - >>> result = thread.get() + + @validate_call + def load_project_version_handler( + self, + project: Annotated[StrictStr, Field(description="Project id")], + version: Annotated[StrictStr, Field(description="Version id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Retrieves details about the given version of a project. + :param project: Project id (required) :type project: str :param version: Version id (required) :type version: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Project - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the load_project_version_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.load_project_version_handler_with_http_info(project, version, **kwargs) # noqa: E501 - - @validate_arguments - def load_project_version_handler_with_http_info(self, project : Annotated[StrictStr, Field(..., description="Project id")], version : Annotated[StrictStr, Field(..., description="Version id")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves details about the given version of a project. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.load_project_version_handler_with_http_info(project, version, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._load_project_version_handler_serialize( + project=project, + version=version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def load_project_version_handler_with_http_info( + self, + project: Annotated[StrictStr, Field(description="Project id")], + version: Annotated[StrictStr, Field(description="Version id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Retrieves details about the given version of a project. + :param project: Project id (required) :type project: str :param version: Version id (required) :type version: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Project, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._load_project_version_handler_serialize( + project=project, + version=version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project', - 'version' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def load_project_version_handler_without_preload_content( + self, + project: Annotated[StrictStr, Field(description="Project id")], + version: Annotated[StrictStr, Field(description="Version id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves details about the given version of a project. + + + :param project: Project id (required) + :type project: str + :param version: Version id (required) + :type version: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._load_project_version_handler_serialize( + project=project, + version=version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method load_project_version_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project']: - _path_params['project'] = _params['project'] + def _load_project_version_handler_serialize( + self, + project, + version, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['version']: - _path_params['version'] = _params['version'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project is not None: + _path_params['project'] = project + if version is not None: + _path_params['version'] = version # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "Project", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/project/{project}/{version}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/project/{project}/{version}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def project_versions_handler(self, project : Annotated[StrictStr, Field(..., description="Project id")], **kwargs) -> List[ProjectVersion]: # noqa: E501 - """Lists all available versions of a project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.project_versions_handler(project, async_req=True) - >>> result = thread.get() + @validate_call + def project_versions_handler( + self, + project: Annotated[StrictStr, Field(description="Project id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ProjectVersion]: + """Lists all available versions of a project. + :param project: Project id (required) :type project: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ProjectVersion] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the project_versions_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.project_versions_handler_with_http_info(project, **kwargs) # noqa: E501 - - @validate_arguments - def project_versions_handler_with_http_info(self, project : Annotated[StrictStr, Field(..., description="Project id")], **kwargs) -> ApiResponse: # noqa: E501 - """Lists all available versions of a project. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.project_versions_handler_with_http_info(project, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._project_versions_handler_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectVersion]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def project_versions_handler_with_http_info( + self, + project: Annotated[StrictStr, Field(description="Project id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ProjectVersion]]: + """Lists all available versions of a project. + :param project: Project id (required) :type project: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ProjectVersion], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._project_versions_handler_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectVersion]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'project' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def project_versions_handler_without_preload_content( + self, + project: Annotated[StrictStr, Field(description="Project id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Lists all available versions of a project. + + + :param project: Project id (required) + :type project: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._project_versions_handler_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method project_versions_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProjectVersion]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project']: - _path_params['project'] = _params['project'] + def _project_versions_handler_serialize( + self, + project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project is not None: + _path_params['project'] = project # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "List[ProjectVersion]", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/project/{project}/versions', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/project/{project}/versions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def update_project_handler(self, project : Annotated[StrictStr, Field(..., description="Project id")], update_project : UpdateProject, **kwargs) -> None: # noqa: E501 - """Updates a project. # noqa: E501 - This will create a new version. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_project_handler(project, update_project, async_req=True) - >>> result = thread.get() + + @validate_call + def update_project_handler( + self, + project: Annotated[StrictStr, Field(description="Project id")], + update_project: UpdateProject, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Updates a project. + + This will create a new version. :param project: Project id (required) :type project: str :param update_project: (required) :type update_project: UpdateProject - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_project_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_project_handler_with_http_info(project, update_project, **kwargs) # noqa: E501 - - @validate_arguments - def update_project_handler_with_http_info(self, project : Annotated[StrictStr, Field(..., description="Project id")], update_project : UpdateProject, **kwargs) -> ApiResponse: # noqa: E501 - """Updates a project. # noqa: E501 - - This will create a new version. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_project_handler_with_http_info(project, update_project, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_project_handler_serialize( + project=project, + update_project=update_project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_project_handler_with_http_info( + self, + project: Annotated[StrictStr, Field(description="Project id")], + update_project: UpdateProject, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Updates a project. + + This will create a new version. :param project: Project id (required) :type project: str :param update_project: (required) :type update_project: UpdateProject - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_project_handler_serialize( + project=project, + update_project=update_project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'project', - 'update_project' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def update_project_handler_without_preload_content( + self, + project: Annotated[StrictStr, Field(description="Project id")], + update_project: UpdateProject, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Updates a project. + + This will create a new version. + + :param project: Project id (required) + :type project: str + :param update_project: (required) + :type update_project: UpdateProject + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_handler_serialize( + project=project, + update_project=update_project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_project_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project']: - _path_params['project'] = _params['project'] + def _update_project_handler_serialize( + self, + project, + update_project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project is not None: + _path_params['project'] = project # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['update_project'] is not None: - _body_params = _params['update_project'] + if update_project is not None: + _body_params = update_project + + # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/project/{project}', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/project/{project}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/session_api.py b/python/geoengine_openapi_client/api/session_api.py index 4da86eb5..fee91b0f 100644 --- a/python/geoengine_openapi_client/api/session_api.py +++ b/python/geoengine_openapi_client/api/session_api.py @@ -12,27 +12,21 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated from pydantic import StrictStr - from geoengine_openapi_client.models.auth_code_request_url import AuthCodeRequestURL from geoengine_openapi_client.models.auth_code_response import AuthCodeResponse from geoengine_openapi_client.models.user_credentials import UserCredentials from geoengine_openapi_client.models.user_registration import UserRegistration from geoengine_openapi_client.models.user_session import UserSession -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class SessionApi: @@ -47,971 +41,1815 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def anonymous_handler(self, **kwargs) -> UserSession: # noqa: E501 - """Creates session for anonymous user. The session's id serves as a Bearer token for requests. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def anonymous_handler( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserSession: + """Creates session for anonymous user. The session's id serves as a Bearer token for requests. - >>> thread = api.anonymous_handler(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserSession - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the anonymous_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.anonymous_handler_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def anonymous_handler_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Creates session for anonymous user. The session's id serves as a Bearer token for requests. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.anonymous_handler_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._anonymous_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def anonymous_handler_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserSession]: + """Creates session for anonymous user. The session's id serves as a Bearer token for requests. + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserSession, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._anonymous_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def anonymous_handler_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Creates session for anonymous user. The session's id serves as a Bearer token for requests. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._anonymous_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method anonymous_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _anonymous_handler_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "UserSession", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/anonymous', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/anonymous', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def login_handler(self, user_credentials : UserCredentials, **kwargs) -> UserSession: # noqa: E501 - """Creates a session by providing user credentials. The session's id serves as a Bearer token for requests. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.login_handler(user_credentials, async_req=True) - >>> result = thread.get() + @validate_call + def login_handler( + self, + user_credentials: UserCredentials, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserSession: + """Creates a session by providing user credentials. The session's id serves as a Bearer token for requests. + :param user_credentials: (required) :type user_credentials: UserCredentials - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserSession - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the login_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.login_handler_with_http_info(user_credentials, **kwargs) # noqa: E501 - - @validate_arguments - def login_handler_with_http_info(self, user_credentials : UserCredentials, **kwargs) -> ApiResponse: # noqa: E501 - """Creates a session by providing user credentials. The session's id serves as a Bearer token for requests. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login_handler_with_http_info(user_credentials, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._login_handler_serialize( + user_credentials=user_credentials, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def login_handler_with_http_info( + self, + user_credentials: UserCredentials, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserSession]: + """Creates a session by providing user credentials. The session's id serves as a Bearer token for requests. + :param user_credentials: (required) :type user_credentials: UserCredentials - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserSession, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._login_handler_serialize( + user_credentials=user_credentials, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user_credentials' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def login_handler_without_preload_content( + self, + user_credentials: UserCredentials, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Creates a session by providing user credentials. The session's id serves as a Bearer token for requests. + + + :param user_credentials: (required) + :type user_credentials: UserCredentials + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_handler_serialize( + user_credentials=user_credentials, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _login_handler_serialize( + self, + user_credentials, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['user_credentials'] is not None: - _body_params = _params['user_credentials'] + if user_credentials is not None: + _body_params = user_credentials + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "UserSession", - } + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/login', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/login', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def logout_handler(self, **kwargs) -> None: # noqa: E501 - """Ends a session. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def logout_handler( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Ends a session. - >>> thread = api.logout_handler(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the logout_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.logout_handler_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def logout_handler_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Ends a session. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.logout_handler_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._logout_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def logout_handler_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Ends a session. + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 - _params = locals() + _param = self._logout_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def logout_handler_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Ends a session. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logout_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method logout_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _logout_handler_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/logout', 'POST', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/logout', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def oidc_init(self, redirect_uri : StrictStr, **kwargs) -> AuthCodeRequestURL: # noqa: E501 - """Initializes the Open Id Connect login procedure by requesting a parametrized url to the configured Id Provider. # noqa: E501 - # Errors This call fails if Open ID Connect is disabled, misconfigured or the Id Provider is unreachable. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.oidc_init(redirect_uri, async_req=True) - >>> result = thread.get() + @validate_call + def oidc_init( + self, + redirect_uri: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthCodeRequestURL: + """Initializes the Open Id Connect login procedure by requesting a parametrized url to the configured Id Provider. + + # Errors This call fails if Open ID Connect is disabled, misconfigured or the Id Provider is unreachable. :param redirect_uri: (required) :type redirect_uri: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AuthCodeRequestURL - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the oidc_init_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.oidc_init_with_http_info(redirect_uri, **kwargs) # noqa: E501 - - @validate_arguments - def oidc_init_with_http_info(self, redirect_uri : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Initializes the Open Id Connect login procedure by requesting a parametrized url to the configured Id Provider. # noqa: E501 - - # Errors This call fails if Open ID Connect is disabled, misconfigured or the Id Provider is unreachable. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.oidc_init_with_http_info(redirect_uri, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._oidc_init_serialize( + redirect_uri=redirect_uri, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthCodeRequestURL", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def oidc_init_with_http_info( + self, + redirect_uri: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthCodeRequestURL]: + """Initializes the Open Id Connect login procedure by requesting a parametrized url to the configured Id Provider. + + # Errors This call fails if Open ID Connect is disabled, misconfigured or the Id Provider is unreachable. :param redirect_uri: (required) :type redirect_uri: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AuthCodeRequestURL, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._oidc_init_serialize( + redirect_uri=redirect_uri, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthCodeRequestURL", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'redirect_uri' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def oidc_init_without_preload_content( + self, + redirect_uri: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Initializes the Open Id Connect login procedure by requesting a parametrized url to the configured Id Provider. + + # Errors This call fails if Open ID Connect is disabled, misconfigured or the Id Provider is unreachable. + + :param redirect_uri: (required) + :type redirect_uri: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._oidc_init_serialize( + redirect_uri=redirect_uri, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method oidc_init" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthCodeRequestURL", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _oidc_init_serialize( + self, + redirect_uri, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('redirect_uri') is not None: # noqa: E501 - _query_params.append(('redirectUri', _params['redirect_uri'])) + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if redirect_uri is not None: + + _query_params.append(('redirectUri', redirect_uri)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AuthCodeRequestURL", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/oidcInit', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/oidcInit', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def oidc_login(self, redirect_uri : StrictStr, auth_code_response : AuthCodeResponse, **kwargs) -> UserSession: # noqa: E501 - """Creates a session for a user via a login with Open Id Connect. # noqa: E501 - This call must be preceded by a call to oidcInit and match the parameters of that call. # Errors This call fails if the [`AuthCodeResponse`] is invalid, if a previous oidcLogin call with the same state was already successfully or unsuccessfully resolved, if the Open Id Connect configuration is invalid, or if the Id Provider is unreachable. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.oidc_login(redirect_uri, auth_code_response, async_req=True) - >>> result = thread.get() + + @validate_call + def oidc_login( + self, + redirect_uri: StrictStr, + auth_code_response: AuthCodeResponse, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserSession: + """Creates a session for a user via a login with Open Id Connect. + + This call must be preceded by a call to oidcInit and match the parameters of that call. # Errors This call fails if the [`AuthCodeResponse`] is invalid, if a previous oidcLogin call with the same state was already successfully or unsuccessfully resolved, if the Open Id Connect configuration is invalid, or if the Id Provider is unreachable. :param redirect_uri: (required) :type redirect_uri: str :param auth_code_response: (required) :type auth_code_response: AuthCodeResponse - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserSession - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the oidc_login_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.oidc_login_with_http_info(redirect_uri, auth_code_response, **kwargs) # noqa: E501 - - @validate_arguments - def oidc_login_with_http_info(self, redirect_uri : StrictStr, auth_code_response : AuthCodeResponse, **kwargs) -> ApiResponse: # noqa: E501 - """Creates a session for a user via a login with Open Id Connect. # noqa: E501 - - This call must be preceded by a call to oidcInit and match the parameters of that call. # Errors This call fails if the [`AuthCodeResponse`] is invalid, if a previous oidcLogin call with the same state was already successfully or unsuccessfully resolved, if the Open Id Connect configuration is invalid, or if the Id Provider is unreachable. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.oidc_login_with_http_info(redirect_uri, auth_code_response, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._oidc_login_serialize( + redirect_uri=redirect_uri, + auth_code_response=auth_code_response, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def oidc_login_with_http_info( + self, + redirect_uri: StrictStr, + auth_code_response: AuthCodeResponse, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserSession]: + """Creates a session for a user via a login with Open Id Connect. + + This call must be preceded by a call to oidcInit and match the parameters of that call. # Errors This call fails if the [`AuthCodeResponse`] is invalid, if a previous oidcLogin call with the same state was already successfully or unsuccessfully resolved, if the Open Id Connect configuration is invalid, or if the Id Provider is unreachable. :param redirect_uri: (required) :type redirect_uri: str :param auth_code_response: (required) :type auth_code_response: AuthCodeResponse - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserSession, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._oidc_login_serialize( + redirect_uri=redirect_uri, + auth_code_response=auth_code_response, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'redirect_uri', - 'auth_code_response' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def oidc_login_without_preload_content( + self, + redirect_uri: StrictStr, + auth_code_response: AuthCodeResponse, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Creates a session for a user via a login with Open Id Connect. + + This call must be preceded by a call to oidcInit and match the parameters of that call. # Errors This call fails if the [`AuthCodeResponse`] is invalid, if a previous oidcLogin call with the same state was already successfully or unsuccessfully resolved, if the Open Id Connect configuration is invalid, or if the Id Provider is unreachable. + + :param redirect_uri: (required) + :type redirect_uri: str + :param auth_code_response: (required) + :type auth_code_response: AuthCodeResponse + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._oidc_login_serialize( + redirect_uri=redirect_uri, + auth_code_response=auth_code_response, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method oidc_login" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _oidc_login_serialize( + self, + redirect_uri, + auth_code_response, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('redirect_uri') is not None: # noqa: E501 - _query_params.append(('redirectUri', _params['redirect_uri'])) + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if redirect_uri is not None: + + _query_params.append(('redirectUri', redirect_uri)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['auth_code_response'] is not None: - _body_params = _params['auth_code_response'] + if auth_code_response is not None: + _body_params = auth_code_response + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "UserSession", - } + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/oidcLogin', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/oidcLogin', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def register_user_handler(self, user_registration : UserRegistration, **kwargs) -> str: # noqa: E501 - """Registers a user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.register_user_handler(user_registration, async_req=True) - >>> result = thread.get() + @validate_call + def register_user_handler( + self, + user_registration: UserRegistration, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Registers a user. + :param user_registration: (required) :type user_registration: UserRegistration - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the register_user_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.register_user_handler_with_http_info(user_registration, **kwargs) # noqa: E501 - - @validate_arguments - def register_user_handler_with_http_info(self, user_registration : UserRegistration, **kwargs) -> ApiResponse: # noqa: E501 - """Registers a user. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.register_user_handler_with_http_info(user_registration, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._register_user_handler_serialize( + user_registration=user_registration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def register_user_handler_with_http_info( + self, + user_registration: UserRegistration, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Registers a user. + :param user_registration: (required) :type user_registration: UserRegistration - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._register_user_handler_serialize( + user_registration=user_registration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'user_registration' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def register_user_handler_without_preload_content( + self, + user_registration: UserRegistration, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Registers a user. + + + :param user_registration: (required) + :type user_registration: UserRegistration + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._register_user_handler_serialize( + user_registration=user_registration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method register_user_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _register_user_handler_serialize( + self, + user_registration, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['user_registration'] is not None: - _body_params = _params['user_registration'] + if user_registration is not None: + _body_params = user_registration + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "str", - } + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/user', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/user', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def session_handler(self, **kwargs) -> UserSession: # noqa: E501 - """Retrieves details about the current session. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def session_handler( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserSession: + """Retrieves details about the current session. - >>> thread = api.session_handler(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserSession - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the session_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.session_handler_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def session_handler_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves details about the current session. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.session_handler_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._session_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def session_handler_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserSession]: + """Retrieves details about the current session. + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserSession, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._session_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def session_handler_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves details about the current session. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._session_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method session_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSession", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _session_handler_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "UserSession", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/session', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/session', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/spatial_references_api.py b/python/geoengine_openapi_client/api/spatial_references_api.py index c7fbff38..ca4a0284 100644 --- a/python/geoengine_openapi_client/api/spatial_references_api.py +++ b/python/geoengine_openapi_client/api/spatial_references_api.py @@ -12,23 +12,17 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated from pydantic import StrictStr - from geoengine_openapi_client.models.spatial_reference_specification import SpatialReferenceSpecification -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class SpatialReferencesApi: @@ -43,140 +37,260 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def get_spatial_reference_specification_handler(self, srs_string : StrictStr, **kwargs) -> SpatialReferenceSpecification: # noqa: E501 - """get_spatial_reference_specification_handler # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_spatial_reference_specification_handler( + self, + srs_string: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SpatialReferenceSpecification: + """get_spatial_reference_specification_handler - >>> thread = api.get_spatial_reference_specification_handler(srs_string, async_req=True) - >>> result = thread.get() :param srs_string: (required) :type srs_string: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SpatialReferenceSpecification - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_spatial_reference_specification_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_spatial_reference_specification_handler_with_http_info(srs_string, **kwargs) # noqa: E501 - - @validate_arguments - def get_spatial_reference_specification_handler_with_http_info(self, srs_string : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get_spatial_reference_specification_handler # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_spatial_reference_specification_handler_with_http_info(srs_string, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_spatial_reference_specification_handler_serialize( + srs_string=srs_string, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpatialReferenceSpecification", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_spatial_reference_specification_handler_with_http_info( + self, + srs_string: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SpatialReferenceSpecification]: + """get_spatial_reference_specification_handler + :param srs_string: (required) :type srs_string: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SpatialReferenceSpecification, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_spatial_reference_specification_handler_serialize( + srs_string=srs_string, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpatialReferenceSpecification", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'srs_string' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_spatial_reference_specification_handler_without_preload_content( + self, + srs_string: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_spatial_reference_specification_handler + + + :param srs_string: (required) + :type srs_string: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_spatial_reference_specification_handler_serialize( + srs_string=srs_string, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_spatial_reference_specification_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpatialReferenceSpecification", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['srs_string']: - _path_params['srsString'] = _params['srs_string'] + def _get_spatial_reference_specification_handler_serialize( + self, + srs_string, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if srs_string is not None: + _path_params['srsString'] = srs_string # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "SpatialReferenceSpecification", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/spatialReferenceSpecification/{srsString}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/spatialReferenceSpecification/{srsString}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/tasks_api.py b/python/geoengine_openapi_client/api/tasks_api.py index 0bef6cd6..403826ff 100644 --- a/python/geoengine_openapi_client/api/tasks_api.py +++ b/python/geoengine_openapi_client/api/tasks_api.py @@ -12,27 +12,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint +from pydantic import Field, StrictBool, StrictStr from typing import Any, List, Optional - +from typing_extensions import Annotated from geoengine_openapi_client.models.task_status import TaskStatus from geoengine_openapi_client.models.task_status_with_id import TaskStatusWithId -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class TasksApi: @@ -47,157 +40,303 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def abort_handler(self, id : Annotated[StrictStr, Field(..., description="Task id")], force : Optional[StrictBool] = None, **kwargs) -> None: # noqa: E501 - """Abort a running task. # noqa: E501 - # Parameters * `force` - If true, the task will be aborted without clean-up. You can abort a task that is already in the process of aborting. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def abort_handler( + self, + id: Annotated[StrictStr, Field(description="Task id")], + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Abort a running task. - >>> thread = api.abort_handler(id, force, async_req=True) - >>> result = thread.get() + # Parameters * `force` - If true, the task will be aborted without clean-up. You can abort a task that is already in the process of aborting. :param id: Task id (required) :type id: str :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the abort_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.abort_handler_with_http_info(id, force, **kwargs) # noqa: E501 - - @validate_arguments - def abort_handler_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Task id")], force : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Abort a running task. # noqa: E501 - - # Parameters * `force` - If true, the task will be aborted without clean-up. You can abort a task that is already in the process of aborting. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.abort_handler_with_http_info(id, force, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._abort_handler_serialize( + id=id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + # Note: fixed handling of empty responses + if response_data.data is None: + return None + + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def abort_handler_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Task id")], + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Abort a running task. + + # Parameters * `force` - If true, the task will be aborted without clean-up. You can abort a task that is already in the process of aborting. :param id: Task id (required) :type id: str :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._abort_handler_serialize( + id=id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'force' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def abort_handler_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Task id")], + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Abort a running task. + + # Parameters * `force` - If true, the task will be aborted without clean-up. You can abort a task that is already in the process of aborting. + + :param id: Task id (required) + :type id: str + :param force: + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._abort_handler_serialize( + id=id, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method abort_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _abort_handler_serialize( + self, + id, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('force') is not None: # noqa: E501 - _query_params.append(('force', _params['force'])) + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if force is not None: + + _query_params.append(('force', force)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/tasks/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tasks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def list_handler(self, filter : Optional[Any], offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> List[TaskStatusWithId]: # noqa: E501 - """Retrieve the status of all tasks. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_handler( + self, + filter: Optional[Any], + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[TaskStatusWithId]: + """Retrieve the status of all tasks. - >>> thread = api.list_handler(filter, offset, limit, async_req=True) - >>> result = thread.get() :param filter: (required) :type filter: TaskFilter @@ -205,32 +344,73 @@ def list_handler(self, filter : Optional[Any], offset : conint(strict=True, ge=0 :type offset: int :param limit: (required) :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[TaskStatusWithId] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_handler_with_http_info(filter, offset, limit, **kwargs) # noqa: E501 - - @validate_arguments - def list_handler_with_http_info(self, filter : Optional[Any], offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> ApiResponse: # noqa: E501 - """Retrieve the status of all tasks. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_handler_with_http_info(filter, offset, limit, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_handler_serialize( + filter=filter, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[TaskStatusWithId]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_handler_with_http_info( + self, + filter: Optional[Any], + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[TaskStatusWithId]]: + """Retrieve the status of all tasks. + :param filter: (required) :type filter: TaskFilter @@ -238,245 +418,445 @@ def list_handler_with_http_info(self, filter : Optional[Any], offset : conint(st :type offset: int :param limit: (required) :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[TaskStatusWithId], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_handler_serialize( + filter=filter, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[TaskStatusWithId]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'filter', - 'offset', - 'limit' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def list_handler_without_preload_content( + self, + filter: Optional[Any], + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the status of all tasks. + + + :param filter: (required) + :type filter: TaskFilter + :param offset: (required) + :type offset: int + :param limit: (required) + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_handler_serialize( + filter=filter, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[TaskStatusWithId]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['filter']: - _path_params['filter'] = _params['filter'] + def _list_handler_serialize( + self, + filter, + offset, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['offset']: - _path_params['offset'] = _params['offset'] + _host = None - if _params['limit']: - _path_params['limit'] = _params['limit'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if filter is not None: + _path_params['filter'] = filter.value + if offset is not None: + _path_params['offset'] = offset + if limit is not None: + _path_params['limit'] = limit # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "List[TaskStatusWithId]", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/tasks/list', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/tasks/list', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def status_handler(self, id : Annotated[StrictStr, Field(..., description="Task id")], **kwargs) -> TaskStatus: # noqa: E501 - """Retrieve the status of a task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.status_handler(id, async_req=True) - >>> result = thread.get() + @validate_call + def status_handler( + self, + id: Annotated[StrictStr, Field(description="Task id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TaskStatus: + """Retrieve the status of a task. + :param id: Task id (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: TaskStatus - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the status_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.status_handler_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def status_handler_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Task id")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieve the status of a task. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.status_handler_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._status_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def status_handler_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Task id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TaskStatus]: + """Retrieve the status of a task. + :param id: Task id (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(TaskStatus, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._status_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def status_handler_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Task id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the status of a task. + + + :param id: Task id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._status_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method status_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _status_handler_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "TaskStatus", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/tasks/{id}/status', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/tasks/{id}/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/uploads_api.py b/python/geoengine_openapi_client/api/uploads_api.py index 58a5720a..69ed7317 100644 --- a/python/geoengine_openapi_client/api/uploads_api.py +++ b/python/geoengine_openapi_client/api/uploads_api.py @@ -12,28 +12,21 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBytes, StrictStr, conlist - -from typing import Union +from pydantic import Field, StrictBytes, StrictStr +from typing import List, Tuple, Union +from typing_extensions import Annotated from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response from geoengine_openapi_client.models.upload_file_layers_response import UploadFileLayersResponse from geoengine_openapi_client.models.upload_files_response import UploadFilesResponse -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class UploadsApi: @@ -48,432 +41,805 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> UploadFileLayersResponse: # noqa: E501 - """List the layers of on uploaded file. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_upload_file_layers_handler( + self, + upload_id: Annotated[StrictStr, Field(description="Upload id")], + file_name: Annotated[StrictStr, Field(description="File name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UploadFileLayersResponse: + """List the layers of on uploaded file. - >>> thread = api.list_upload_file_layers_handler(upload_id, file_name, async_req=True) - >>> result = thread.get() :param upload_id: Upload id (required) :type upload_id: str :param file_name: File name (required) :type file_name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UploadFileLayersResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_upload_file_layers_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_upload_file_layers_handler_with_http_info(upload_id, file_name, **kwargs) # noqa: E501 - - @validate_arguments - def list_upload_file_layers_handler_with_http_info(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> ApiResponse: # noqa: E501 - """List the layers of on uploaded file. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_upload_file_layers_handler_with_http_info(upload_id, file_name, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_upload_file_layers_handler_serialize( + upload_id=upload_id, + file_name=file_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UploadFileLayersResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_upload_file_layers_handler_with_http_info( + self, + upload_id: Annotated[StrictStr, Field(description="Upload id")], + file_name: Annotated[StrictStr, Field(description="File name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UploadFileLayersResponse]: + """List the layers of on uploaded file. + :param upload_id: Upload id (required) :type upload_id: str :param file_name: File name (required) :type file_name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UploadFileLayersResponse, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_upload_file_layers_handler_serialize( + upload_id=upload_id, + file_name=file_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "UploadFileLayersResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'upload_id', - 'file_name' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def list_upload_file_layers_handler_without_preload_content( + self, + upload_id: Annotated[StrictStr, Field(description="Upload id")], + file_name: Annotated[StrictStr, Field(description="File name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the layers of on uploaded file. + + + :param upload_id: Upload id (required) + :type upload_id: str + :param file_name: File name (required) + :type file_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_upload_file_layers_handler_serialize( + upload_id=upload_id, + file_name=file_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_upload_file_layers_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UploadFileLayersResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['upload_id']: - _path_params['upload_id'] = _params['upload_id'] + def _list_upload_file_layers_handler_serialize( + self, + upload_id, + file_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['file_name']: - _path_params['file_name'] = _params['file_name'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if upload_id is not None: + _path_params['upload_id'] = upload_id + if file_name is not None: + _path_params['file_name'] = file_name # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "UploadFileLayersResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/uploads/{upload_id}/files/{file_name}/layers', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/uploads/{upload_id}/files/{file_name}/layers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_upload_files_handler(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], **kwargs) -> UploadFilesResponse: # noqa: E501 - """List the files of on upload. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_upload_files_handler(upload_id, async_req=True) - >>> result = thread.get() + @validate_call + def list_upload_files_handler( + self, + upload_id: Annotated[StrictStr, Field(description="Upload id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UploadFilesResponse: + """List the files of on upload. + :param upload_id: Upload id (required) :type upload_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UploadFilesResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_upload_files_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_upload_files_handler_with_http_info(upload_id, **kwargs) # noqa: E501 - - @validate_arguments - def list_upload_files_handler_with_http_info(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], **kwargs) -> ApiResponse: # noqa: E501 - """List the files of on upload. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_upload_files_handler_with_http_info(upload_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_upload_files_handler_serialize( + upload_id=upload_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UploadFilesResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_upload_files_handler_with_http_info( + self, + upload_id: Annotated[StrictStr, Field(description="Upload id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UploadFilesResponse]: + """List the files of on upload. + :param upload_id: Upload id (required) :type upload_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UploadFilesResponse, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_upload_files_handler_serialize( + upload_id=upload_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UploadFilesResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'upload_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def list_upload_files_handler_without_preload_content( + self, + upload_id: Annotated[StrictStr, Field(description="Upload id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the files of on upload. + + + :param upload_id: Upload id (required) + :type upload_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_upload_files_handler_serialize( + upload_id=upload_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_upload_files_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UploadFilesResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['upload_id']: - _path_params['upload_id'] = _params['upload_id'] + def _list_upload_files_handler_serialize( + self, + upload_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if upload_id is not None: + _path_params['upload_id'] = upload_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "UploadFilesResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/uploads/{upload_id}/files', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/uploads/{upload_id}/files', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def upload_handler(self, files : conlist(Union[StrictBytes, StrictStr]), **kwargs) -> AddCollection200Response: # noqa: E501 - """Uploads files. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upload_handler(files, async_req=True) - >>> result = thread.get() + + @validate_call + def upload_handler( + self, + files: List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AddCollection200Response: + """Uploads files. + :param files: (required) :type files: List[bytearray] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AddCollection200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the upload_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.upload_handler_with_http_info(files, **kwargs) # noqa: E501 - - @validate_arguments - def upload_handler_with_http_info(self, files : conlist(Union[StrictBytes, StrictStr]), **kwargs) -> ApiResponse: # noqa: E501 - """Uploads files. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_handler_with_http_info(files, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._upload_handler_serialize( + files=files, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def upload_handler_with_http_info( + self, + files: List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AddCollection200Response]: + """Uploads files. + :param files: (required) :type files: List[bytearray] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AddCollection200Response, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._upload_handler_serialize( + files=files, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'files' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def upload_handler_without_preload_content( + self, + files: List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Uploads files. + + + :param files: (required) + :type files: List[bytearray] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_handler_serialize( + files=files, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _upload_handler_serialize( + self, + files, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + 'files[]': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} - if _params['files']: - _files['files[]'] = _params['files'] - _collection_formats['files[]'] = 'csv' - + if files is not None: + _files['files[]'] = files # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { - '200': "AddCollection200Response", - } + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/upload', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/upload', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/user_api.py b/python/geoengine_openapi_client/api/user_api.py index 0e38d07c..89abe9c5 100644 --- a/python/geoengine_openapi_client/api/user_api.py +++ b/python/geoengine_openapi_client/api/user_api.py @@ -12,18 +12,14 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint +from pydantic import Field, StrictStr from typing import List, Optional - +from typing_extensions import Annotated from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response from geoengine_openapi_client.models.add_role import AddRole from geoengine_openapi_client.models.computation_quota import ComputationQuota @@ -35,12 +31,9 @@ from geoengine_openapi_client.models.update_quota import UpdateQuota from geoengine_openapi_client.models.usage_summary_granularity import UsageSummaryGranularity -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class UserApi: @@ -55,1834 +48,3460 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def add_role_handler(self, add_role : AddRole, **kwargs) -> str: # noqa: E501 - """Add a new role. Requires admin privilige. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_role_handler( + self, + add_role: AddRole, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Add a new role. Requires admin privilige. - >>> thread = api.add_role_handler(add_role, async_req=True) - >>> result = thread.get() :param add_role: (required) :type add_role: AddRole - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the add_role_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.add_role_handler_with_http_info(add_role, **kwargs) # noqa: E501 - - @validate_arguments - def add_role_handler_with_http_info(self, add_role : AddRole, **kwargs) -> ApiResponse: # noqa: E501 - """Add a new role. Requires admin privilige. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_role_handler_with_http_info(add_role, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._add_role_handler_serialize( + add_role=add_role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_role_handler_with_http_info( + self, + add_role: AddRole, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Add a new role. Requires admin privilige. + :param add_role: (required) :type add_role: AddRole - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._add_role_handler_serialize( + add_role=add_role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'add_role' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def add_role_handler_without_preload_content( + self, + add_role: AddRole, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a new role. Requires admin privilige. + + + :param add_role: (required) + :type add_role: AddRole + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_role_handler_serialize( + add_role=add_role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_role_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _add_role_handler_serialize( + self, + add_role, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['add_role'] is not None: - _body_params = _params['add_role'] + if add_role is not None: + _body_params = add_role + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { - '200': "str", - } + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/roles', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/roles', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def assign_role_handler(self, user : Annotated[StrictStr, Field(..., description="User id")], role : Annotated[StrictStr, Field(..., description="Role id")], **kwargs) -> None: # noqa: E501 - """Assign a role to a user. Requires admin privilige. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.assign_role_handler(user, role, async_req=True) - >>> result = thread.get() + @validate_call + def assign_role_handler( + self, + user: Annotated[StrictStr, Field(description="User id")], + role: Annotated[StrictStr, Field(description="Role id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Assign a role to a user. Requires admin privilige. + :param user: User id (required) :type user: str :param role: Role id (required) :type role: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the assign_role_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.assign_role_handler_with_http_info(user, role, **kwargs) # noqa: E501 - - @validate_arguments - def assign_role_handler_with_http_info(self, user : Annotated[StrictStr, Field(..., description="User id")], role : Annotated[StrictStr, Field(..., description="Role id")], **kwargs) -> ApiResponse: # noqa: E501 - """Assign a role to a user. Requires admin privilige. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.assign_role_handler_with_http_info(user, role, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._assign_role_handler_serialize( + user=user, + role=role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def assign_role_handler_with_http_info( + self, + user: Annotated[StrictStr, Field(description="User id")], + role: Annotated[StrictStr, Field(description="Role id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Assign a role to a user. Requires admin privilige. + :param user: User id (required) :type user: str :param role: Role id (required) :type role: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._assign_role_handler_serialize( + user=user, + role=role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user', - 'role' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def assign_role_handler_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="User id")], + role: Annotated[StrictStr, Field(description="Role id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Assign a role to a user. Requires admin privilige. + + + :param user: User id (required) + :type user: str + :param role: Role id (required) + :type role: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_role_handler_serialize( + user=user, + role=role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method assign_role_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user']: - _path_params['user'] = _params['user'] + def _assign_role_handler_serialize( + self, + user, + role, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['role']: - _path_params['role'] = _params['role'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user is not None: + _path_params['user'] = user + if role is not None: + _path_params['role'] = role # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/users/{user}/roles/{role}', 'POST', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/users/{user}/roles/{role}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def computation_quota_handler(self, computation : Annotated[StrictStr, Field(..., description="Computation id")], **kwargs) -> List[OperatorQuota]: # noqa: E501 - """Retrieves the quota used by computation with the given computation id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.computation_quota_handler(computation, async_req=True) - >>> result = thread.get() + + @validate_call + def computation_quota_handler( + self, + computation: Annotated[StrictStr, Field(description="Computation id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[OperatorQuota]: + """Retrieves the quota used by computation with the given computation id + :param computation: Computation id (required) :type computation: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[OperatorQuota] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the computation_quota_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.computation_quota_handler_with_http_info(computation, **kwargs) # noqa: E501 - - @validate_arguments - def computation_quota_handler_with_http_info(self, computation : Annotated[StrictStr, Field(..., description="Computation id")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves the quota used by computation with the given computation id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.computation_quota_handler_with_http_info(computation, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._computation_quota_handler_serialize( + computation=computation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OperatorQuota]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def computation_quota_handler_with_http_info( + self, + computation: Annotated[StrictStr, Field(description="Computation id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[OperatorQuota]]: + """Retrieves the quota used by computation with the given computation id + :param computation: Computation id (required) :type computation: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[OperatorQuota], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._computation_quota_handler_serialize( + computation=computation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OperatorQuota]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'computation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def computation_quota_handler_without_preload_content( + self, + computation: Annotated[StrictStr, Field(description="Computation id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves the quota used by computation with the given computation id + + + :param computation: Computation id (required) + :type computation: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._computation_quota_handler_serialize( + computation=computation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method computation_quota_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OperatorQuota]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['computation']: - _path_params['computation'] = _params['computation'] + def _computation_quota_handler_serialize( + self, + computation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if computation is not None: + _path_params['computation'] = computation # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "List[OperatorQuota]", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/quota/computations/{computation}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/quota/computations/{computation}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def computations_quota_handler(self, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> List[ComputationQuota]: # noqa: E501 - """Retrieves the quota used by computations # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def computations_quota_handler( + self, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ComputationQuota]: + """Retrieves the quota used by computations - >>> thread = api.computations_quota_handler(offset, limit, async_req=True) - >>> result = thread.get() :param offset: (required) :type offset: int :param limit: (required) :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ComputationQuota] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the computations_quota_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.computations_quota_handler_with_http_info(offset, limit, **kwargs) # noqa: E501 - - @validate_arguments - def computations_quota_handler_with_http_info(self, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves the quota used by computations # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.computations_quota_handler_with_http_info(offset, limit, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._computations_quota_handler_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ComputationQuota]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def computations_quota_handler_with_http_info( + self, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ComputationQuota]]: + """Retrieves the quota used by computations + :param offset: (required) :type offset: int :param limit: (required) :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ComputationQuota], status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'offset', - 'limit' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._computations_quota_handler_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method computations_quota_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('offset') is not None: # noqa: E501 - _query_params.append(('offset', _params['offset'])) - - if _params.get('limit') is not None: # noqa: E501 - _query_params.append(('limit', _params['limit'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '200': "List[ComputationQuota]", } - - return self.api_client.call_api( - '/quota/computations', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def data_usage_handler(self, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> List[DataUsage]: # noqa: E501 - """Retrieves the data usage # noqa: E501 + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.data_usage_handler(offset, limit, async_req=True) - >>> result = thread.get() + @validate_call + def computations_quota_handler_without_preload_content( + self, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves the quota used by computations - :param offset: (required) - :type offset: int - :param limit: (required) - :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[DataUsage] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the data_usage_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.data_usage_handler_with_http_info(offset, limit, **kwargs) # noqa: E501 - - @validate_arguments - def data_usage_handler_with_http_info(self, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves the data usage # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.data_usage_handler_with_http_info(offset, limit, async_req=True) - >>> result = thread.get() :param offset: (required) :type offset: int :param limit: (required) :type limit: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[DataUsage], status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._computations_quota_handler_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'offset', - 'limit' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ComputationQuota]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method data_usage_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _computations_quota_handler_serialize( + self, + offset, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _host = None - # process the query parameters - _query_params = [] - if _params.get('offset') is not None: # noqa: E501 - _query_params.append(('offset', _params['offset'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('limit') is not None: # noqa: E501 - _query_params.append(('limit', _params['limit'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "List[DataUsage]", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/quota/dataUsage', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/quota/computations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def data_usage_summary_handler(self, granularity : UsageSummaryGranularity, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), dataset : Optional[StrictStr] = None, **kwargs) -> List[DataUsageSummary]: # noqa: E501 - """Retrieves the data usage summary # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.data_usage_summary_handler(granularity, offset, limit, dataset, async_req=True) - >>> result = thread.get() - :param granularity: (required) - :type granularity: UsageSummaryGranularity - :param offset: (required) - :type offset: int - :param limit: (required) - :type limit: int - :param dataset: - :type dataset: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[DataUsageSummary] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the data_usage_summary_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.data_usage_summary_handler_with_http_info(granularity, offset, limit, dataset, **kwargs) # noqa: E501 - - @validate_arguments - def data_usage_summary_handler_with_http_info(self, granularity : UsageSummaryGranularity, offset : conint(strict=True, ge=0), limit : conint(strict=True, ge=0), dataset : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves the data usage summary # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.data_usage_summary_handler_with_http_info(granularity, offset, limit, dataset, async_req=True) - >>> result = thread.get() + @validate_call + def data_usage_handler( + self, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[DataUsage]: + """Retrieves the data usage + - :param granularity: (required) - :type granularity: UsageSummaryGranularity :param offset: (required) :type offset: int :param limit: (required) :type limit: int - :param dataset: - :type dataset: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[DataUsageSummary], status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'granularity', - 'offset', - 'limit', - 'dataset' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._data_usage_handler_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method data_usage_summary_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('granularity') is not None: # noqa: E501 - _query_params.append(('granularity', _params['granularity'].value)) + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[DataUsage]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def data_usage_handler_with_http_info( + self, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[DataUsage]]: + """Retrieves the data usage + + + :param offset: (required) + :type offset: int + :param limit: (required) + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._data_usage_handler_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[DataUsage]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def data_usage_handler_without_preload_content( + self, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves the data usage + + + :param offset: (required) + :type offset: int + :param limit: (required) + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._data_usage_handler_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[DataUsage]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _data_usage_handler_serialize( + self, + offset, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params.get('offset') is not None: # noqa: E501 - _query_params.append(('offset', _params['offset'])) + _host = None - if _params.get('limit') is not None: # noqa: E501 - _query_params.append(('limit', _params['limit'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('dataset') is not None: # noqa: E501 - _query_params.append(('dataset', _params['dataset'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + # authentication setting - _auth_settings = ['session_token'] # noqa: E501 + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/quota/dataUsage', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def data_usage_summary_handler( + self, + granularity: UsageSummaryGranularity, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + dataset: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[DataUsageSummary]: + """Retrieves the data usage summary + - _response_types_map = { + :param granularity: (required) + :type granularity: UsageSummaryGranularity + :param offset: (required) + :type offset: int + :param limit: (required) + :type limit: int + :param dataset: + :type dataset: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._data_usage_summary_handler_serialize( + granularity=granularity, + offset=offset, + limit=limit, + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { '200': "List[DataUsageSummary]", } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def data_usage_summary_handler_with_http_info( + self, + granularity: UsageSummaryGranularity, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + dataset: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[DataUsageSummary]]: + """Retrieves the data usage summary + - return self.api_client.call_api( - '/quota/dataUsage/summary', 'GET', - _path_params, - _query_params, - _header_params, + :param granularity: (required) + :type granularity: UsageSummaryGranularity + :param offset: (required) + :type offset: int + :param limit: (required) + :type limit: int + :param dataset: + :type dataset: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._data_usage_summary_handler_serialize( + granularity=granularity, + offset=offset, + limit=limit, + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[DataUsageSummary]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def data_usage_summary_handler_without_preload_content( + self, + granularity: UsageSummaryGranularity, + offset: Annotated[int, Field(strict=True, ge=0)], + limit: Annotated[int, Field(strict=True, ge=0)], + dataset: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves the data usage summary + + + :param granularity: (required) + :type granularity: UsageSummaryGranularity + :param offset: (required) + :type offset: int + :param limit: (required) + :type limit: int + :param dataset: + :type dataset: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._data_usage_summary_handler_serialize( + granularity=granularity, + offset=offset, + limit=limit, + dataset=dataset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[DataUsageSummary]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _data_usage_summary_handler_serialize( + self, + granularity, + offset, + limit, + dataset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if granularity is not None: + + _query_params.append(('granularity', granularity.value)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if dataset is not None: + + _query_params.append(('dataset', dataset)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/quota/dataUsage/summary', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_role_by_name_handler(self, name : Annotated[StrictStr, Field(..., description="Role Name")], **kwargs) -> AddCollection200Response: # noqa: E501 - """Get role by name # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_role_by_name_handler(name, async_req=True) - >>> result = thread.get() + + @validate_call + def get_role_by_name_handler( + self, + name: Annotated[StrictStr, Field(description="Role Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AddCollection200Response: + """Get role by name + :param name: Role Name (required) :type name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AddCollection200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_role_by_name_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_role_by_name_handler_with_http_info(name, **kwargs) # noqa: E501 - - @validate_arguments - def get_role_by_name_handler_with_http_info(self, name : Annotated[StrictStr, Field(..., description="Role Name")], **kwargs) -> ApiResponse: # noqa: E501 - """Get role by name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_role_by_name_handler_with_http_info(name, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_role_by_name_handler_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_role_by_name_handler_with_http_info( + self, + name: Annotated[StrictStr, Field(description="Role Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AddCollection200Response]: + """Get role by name + :param name: Role Name (required) :type name: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_role_by_name_handler_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_role_by_name_handler_without_preload_content( + self, + name: Annotated[StrictStr, Field(description="Role Name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get role by name + + + :param name: Role Name (required) + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_role_by_name_handler_serialize( + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_role_by_name_handler_serialize( + self, + name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if name is not None: + _path_params['name'] = name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/roles/byName/{name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_role_descriptions( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[RoleDescription]: + """Query roles for the current user. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_role_descriptions_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[RoleDescription]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_role_descriptions_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[RoleDescription]]: + """Query roles for the current user. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_role_descriptions_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[RoleDescription]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_role_descriptions_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Query roles for the current user. + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_role_descriptions_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[RoleDescription]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_role_descriptions_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/user/roles/descriptions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_user_quota_handler( + self, + user: Annotated[StrictStr, Field(description="User id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Quota: + """Retrieves the available and used quota of a specific user. + + + :param user: User id (required) + :type user: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_quota_handler_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Quota", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_user_quota_handler_with_http_info( + self, + user: Annotated[StrictStr, Field(description="User id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Quota]: + """Retrieves the available and used quota of a specific user. + + + :param user: User id (required) + :type user: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_quota_handler_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Quota", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_user_quota_handler_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="User id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves the available and used quota of a specific user. + + + :param user: User id (required) + :type user: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AddCollection200Response, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._get_user_quota_handler_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'name' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Quota", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_role_by_name_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _get_user_quota_handler_serialize( + self, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['name']: - _path_params['name'] = _params['name'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user is not None: + _path_params['user'] = user # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "AddCollection200Response", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/roles/byName/{name}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/quotas/{user}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_role_descriptions(self, **kwargs) -> List[RoleDescription]: # noqa: E501 - """Query roles for the current user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_role_descriptions(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[RoleDescription] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_role_descriptions_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_role_descriptions_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_role_descriptions_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Query roles for the current user. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_role_descriptions_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + @validate_call + def quota_handler( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Quota: + """Retrieves the available and used quota of the current user. + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[RoleDescription], status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _param = self._quota_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_role_descriptions" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '200': "Quota", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def quota_handler_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Quota]: + """Retrieves the available and used quota of the current user. - # process the path parameters - _path_params = {} - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 + _param = self._quota_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _response_types_map = { - '200': "List[RoleDescription]", + _response_types_map: Dict[str, Optional[str]] = { + '200': "Quota", } - - return self.api_client.call_api( - '/user/roles/descriptions', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def get_user_quota_handler(self, user : Annotated[StrictStr, Field(..., description="User id")], **kwargs) -> Quota: # noqa: E501 - """Retrieves the available and used quota of a specific user. # noqa: E501 + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_quota_handler(user, async_req=True) - >>> result = thread.get() + @validate_call + def quota_handler_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves the available and used quota of the current user. - :param user: User id (required) - :type user: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Quota - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_user_quota_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_user_quota_handler_with_http_info(user, **kwargs) # noqa: E501 - - @validate_arguments - def get_user_quota_handler_with_http_info(self, user : Annotated[StrictStr, Field(..., description="User id")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves the available and used quota of a specific user. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_user_quota_handler_with_http_info(user, async_req=True) - >>> result = thread.get() - :param user: User id (required) - :type user: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Quota, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._quota_handler_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'user' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Quota", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user_quota_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _quota_handler_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['user']: - _path_params['user'] = _params['user'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "Quota", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/quotas/{user}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/quota', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def quota_handler(self, **kwargs) -> Quota: # noqa: E501 - """Retrieves the available and used quota of the current user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.quota_handler(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Quota - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the quota_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.quota_handler_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def quota_handler_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves the available and used quota of the current user. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.quota_handler_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + @validate_call + def remove_role_handler( + self, + role: Annotated[StrictStr, Field(description="Role id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove a role. Requires admin privilige. + + + :param role: Role id (required) + :type role: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Quota, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._remove_role_handler_serialize( + role=role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method quota_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remove_role_handler_with_http_info( + self, + role: Annotated[StrictStr, Field(description="Role id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove a role. Requires admin privilige. - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 + :param role: Role id (required) + :type role: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_role_handler_serialize( + role=role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _response_types_map = { - '200': "Quota", + _response_types_map: Dict[str, Optional[str]] = { + '200': None, } - - return self.api_client.call_api( - '/quota', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def remove_role_handler(self, role : Annotated[StrictStr, Field(..., description="Role id")], **kwargs) -> None: # noqa: E501 - """Remove a role. Requires admin privilige. # noqa: E501 + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_role_handler(role, async_req=True) - >>> result = thread.get() + @validate_call + def remove_role_handler_without_preload_content( + self, + role: Annotated[StrictStr, Field(description="Role id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove a role. Requires admin privilige. - :param role: Role id (required) - :type role: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the remove_role_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.remove_role_handler_with_http_info(role, **kwargs) # noqa: E501 - - @validate_arguments - def remove_role_handler_with_http_info(self, role : Annotated[StrictStr, Field(..., description="Role id")], **kwargs) -> ApiResponse: # noqa: E501 - """Remove a role. Requires admin privilige. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.remove_role_handler_with_http_info(role, async_req=True) - >>> result = thread.get() :param role: Role id (required) :type role: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() + """ # noqa: E501 + + _param = self._remove_role_handler_serialize( + role=role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'role' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_role_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _remove_role_handler_serialize( + self, + role, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['role']: - _path_params['role'] = _params['role'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if role is not None: + _path_params['role'] = role # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/roles/{role}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/roles/{role}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def revoke_role_handler(self, user : Annotated[StrictStr, Field(..., description="User id")], role : Annotated[StrictStr, Field(..., description="Role id")], **kwargs) -> None: # noqa: E501 - """Revoke a role from a user. Requires admin privilige. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.revoke_role_handler(user, role, async_req=True) - >>> result = thread.get() + + @validate_call + def revoke_role_handler( + self, + user: Annotated[StrictStr, Field(description="User id")], + role: Annotated[StrictStr, Field(description="Role id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Revoke a role from a user. Requires admin privilige. + :param user: User id (required) :type user: str :param role: Role id (required) :type role: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the revoke_role_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.revoke_role_handler_with_http_info(user, role, **kwargs) # noqa: E501 - - @validate_arguments - def revoke_role_handler_with_http_info(self, user : Annotated[StrictStr, Field(..., description="User id")], role : Annotated[StrictStr, Field(..., description="Role id")], **kwargs) -> ApiResponse: # noqa: E501 - """Revoke a role from a user. Requires admin privilige. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.revoke_role_handler_with_http_info(user, role, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._revoke_role_handler_serialize( + user=user, + role=role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def revoke_role_handler_with_http_info( + self, + user: Annotated[StrictStr, Field(description="User id")], + role: Annotated[StrictStr, Field(description="Role id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Revoke a role from a user. Requires admin privilige. + :param user: User id (required) :type user: str :param role: Role id (required) :type role: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._revoke_role_handler_serialize( + user=user, + role=role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user', - 'role' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def revoke_role_handler_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="User id")], + role: Annotated[StrictStr, Field(description="Role id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Revoke a role from a user. Requires admin privilige. + + + :param user: User id (required) + :type user: str + :param role: Role id (required) + :type role: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._revoke_role_handler_serialize( + user=user, + role=role, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method revoke_role_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user']: - _path_params['user'] = _params['user'] + def _revoke_role_handler_serialize( + self, + user, + role, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['role']: - _path_params['role'] = _params['role'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user is not None: + _path_params['user'] = user + if role is not None: + _path_params['role'] = role # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/users/{user}/roles/{role}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/users/{user}/roles/{role}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def update_user_quota_handler(self, user : Annotated[StrictStr, Field(..., description="User id")], update_quota : UpdateQuota, **kwargs) -> None: # noqa: E501 - """Update the available quota of a specific user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_user_quota_handler(user, update_quota, async_req=True) - >>> result = thread.get() + @validate_call + def update_user_quota_handler( + self, + user: Annotated[StrictStr, Field(description="User id")], + update_quota: UpdateQuota, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Update the available quota of a specific user. + :param user: User id (required) :type user: str :param update_quota: (required) :type update_quota: UpdateQuota - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_user_quota_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_user_quota_handler_with_http_info(user, update_quota, **kwargs) # noqa: E501 - - @validate_arguments - def update_user_quota_handler_with_http_info(self, user : Annotated[StrictStr, Field(..., description="User id")], update_quota : UpdateQuota, **kwargs) -> ApiResponse: # noqa: E501 - """Update the available quota of a specific user. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user_quota_handler_with_http_info(user, update_quota, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_user_quota_handler_serialize( + user=user, + update_quota=update_quota, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_user_quota_handler_with_http_info( + self, + user: Annotated[StrictStr, Field(description="User id")], + update_quota: UpdateQuota, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Update the available quota of a specific user. + :param user: User id (required) :type user: str :param update_quota: (required) :type update_quota: UpdateQuota - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_user_quota_handler_serialize( + user=user, + update_quota=update_quota, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user', - 'update_quota' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def update_user_quota_handler_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="User id")], + update_quota: UpdateQuota, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the available quota of a specific user. + + + :param user: User id (required) + :type user: str + :param update_quota: (required) + :type update_quota: UpdateQuota + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_quota_handler_serialize( + user=user, + update_quota=update_quota, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_user_quota_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user']: - _path_params['user'] = _params['user'] + def _update_user_quota_handler_serialize( + self, + user, + update_quota, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user is not None: + _path_params['user'] = user # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['update_quota'] is not None: - _body_params = _params['update_quota'] + if update_quota is not None: + _body_params = update_quota + + # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/quotas/{user}', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/quotas/{user}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api/workflows_api.py b/python/geoengine_openapi_client/api/workflows_api.py index c59d6eaf..36859c28 100644 --- a/python/geoengine_openapi_client/api/workflows_api.py +++ b/python/geoengine_openapi_client/api/workflows_api.py @@ -12,18 +12,14 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr - -from typing import List, Union +from pydantic import Field, StrictBytes, StrictStr +from typing import List, Tuple, Union +from typing_extensions import Annotated from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response from geoengine_openapi_client.models.provenance_entry import ProvenanceEntry from geoengine_openapi_client.models.raster_dataset_from_workflow import RasterDatasetFromWorkflow @@ -34,12 +30,9 @@ from geoengine_openapi_client.models.typed_result_descriptor import TypedResultDescriptor from geoengine_openapi_client.models.workflow import Workflow -from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_client import ApiClient, RequestSerialized from geoengine_openapi_client.api_response import ApiResponse -from geoengine_openapi_client.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from geoengine_openapi_client.rest import RESTResponseType class WorkflowsApi: @@ -54,722 +47,1352 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def dataset_from_workflow_handler(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], raster_dataset_from_workflow : RasterDatasetFromWorkflow, **kwargs) -> TaskResponse: # noqa: E501 - """Create a task for creating a new dataset from the result of the workflow given by its `id` and the dataset parameters in the request body. # noqa: E501 - Returns the id of the created task # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def dataset_from_workflow_handler( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + raster_dataset_from_workflow: RasterDatasetFromWorkflow, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TaskResponse: + """Create a task for creating a new dataset from the result of the workflow given by its `id` and the dataset parameters in the request body. - >>> thread = api.dataset_from_workflow_handler(id, raster_dataset_from_workflow, async_req=True) - >>> result = thread.get() + Returns the id of the created task :param id: Workflow id (required) :type id: str :param raster_dataset_from_workflow: (required) :type raster_dataset_from_workflow: RasterDatasetFromWorkflow - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: TaskResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the dataset_from_workflow_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.dataset_from_workflow_handler_with_http_info(id, raster_dataset_from_workflow, **kwargs) # noqa: E501 - - @validate_arguments - def dataset_from_workflow_handler_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], raster_dataset_from_workflow : RasterDatasetFromWorkflow, **kwargs) -> ApiResponse: # noqa: E501 - """Create a task for creating a new dataset from the result of the workflow given by its `id` and the dataset parameters in the request body. # noqa: E501 - - Returns the id of the created task # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.dataset_from_workflow_handler_with_http_info(id, raster_dataset_from_workflow, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._dataset_from_workflow_handler_serialize( + id=id, + raster_dataset_from_workflow=raster_dataset_from_workflow, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def dataset_from_workflow_handler_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + raster_dataset_from_workflow: RasterDatasetFromWorkflow, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TaskResponse]: + """Create a task for creating a new dataset from the result of the workflow given by its `id` and the dataset parameters in the request body. + + Returns the id of the created task :param id: Workflow id (required) :type id: str :param raster_dataset_from_workflow: (required) :type raster_dataset_from_workflow: RasterDatasetFromWorkflow - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(TaskResponse, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._dataset_from_workflow_handler_serialize( + id=id, + raster_dataset_from_workflow=raster_dataset_from_workflow, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'raster_dataset_from_workflow' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def dataset_from_workflow_handler_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + raster_dataset_from_workflow: RasterDatasetFromWorkflow, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a task for creating a new dataset from the result of the workflow given by its `id` and the dataset parameters in the request body. + + Returns the id of the created task + + :param id: Workflow id (required) + :type id: str + :param raster_dataset_from_workflow: (required) + :type raster_dataset_from_workflow: RasterDatasetFromWorkflow + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._dataset_from_workflow_handler_serialize( + id=id, + raster_dataset_from_workflow=raster_dataset_from_workflow, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method dataset_from_workflow_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _dataset_from_workflow_handler_serialize( + self, + id, + raster_dataset_from_workflow, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['raster_dataset_from_workflow'] is not None: - _body_params = _params['raster_dataset_from_workflow'] + if raster_dataset_from_workflow is not None: + _body_params = raster_dataset_from_workflow + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { - '200': "TaskResponse", - } + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/datasetFromWorkflow/{id}', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/datasetFromWorkflow/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_workflow_all_metadata_zip_handler(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], **kwargs) -> bytearray: # noqa: E501 - """Gets a ZIP archive of the worklow, its provenance and the output metadata. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflow_all_metadata_zip_handler(id, async_req=True) - >>> result = thread.get() + @validate_call + def get_workflow_all_metadata_zip_handler( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """Gets a ZIP archive of the worklow, its provenance and the output metadata. + :param id: Workflow id (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: bytearray - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_workflow_all_metadata_zip_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_workflow_all_metadata_zip_handler_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def get_workflow_all_metadata_zip_handler_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], **kwargs) -> ApiResponse: # noqa: E501 - """Gets a ZIP archive of the worklow, its provenance and the output metadata. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_workflow_all_metadata_zip_handler_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_workflow_all_metadata_zip_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_workflow_all_metadata_zip_handler_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """Gets a ZIP archive of the worklow, its provenance and the output metadata. + :param id: Workflow id (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_workflow_all_metadata_zip_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_workflow_all_metadata_zip_handler_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets a ZIP archive of the worklow, its provenance and the output metadata. + + + :param id: Workflow id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_workflow_all_metadata_zip_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workflow_all_metadata_zip_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _get_workflow_all_metadata_zip_handler_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/zip']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/zip' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "bytearray", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/workflow/{id}/allMetadata/zip', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/workflow/{id}/allMetadata/zip', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def get_workflow_metadata_handler(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], **kwargs) -> TypedResultDescriptor: # noqa: E501 - """Gets the metadata of a workflow # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_workflow_metadata_handler( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TypedResultDescriptor: + """Gets the metadata of a workflow - >>> thread = api.get_workflow_metadata_handler(id, async_req=True) - >>> result = thread.get() :param id: Workflow id (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: TypedResultDescriptor - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_workflow_metadata_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_workflow_metadata_handler_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def get_workflow_metadata_handler_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], **kwargs) -> ApiResponse: # noqa: E501 - """Gets the metadata of a workflow # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_workflow_metadata_handler_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_workflow_metadata_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TypedResultDescriptor", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_workflow_metadata_handler_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TypedResultDescriptor]: + """Gets the metadata of a workflow + :param id: Workflow id (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(TypedResultDescriptor, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_workflow_metadata_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TypedResultDescriptor", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_workflow_metadata_handler_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets the metadata of a workflow + + + :param id: Workflow id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_workflow_metadata_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workflow_metadata_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "TypedResultDescriptor", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _get_workflow_metadata_handler_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "TypedResultDescriptor", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/workflow/{id}/metadata', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/workflow/{id}/metadata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_workflow_provenance_handler(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], **kwargs) -> List[ProvenanceEntry]: # noqa: E501 - """Gets the provenance of all datasets used in a workflow. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workflow_provenance_handler(id, async_req=True) - >>> result = thread.get() + + @validate_call + def get_workflow_provenance_handler( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ProvenanceEntry]: + """Gets the provenance of all datasets used in a workflow. + :param id: Workflow id (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ProvenanceEntry] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_workflow_provenance_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_workflow_provenance_handler_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def get_workflow_provenance_handler_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], **kwargs) -> ApiResponse: # noqa: E501 - """Gets the provenance of all datasets used in a workflow. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_workflow_provenance_handler_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_workflow_provenance_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProvenanceEntry]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_workflow_provenance_handler_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ProvenanceEntry]]: + """Gets the provenance of all datasets used in a workflow. + :param id: Workflow id (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ProvenanceEntry], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_workflow_provenance_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProvenanceEntry]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def get_workflow_provenance_handler_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets the provenance of all datasets used in a workflow. + + + :param id: Workflow id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_workflow_provenance_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workflow_provenance_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ProvenanceEntry]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _get_workflow_provenance_handler_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "List[ProvenanceEntry]", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/workflow/{id}/provenance', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/workflow/{id}/provenance', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def load_workflow_handler(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], **kwargs) -> Workflow: # noqa: E501 - """Retrieves an existing Workflow. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.load_workflow_handler(id, async_req=True) - >>> result = thread.get() + + @validate_call + def load_workflow_handler( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Workflow: + """Retrieves an existing Workflow. + :param id: Workflow id (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Workflow - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the load_workflow_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.load_workflow_handler_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def load_workflow_handler_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieves an existing Workflow. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.load_workflow_handler_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._load_workflow_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Workflow", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def load_workflow_handler_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Workflow]: + """Retrieves an existing Workflow. + :param id: Workflow id (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Workflow, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._load_workflow_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Workflow", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def load_workflow_handler_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieves an existing Workflow. + + + :param id: Workflow id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._load_workflow_handler_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method load_workflow_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Workflow", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _load_workflow_handler_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = { - '200': "Workflow", - } + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/workflow/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/workflow/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def raster_stream_websocket(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], spatial_bounds : SpatialPartition2D, time_interval : StrictStr, spatial_resolution : SpatialResolution, attributes : StrictStr, result_type : RasterStreamWebsocketResultType, **kwargs) -> None: # noqa: E501 - """Query a workflow raster result as a stream of tiles via a websocket connection. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def raster_stream_websocket( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + spatial_bounds: SpatialPartition2D, + time_interval: StrictStr, + spatial_resolution: SpatialResolution, + attributes: StrictStr, + result_type: RasterStreamWebsocketResultType, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Query a workflow raster result as a stream of tiles via a websocket connection. - >>> thread = api.raster_stream_websocket(id, spatial_bounds, time_interval, spatial_resolution, attributes, result_type, async_req=True) - >>> result = thread.get() :param id: Workflow id (required) :type id: str @@ -783,32 +1406,79 @@ def raster_stream_websocket(self, id : Annotated[StrictStr, Field(..., descripti :type attributes: str :param result_type: (required) :type result_type: RasterStreamWebsocketResultType - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the raster_stream_websocket_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.raster_stream_websocket_with_http_info(id, spatial_bounds, time_interval, spatial_resolution, attributes, result_type, **kwargs) # noqa: E501 - - @validate_arguments - def raster_stream_websocket_with_http_info(self, id : Annotated[StrictStr, Field(..., description="Workflow id")], spatial_bounds : SpatialPartition2D, time_interval : StrictStr, spatial_resolution : SpatialResolution, attributes : StrictStr, result_type : RasterStreamWebsocketResultType, **kwargs) -> ApiResponse: # noqa: E501 - """Query a workflow raster result as a stream of tiles via a websocket connection. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.raster_stream_websocket_with_http_info(id, spatial_bounds, time_interval, spatial_resolution, attributes, result_type, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._raster_stream_websocket_serialize( + id=id, + spatial_bounds=spatial_bounds, + time_interval=time_interval, + spatial_resolution=spatial_resolution, + attributes=attributes, + result_type=result_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '101': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def raster_stream_websocket_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + spatial_bounds: SpatialPartition2D, + time_interval: StrictStr, + spatial_resolution: SpatialResolution, + attributes: StrictStr, + result_type: RasterStreamWebsocketResultType, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Query a workflow raster result as a stream of tiles via a websocket connection. + :param id: Workflow id (required) :type id: str @@ -822,258 +1492,485 @@ def raster_stream_websocket_with_http_info(self, id : Annotated[StrictStr, Field :type attributes: str :param result_type: (required) :type result_type: RasterStreamWebsocketResultType - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'id', - 'spatial_bounds', - 'time_interval', - 'spatial_resolution', - 'attributes', - 'result_type' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._raster_stream_websocket_serialize( + id=id, + spatial_bounds=spatial_bounds, + time_interval=time_interval, + spatial_resolution=spatial_resolution, + attributes=attributes, + result_type=result_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method raster_stream_websocket" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + _response_types_map: Dict[str, Optional[str]] = { + '101': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the query parameters - _query_params = [] - if _params.get('spatial_bounds') is not None: # noqa: E501 - _query_params.append(('spatialBounds', _params['spatial_bounds'])) + @validate_call + def raster_stream_websocket_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Workflow id")], + spatial_bounds: SpatialPartition2D, + time_interval: StrictStr, + spatial_resolution: SpatialResolution, + attributes: StrictStr, + result_type: RasterStreamWebsocketResultType, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Query a workflow raster result as a stream of tiles via a websocket connection. - if _params.get('time_interval') is not None: # noqa: E501 - _query_params.append(('timeInterval', _params['time_interval'])) - if _params.get('spatial_resolution') is not None: # noqa: E501 - _query_params.append(('spatialResolution', _params['spatial_resolution'])) + :param id: Workflow id (required) + :type id: str + :param spatial_bounds: (required) + :type spatial_bounds: SpatialPartition2D + :param time_interval: (required) + :type time_interval: str + :param spatial_resolution: (required) + :type spatial_resolution: SpatialResolution + :param attributes: (required) + :type attributes: str + :param result_type: (required) + :type result_type: RasterStreamWebsocketResultType + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._raster_stream_websocket_serialize( + id=id, + spatial_bounds=spatial_bounds, + time_interval=time_interval, + spatial_resolution=spatial_resolution, + attributes=attributes, + result_type=result_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('attributes') is not None: # noqa: E501 - _query_params.append(('attributes', _params['attributes'])) + _response_types_map: Dict[str, Optional[str]] = { + '101': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _raster_stream_websocket_serialize( + self, + id, + spatial_bounds, + time_interval, + spatial_resolution, + attributes, + result_type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('result_type') is not None: # noqa: E501 - _query_params.append(('resultType', _params['result_type'].value)) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if spatial_bounds is not None: + + _query_params.append(('spatialBounds', spatial_bounds)) + + if time_interval is not None: + + _query_params.append(('timeInterval', time_interval)) + + if spatial_resolution is not None: + + _query_params.append(('spatialResolution', spatial_resolution)) + + if attributes is not None: + + _query_params.append(('attributes', attributes)) + + if result_type is not None: + + _query_params.append(('resultType', result_type.value)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/workflow/{id}/rasterStream', 'GET', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'session_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/workflow/{id}/rasterStream', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def register_workflow_handler(self, workflow : Workflow, **kwargs) -> AddCollection200Response: # noqa: E501 - """Registers a new Workflow. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def register_workflow_handler( + self, + workflow: Workflow, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AddCollection200Response: + """Registers a new Workflow. - >>> thread = api.register_workflow_handler(workflow, async_req=True) - >>> result = thread.get() :param workflow: (required) :type workflow: Workflow - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AddCollection200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the register_workflow_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.register_workflow_handler_with_http_info(workflow, **kwargs) # noqa: E501 - - @validate_arguments - def register_workflow_handler_with_http_info(self, workflow : Workflow, **kwargs) -> ApiResponse: # noqa: E501 - """Registers a new Workflow. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.register_workflow_handler_with_http_info(workflow, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._register_workflow_handler_serialize( + workflow=workflow, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def register_workflow_handler_with_http_info( + self, + workflow: Workflow, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AddCollection200Response]: + """Registers a new Workflow. + :param workflow: (required) :type workflow: Workflow - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AddCollection200Response, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._register_workflow_handler_serialize( + workflow=workflow, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'workflow' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def register_workflow_handler_without_preload_content( + self, + workflow: Workflow, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Registers a new Workflow. + + + :param workflow: (required) + :type workflow: Workflow + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._register_workflow_handler_serialize( + workflow=workflow, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method register_workflow_handler" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddCollection200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _register_workflow_handler_serialize( + self, + workflow, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['workflow'] is not None: - _body_params = _params['workflow'] + if workflow is not None: + _body_params = workflow + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['session_token'] # noqa: E501 - - _response_types_map = { - '200': "AddCollection200Response", - } + _auth_settings: List[str] = [ + 'session_token' + ] - return self.api_client.call_api( - '/workflow', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/workflow', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python/geoengine_openapi_client/api_client.py b/python/geoengine_openapi_client/api_client.py index dcd4e517..603021e0 100644 --- a/python/geoengine_openapi_client/api_client.py +++ b/python/geoengine_openapi_client/api_client.py @@ -1,3 +1,4 @@ +# coding: utf-8 """ Geo Engine API @@ -12,24 +13,35 @@ """ # noqa: E501 -import atexit import datetime from dateutil.parser import parse +from enum import Enum +import decimal import json import mimetypes -from multiprocessing.pool import ThreadPool import os import re import tempfile from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr from geoengine_openapi_client.configuration import Configuration -from geoengine_openapi_client.api_response import ApiResponse +from geoengine_openapi_client.api_response import ApiResponse, T as ApiResponseT import geoengine_openapi_client.models from geoengine_openapi_client import rest -from geoengine_openapi_client.exceptions import ApiValueError, ApiException - +from geoengine_openapi_client.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] class ApiClient: """Generic API client for OpenAPI client library builds. @@ -45,8 +57,6 @@ class ApiClient: the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ PRIMITIVE_TYPES = (float, bool, bytes, str, int) @@ -58,17 +68,22 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1) -> None: + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -76,32 +91,14 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'geoengine/openapi-client/python/0.0.20' + self.user_agent = 'geoengine/openapi-client/python/0.0.21' self.client_side_validation = configuration.client_side_validation def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -142,13 +139,42 @@ def set_default(cls, default): """ cls._default = default - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_types_map=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -159,14 +185,17 @@ def __call_api( header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -178,22 +207,30 @@ def __call_api( if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth( - header_params, query_params, auth_settings, - resource_path, method, body, - request_auth=_request_auth) + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -202,68 +239,109 @@ def __call_api( # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query(query_params, - collection_formats) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) url += "?" + url_query + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = self.request( + response_data = self.rest_client.request( method, url, - query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + except ApiException as e: - if e.body: - e.body = e.body.decode('utf-8') raise e - self.last_response = response_data - - return_data = None # assuming derialization is not needed - # data needs deserialization or returns HTTP data (deserialized) only - if _preload_content or _return_http_data_only: - response_type = response_types_map.get(str(response_data.status), None) - if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: - # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) - - if response_type == "bytearray": - response_data.data = response_data.data - elif response_data.data is not None: - # Note: fixed handling of empty responses - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - if response_type == "bytearray": - return_data = response_data.data - elif response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return return_data - else: - return ApiResponse(status_code = response_data.status, - data = return_data, - headers = response_data.getheaders(), - raw_data = response_data.data) + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -273,18 +351,26 @@ def sanitize_for_serialization(self, obj): """ if obj is None: return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) - if isinstance(obj, dict): + elif isinstance(obj, dict): obj_dict = obj else: # Convert model obj to dict except @@ -292,30 +378,45 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - obj_dict = obj.to_dict() + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } - def deserialize(self, response, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -332,12 +433,16 @@ def __deserialize(self, data, klass): if isinstance(klass, str): if klass.startswith('List['): - sub_kls = re.match(r'List\[(.*)]', klass).group(1) + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('Dict['): - sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2) + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} @@ -355,141 +460,13 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: return self.__deserialize_model(data, klass) - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_types_map=None, auth_settings=None, - async_req=None, _return_http_data_only=None, - collection_formats=None, _preload_content=True, - _request_timeout=None, _host=None, _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - # Note: remove query string in path part for ogc endpoints - resource_path = resource_path.partition("?")[0] - - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_types_map, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _request_auth) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _request_auth)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.get_request(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.head_request(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.options_request(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.post_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.put_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.patch_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.delete_request(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -497,10 +474,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -527,21 +504,21 @@ def parameters_to_url_query(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: URL query string (e.g. a=Hello%20World&b=123) """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, (int, float)): - v = str(v) + for k, v in params.items() if isinstance(params, dict) else params: if isinstance(v, bool): v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) if isinstance(v, dict): v = json.dumps(v) if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, value) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == 'ssv': delimiter = ' ' @@ -552,44 +529,56 @@ def parameters_to_url_query(self, params, collection_formats): else: # csv is the default delimiter = ',' new_params.append( - (k, delimiter.join(quote(str(value)) for value in v))) + (k, delimiter.join(quote(str(value)) for value in v)) + ) else: new_params.append((k, quote(str(v)))) - return "&".join(["=".join(item) for item in new_params]) + return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files=None): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None for accept in accepts: if re.search('json', accept, re.IGNORECASE): @@ -612,9 +601,16 @@ def select_header_content_type(self, content_types): return content_types[0] - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, - request_auth=None): + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -631,21 +627,36 @@ def update_params_for_auth(self, headers, queries, auth_settings, return if request_auth: - self._apply_auth_params(headers, queries, - resource_path, method, body, - request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, queries, - resource_path, method, body, - auth_setting) - - def _apply_auth_params(self, headers, queries, - resource_path, method, body, - auth_setting): + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: """Updates the request parameters based on a single auth_setting :param headers: Header parameters dict to be updated. @@ -674,6 +685,9 @@ def __deserialize_file(self, response): Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. + handle file downloading + save response body into a tmp file and return the instance + :param response: RESTResponse. :return: file path. """ @@ -683,8 +697,12 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -751,6 +769,24 @@ def __deserialize_datetime(self, string): ) ) + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + def __deserialize_model(self, data, klass): """Deserializes list or dict to model. diff --git a/python/geoengine_openapi_client/api_response.py b/python/geoengine_openapi_client/api_response.py index a0b62b95..9bc7c11f 100644 --- a/python/geoengine_openapi_client/api_response.py +++ b/python/geoengine_openapi_client/api_response.py @@ -1,25 +1,21 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel -class ApiResponse: +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): """ API response object """ - status_code: Optional[StrictInt] = Field(None, description="HTTP status code") - headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers") - data: Optional[Any] = Field(None, description="Deserialized data given the data type") - raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)") + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - def __init__(self, - status_code=None, - headers=None, - data=None, - raw_data=None) -> None: - self.status_code = status_code - self.headers = headers - self.data = data - self.raw_data = raw_data + model_config = { + "arbitrary_types_allowed": True + } diff --git a/python/geoengine_openapi_client/configuration.py b/python/geoengine_openapi_client/configuration.py index d366b32e..96db43ba 100644 --- a/python/geoengine_openapi_client/configuration.py +++ b/python/geoengine_openapi_client/configuration.py @@ -14,12 +14,16 @@ import copy +import http.client as httplib import logging +from logging import FileHandler import multiprocessing import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict +from typing_extensions import NotRequired, Self + import urllib3 -import http.client as httplib JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -27,10 +31,114 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "session_token": BearerFormatAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -53,20 +161,31 @@ class Configuration: values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. :Example: """ - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - access_token=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ) -> None: + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[int] = None, + *, + debug: Optional[bool] = None, + ) -> None: """Constructor """ self._base_path = "http://0.0.0.0:8080/api" if host is None else host @@ -80,6 +199,9 @@ def __init__(self, host=None, self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -117,13 +239,16 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -157,7 +282,7 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ self.proxy_headers = None @@ -166,7 +291,7 @@ def __init__(self, host=None, self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation @@ -184,7 +309,7 @@ def __init__(self, host=None, """date format """ - def __deepcopy__(self, memo): + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: cls = self.__class__ result = cls.__new__(cls) memo[id(self)] = result @@ -198,11 +323,11 @@ def __deepcopy__(self, memo): result.debug = self.debug return result - def __setattr__(self, name, value): + def __setattr__(self, name: str, value: Any) -> None: object.__setattr__(self, name, value) @classmethod - def set_default(cls, default): + def set_default(cls, default: Optional[Self]) -> None: """Set default instance of configuration. It stores default configuration, which can be @@ -213,7 +338,7 @@ def set_default(cls, default): cls._default = default @classmethod - def get_default_copy(cls): + def get_default_copy(cls) -> Self: """Deprecated. Please use `get_default` instead. Deprecated. Please use `get_default` instead. @@ -223,7 +348,7 @@ def get_default_copy(cls): return cls.get_default() @classmethod - def get_default(cls): + def get_default(cls) -> Self: """Return the default configuration. This method returns newly created, based on default constructor, @@ -233,11 +358,11 @@ def get_default(cls): :return: The configuration object. """ if cls._default is None: - cls._default = Configuration() + cls._default = cls() return cls._default @property - def logger_file(self): + def logger_file(self) -> Optional[str]: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -249,7 +374,7 @@ def logger_file(self): return self.__logger_file @logger_file.setter - def logger_file(self, value): + def logger_file(self, value: Optional[str]) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -268,7 +393,7 @@ def logger_file(self, value): logger.addHandler(self.logger_file_handler) @property - def debug(self): + def debug(self) -> bool: """Debug status :param value: The debug status, True or False. @@ -277,7 +402,7 @@ def debug(self): return self.__debug @debug.setter - def debug(self, value): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. @@ -299,7 +424,7 @@ def debug(self, value): httplib.HTTPConnection.debuglevel = 0 @property - def logger_format(self): + def logger_format(self) -> str: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -310,7 +435,7 @@ def logger_format(self): return self.__logger_format @logger_format.setter - def logger_format(self, value): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -321,7 +446,7 @@ def logger_format(self, value): self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier, alias=None): + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. @@ -338,7 +463,9 @@ def get_api_key_with_prefix(self, identifier, alias=None): else: return key - def get_basic_auth_token(self): + return None + + def get_basic_auth_token(self) -> Optional[str]: """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. @@ -353,12 +480,12 @@ def get_basic_auth_token(self): basic_auth=username + ':' + password ).get('authorization') - def auth_settings(self): + def auth_settings(self)-> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - auth = {} + auth: AuthSettings = {} if self.access_token is not None: auth['session_token'] = { 'type': 'bearer', @@ -369,7 +496,7 @@ def auth_settings(self): } return auth - def to_debug_report(self): + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -378,10 +505,10 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 0.8.0\n"\ - "SDK Package Version: 0.0.20".\ + "SDK Package Version: 0.0.21".\ format(env=sys.platform, pyversion=sys.version) - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -393,7 +520,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -433,12 +565,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/python/geoengine_openapi_client/exceptions.py b/python/geoengine_openapi_client/exceptions.py index 0bfb70c2..8d35d172 100644 --- a/python/geoengine_openapi_client/exceptions.py +++ b/python/geoengine_openapi_client/exceptions.py @@ -12,6 +12,8 @@ Do not edit the class manually. """ # noqa: E501 +from typing import Any, Optional +from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -102,17 +104,63 @@ def __init__(self, msg, path_to_item=None) -> None: class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None) -> None: + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" @@ -128,38 +176,40 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message + class BadRequestException(ApiException): + pass - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(BadRequestException, self).__init__(status, reason, http_resp) class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(NotFoundException, self).__init__(status, reason, http_resp) + pass class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(UnauthorizedException, self).__init__(status, reason, http_resp) + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(ServiceException, self).__init__(status, reason, http_resp) +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass def render_path(path_to_item): diff --git a/python/geoengine_openapi_client/models/__init__.py b/python/geoengine_openapi_client/models/__init__.py index 1fd35d8b..a9dca166 100644 --- a/python/geoengine_openapi_client/models/__init__.py +++ b/python/geoengine_openapi_client/models/__init__.py @@ -79,6 +79,7 @@ from geoengine_openapi_client.models.get_map_exception_format import GetMapExceptionFormat from geoengine_openapi_client.models.get_map_format import GetMapFormat from geoengine_openapi_client.models.get_map_request import GetMapRequest +from geoengine_openapi_client.models.inline_object import InlineObject from geoengine_openapi_client.models.internal_data_id import InternalDataId from geoengine_openapi_client.models.layer import Layer from geoengine_openapi_client.models.layer_collection import LayerCollection diff --git a/python/geoengine_openapi_client/models/add_collection200_response.py b/python/geoengine_openapi_client/models/add_collection200_response.py index 28749996..680651bb 100644 --- a/python/geoengine_openapi_client/models/add_collection200_response.py +++ b/python/geoengine_openapi_client/models/add_collection200_response.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class AddCollection200Response(BaseModel): """ AddCollection200Response - """ - id: StrictStr = Field(...) - __properties = ["id"] + """ # noqa: E501 + id: StrictStr + __properties: ClassVar[List[str]] = ["id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> AddCollection200Response: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AddCollection200Response 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) + 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: dict) -> AddCollection200Response: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AddCollection200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AddCollection200Response.parse_obj(obj) + return cls.model_validate(obj) - _obj = AddCollection200Response.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id") }) return _obj diff --git a/python/geoengine_openapi_client/models/add_dataset.py b/python/geoengine_openapi_client/models/add_dataset.py index 8bafb4d5..822ace9f 100644 --- a/python/geoengine_openapi_client/models/add_dataset.py +++ b/python/geoengine_openapi_client/models/add_dataset.py @@ -18,97 +18,113 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.provenance import Provenance from geoengine_openapi_client.models.symbology import Symbology +from typing import Optional, Set +from typing_extensions import Self class AddDataset(BaseModel): """ AddDataset - """ - description: StrictStr = Field(...) - display_name: StrictStr = Field(..., alias="displayName") + """ # noqa: E501 + description: StrictStr + display_name: StrictStr = Field(alias="displayName") name: Optional[StrictStr] = None - provenance: Optional[conlist(Provenance)] = None - source_operator: StrictStr = Field(..., alias="sourceOperator") + provenance: Optional[List[Provenance]] = None + source_operator: StrictStr = Field(alias="sourceOperator") symbology: Optional[Symbology] = None - tags: Optional[conlist(StrictStr)] = None - __properties = ["description", "displayName", "name", "provenance", "sourceOperator", "symbology", "tags"] + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["description", "displayName", "name", "provenance", "sourceOperator", "symbology", "tags"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> AddDataset: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AddDataset 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in provenance (list) _items = [] if self.provenance: - for _item in self.provenance: - if _item: - _items.append(_item.to_dict()) + for _item_provenance in self.provenance: + if _item_provenance: + _items.append(_item_provenance.to_dict()) _dict['provenance'] = _items # override the default output from pydantic by calling `to_dict()` of symbology if self.symbology: _dict['symbology'] = self.symbology.to_dict() # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if provenance (nullable) is None - # and __fields_set__ contains the field - if self.provenance is None and "provenance" in self.__fields_set__: + # and model_fields_set contains the field + if self.provenance is None and "provenance" in self.model_fields_set: _dict['provenance'] = None # 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__: + # and model_fields_set contains the field + if self.symbology is None and "symbology" in self.model_fields_set: _dict['symbology'] = None # set to None if tags (nullable) is None - # and __fields_set__ contains the field - if self.tags is None and "tags" in self.__fields_set__: + # and model_fields_set contains the field + if self.tags is None and "tags" in self.model_fields_set: _dict['tags'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AddDataset: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AddDataset from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AddDataset.parse_obj(obj) + return cls.model_validate(obj) - _obj = AddDataset.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), - "display_name": obj.get("displayName"), + "displayName": obj.get("displayName"), "name": obj.get("name"), - "provenance": [Provenance.from_dict(_item) for _item in obj.get("provenance")] if obj.get("provenance") is not None else None, - "source_operator": obj.get("sourceOperator"), - "symbology": Symbology.from_dict(obj.get("symbology")) if obj.get("symbology") is not None else None, + "provenance": [Provenance.from_dict(_item) for _item in obj["provenance"]] if obj.get("provenance") is not None else None, + "sourceOperator": obj.get("sourceOperator"), + "symbology": Symbology.from_dict(obj["symbology"]) if obj.get("symbology") is not None else None, "tags": obj.get("tags") }) return _obj diff --git a/python/geoengine_openapi_client/models/add_layer.py b/python/geoengine_openapi_client/models/add_layer.py index 8a2d48fc..77f4f519 100644 --- a/python/geoengine_openapi_client/models/add_layer.py +++ b/python/geoengine_openapi_client/models/add_layer.py @@ -18,48 +18,65 @@ import re # noqa: F401 import json - -from typing import Dict, List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.symbology import Symbology from geoengine_openapi_client.models.workflow import Workflow +from typing import Optional, Set +from typing_extensions import Self class AddLayer(BaseModel): """ AddLayer - """ - 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") + """ # noqa: E501 + description: StrictStr + metadata: Optional[Dict[str, StrictStr]] = Field(default=None, description="metadata used for loading the data") + name: StrictStr + properties: Optional[List[Annotated[List[StrictStr], Field(min_length=2, max_length=2)]]] = Field(default=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"] + workflow: Workflow + __properties: ClassVar[List[str]] = ["description", "metadata", "name", "properties", "symbology", "workflow"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> AddLayer: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AddLayer 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of symbology if self.symbology: _dict['symbology'] = self.symbology.to_dict() @@ -67,28 +84,28 @@ def to_dict(self): 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__: + # and model_fields_set contains the field + if self.symbology is None and "symbology" in self.model_fields_set: _dict['symbology'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AddLayer: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AddLayer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AddLayer.parse_obj(obj) + return cls.model_validate(obj) - _obj = AddLayer.parse_obj({ + _obj = cls.model_validate({ "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 + "symbology": Symbology.from_dict(obj["symbology"]) if obj.get("symbology") is not None else None, + "workflow": Workflow.from_dict(obj["workflow"]) if obj.get("workflow") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/add_layer_collection.py b/python/geoengine_openapi_client/models/add_layer_collection.py index 0d8009c8..51901c28 100644 --- a/python/geoengine_openapi_client/models/add_layer_collection.py +++ b/python/geoengine_openapi_client/models/add_layer_collection.py @@ -18,55 +18,72 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class AddLayerCollection(BaseModel): """ AddLayerCollection - """ - description: StrictStr = Field(...) - name: StrictStr = Field(...) - properties: Optional[conlist(conlist(StrictStr, max_items=2, min_items=2))] = None - __properties = ["description", "name", "properties"] + """ # noqa: E501 + description: StrictStr + name: StrictStr + properties: Optional[List[Annotated[List[StrictStr], Field(min_length=2, max_length=2)]]] = None + __properties: ClassVar[List[str]] = ["description", "name", "properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> AddLayerCollection: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AddLayerCollection 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) + 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: dict) -> AddLayerCollection: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AddLayerCollection from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AddLayerCollection.parse_obj(obj) + return cls.model_validate(obj) - _obj = AddLayerCollection.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), "name": obj.get("name"), "properties": obj.get("properties") diff --git a/python/geoengine_openapi_client/models/add_role.py b/python/geoengine_openapi_client/models/add_role.py index eab22528..a87f302a 100644 --- a/python/geoengine_openapi_client/models/add_role.py +++ b/python/geoengine_openapi_client/models/add_role.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class AddRole(BaseModel): """ AddRole - """ - name: StrictStr = Field(...) - __properties = ["name"] + """ # noqa: E501 + name: StrictStr + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> AddRole: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AddRole 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) + 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: dict) -> AddRole: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AddRole from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AddRole.parse_obj(obj) + return cls.model_validate(obj) - _obj = AddRole.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name") }) return _obj diff --git a/python/geoengine_openapi_client/models/auth_code_request_url.py b/python/geoengine_openapi_client/models/auth_code_request_url.py index 0e93ad71..169271ba 100644 --- a/python/geoengine_openapi_client/models/auth_code_request_url.py +++ b/python/geoengine_openapi_client/models/auth_code_request_url.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class AuthCodeRequestURL(BaseModel): """ AuthCodeRequestURL - """ - url: StrictStr = Field(...) - __properties = ["url"] + """ # noqa: E501 + url: StrictStr + __properties: ClassVar[List[str]] = ["url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> AuthCodeRequestURL: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AuthCodeRequestURL 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) + 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: dict) -> AuthCodeRequestURL: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AuthCodeRequestURL from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AuthCodeRequestURL.parse_obj(obj) + return cls.model_validate(obj) - _obj = AuthCodeRequestURL.parse_obj({ + _obj = cls.model_validate({ "url": obj.get("url") }) return _obj diff --git a/python/geoengine_openapi_client/models/auth_code_response.py b/python/geoengine_openapi_client/models/auth_code_response.py index 3834ea0e..b71cd352 100644 --- a/python/geoengine_openapi_client/models/auth_code_response.py +++ b/python/geoengine_openapi_client/models/auth_code_response.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +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 AuthCodeResponse(BaseModel): """ AuthCodeResponse - """ - code: StrictStr = Field(...) - session_state: StrictStr = Field(..., alias="sessionState") - state: StrictStr = Field(...) - __properties = ["code", "sessionState", "state"] + """ # noqa: E501 + code: StrictStr + session_state: StrictStr = Field(alias="sessionState") + state: StrictStr + __properties: ClassVar[List[str]] = ["code", "sessionState", "state"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> AuthCodeResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AuthCodeResponse 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) + 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: dict) -> AuthCodeResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AuthCodeResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AuthCodeResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = AuthCodeResponse.parse_obj({ + _obj = cls.model_validate({ "code": obj.get("code"), - "session_state": obj.get("sessionState"), + "sessionState": obj.get("sessionState"), "state": obj.get("state") }) return _obj diff --git a/python/geoengine_openapi_client/models/auto_create_dataset.py b/python/geoengine_openapi_client/models/auto_create_dataset.py index 565f698a..953b9737 100644 --- a/python/geoengine_openapi_client/models/auto_create_dataset.py +++ b/python/geoengine_openapi_client/models/auto_create_dataset.py @@ -18,72 +18,88 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +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 AutoCreateDataset(BaseModel): """ AutoCreateDataset - """ - dataset_description: StrictStr = Field(..., alias="datasetDescription") - dataset_name: StrictStr = Field(..., alias="datasetName") - layer_name: Optional[StrictStr] = Field(None, alias="layerName") - main_file: StrictStr = Field(..., alias="mainFile") - tags: Optional[conlist(StrictStr)] = None - upload: StrictStr = Field(...) - __properties = ["datasetDescription", "datasetName", "layerName", "mainFile", "tags", "upload"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + dataset_description: StrictStr = Field(alias="datasetDescription") + dataset_name: StrictStr = Field(alias="datasetName") + layer_name: Optional[StrictStr] = Field(default=None, alias="layerName") + main_file: StrictStr = Field(alias="mainFile") + tags: Optional[List[StrictStr]] = None + upload: StrictStr + __properties: ClassVar[List[str]] = ["datasetDescription", "datasetName", "layerName", "mainFile", "tags", "upload"] + + 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.dict(by_alias=True)) + 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) -> AutoCreateDataset: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AutoCreateDataset 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) + 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 layer_name (nullable) is None - # and __fields_set__ contains the field - if self.layer_name is None and "layer_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.layer_name is None and "layer_name" in self.model_fields_set: _dict['layerName'] = None # set to None if tags (nullable) is None - # and __fields_set__ contains the field - if self.tags is None and "tags" in self.__fields_set__: + # and model_fields_set contains the field + if self.tags is None and "tags" in self.model_fields_set: _dict['tags'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AutoCreateDataset: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AutoCreateDataset from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AutoCreateDataset.parse_obj(obj) + return cls.model_validate(obj) - _obj = AutoCreateDataset.parse_obj({ - "dataset_description": obj.get("datasetDescription"), - "dataset_name": obj.get("datasetName"), - "layer_name": obj.get("layerName"), - "main_file": obj.get("mainFile"), + _obj = cls.model_validate({ + "datasetDescription": obj.get("datasetDescription"), + "datasetName": obj.get("datasetName"), + "layerName": obj.get("layerName"), + "mainFile": obj.get("mainFile"), "tags": obj.get("tags"), "upload": obj.get("upload") }) diff --git a/python/geoengine_openapi_client/models/axis_order.py b/python/geoengine_openapi_client/models/axis_order.py index b7ca6deb..15ec675e 100644 --- a/python/geoengine_openapi_client/models/axis_order.py +++ b/python/geoengine_openapi_client/models/axis_order.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class AxisOrder(str, Enum): @@ -34,8 +31,8 @@ class AxisOrder(str, Enum): EASTNORTH = 'eastNorth' @classmethod - def from_json(cls, json_str: str) -> AxisOrder: + def from_json(cls, json_str: str) -> Self: """Create an instance of AxisOrder from a JSON string""" - return AxisOrder(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/bounding_box2_d.py b/python/geoengine_openapi_client/models/bounding_box2_d.py index 281c51b9..542d384e 100644 --- a/python/geoengine_openapi_client/models/bounding_box2_d.py +++ b/python/geoengine_openapi_client/models/bounding_box2_d.py @@ -18,43 +18,59 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.coordinate2_d import Coordinate2D +from typing import Optional, Set +from typing_extensions import Self class BoundingBox2D(BaseModel): """ - A bounding box that includes all border points. Note: may degenerate to a point! # noqa: E501 - """ - lower_left_coordinate: Coordinate2D = Field(..., alias="lowerLeftCoordinate") - upper_right_coordinate: Coordinate2D = Field(..., alias="upperRightCoordinate") - __properties = ["lowerLeftCoordinate", "upperRightCoordinate"] + A bounding box that includes all border points. Note: may degenerate to a point! + """ # noqa: E501 + lower_left_coordinate: Coordinate2D = Field(alias="lowerLeftCoordinate") + upper_right_coordinate: Coordinate2D = Field(alias="upperRightCoordinate") + __properties: ClassVar[List[str]] = ["lowerLeftCoordinate", "upperRightCoordinate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> BoundingBox2D: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of BoundingBox2D 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of lower_left_coordinate if self.lower_left_coordinate: _dict['lowerLeftCoordinate'] = self.lower_left_coordinate.to_dict() @@ -64,17 +80,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> BoundingBox2D: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of BoundingBox2D from a dict""" if obj is None: return None if not isinstance(obj, dict): - return BoundingBox2D.parse_obj(obj) + return cls.model_validate(obj) - _obj = BoundingBox2D.parse_obj({ - "lower_left_coordinate": Coordinate2D.from_dict(obj.get("lowerLeftCoordinate")) if obj.get("lowerLeftCoordinate") is not None else None, - "upper_right_coordinate": Coordinate2D.from_dict(obj.get("upperRightCoordinate")) if obj.get("upperRightCoordinate") is not None else None + _obj = cls.model_validate({ + "lowerLeftCoordinate": Coordinate2D.from_dict(obj["lowerLeftCoordinate"]) if obj.get("lowerLeftCoordinate") is not None else None, + "upperRightCoordinate": Coordinate2D.from_dict(obj["upperRightCoordinate"]) if obj.get("upperRightCoordinate") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/breakpoint.py b/python/geoengine_openapi_client/models/breakpoint.py index da4df929..2e8874fd 100644 --- a/python/geoengine_openapi_client/models/breakpoint.py +++ b/python/geoengine_openapi_client/models/breakpoint.py @@ -18,54 +18,71 @@ import re # noqa: F401 import json - -from typing import List, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Breakpoint(BaseModel): """ Breakpoint - """ - color: conlist(StrictInt, max_items=4, min_items=4) = Field(...) - value: Union[StrictFloat, StrictInt] = Field(...) - __properties = ["color", "value"] + """ # noqa: E501 + color: Annotated[List[StrictInt], Field(min_length=4, max_length=4)] + value: Union[StrictFloat, StrictInt] + __properties: ClassVar[List[str]] = ["color", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> Breakpoint: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Breakpoint 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) + 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: dict) -> Breakpoint: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Breakpoint from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Breakpoint.parse_obj(obj) + return cls.model_validate(obj) - _obj = Breakpoint.parse_obj({ + _obj = cls.model_validate({ "color": obj.get("color"), "value": obj.get("value") }) diff --git a/python/geoengine_openapi_client/models/classification_measurement.py b/python/geoengine_openapi_client/models/classification_measurement.py index 1fdf5188..1a685074 100644 --- a/python/geoengine_openapi_client/models/classification_measurement.py +++ b/python/geoengine_openapi_client/models/classification_measurement.py @@ -18,62 +18,78 @@ import re # noqa: F401 import json - -from typing import Dict -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ClassificationMeasurement(BaseModel): """ ClassificationMeasurement - """ - classes: Dict[str, StrictStr] = Field(...) - measurement: StrictStr = Field(...) - type: StrictStr = Field(...) - __properties = ["classes", "measurement", "type"] + """ # noqa: E501 + classes: Dict[str, StrictStr] + measurement: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["classes", "measurement", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('classification'): + if value not in set(['classification']): raise ValueError("must be one of enum values ('classification')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> ClassificationMeasurement: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ClassificationMeasurement 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) + 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: dict) -> ClassificationMeasurement: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ClassificationMeasurement from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ClassificationMeasurement.parse_obj(obj) + return cls.model_validate(obj) - _obj = ClassificationMeasurement.parse_obj({ + _obj = cls.model_validate({ "classes": obj.get("classes"), "measurement": obj.get("measurement"), "type": obj.get("type") diff --git a/python/geoengine_openapi_client/models/collection_item.py b/python/geoengine_openapi_client/models/collection_item.py index 00c2c6f8..7a4b4c1a 100644 --- a/python/geoengine_openapi_client/models/collection_item.py +++ b/python/geoengine_openapi_client/models/collection_item.py @@ -14,17 +14,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.layer_collection_listing import LayerCollectionListing from geoengine_openapi_client.models.layer_listing import LayerListing -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self COLLECTIONITEM_ONE_OF_SCHEMAS = ["LayerCollectionListing", "LayerListing"] @@ -36,16 +34,16 @@ class CollectionItem(BaseModel): oneof_schema_1_validator: Optional[LayerCollectionListing] = None # data type: LayerListing oneof_schema_2_validator: Optional[LayerListing] = None - if TYPE_CHECKING: - actual_instance: Union[LayerCollectionListing, LayerListing] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(COLLECTIONITEM_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[LayerCollectionListing, LayerListing]] = None + one_of_schemas: Set[str] = { "LayerCollectionListing", "LayerListing" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -58,9 +56,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = CollectionItem.construct() + instance = CollectionItem.model_construct() error_messages = [] match = 0 # validate data type: LayerCollectionListing @@ -83,13 +81,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> CollectionItem: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> CollectionItem: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = CollectionItem.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -99,22 +97,22 @@ def from_json(cls, json_str: str) -> CollectionItem: raise ValueError("Failed to lookup data type from the field `type` in the input.") # check if data type is `LayerCollectionListing` - if _data_type == "LayerCollectionListing": + if _data_type == "collection": instance.actual_instance = LayerCollectionListing.from_json(json_str) return instance # check if data type is `LayerListing` - if _data_type == "LayerListing": + if _data_type == "layer": instance.actual_instance = LayerListing.from_json(json_str) return instance # check if data type is `LayerCollectionListing` - if _data_type == "collection": + if _data_type == "LayerCollectionListing": instance.actual_instance = LayerCollectionListing.from_json(json_str) return instance # check if data type is `LayerListing` - if _data_type == "layer": + if _data_type == "LayerListing": instance.actual_instance = LayerListing.from_json(json_str) return instance @@ -145,19 +143,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], LayerCollectionListing, LayerListing]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -165,6 +161,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/collection_type.py b/python/geoengine_openapi_client/models/collection_type.py index 5e3f580b..602c8b8b 100644 --- a/python/geoengine_openapi_client/models/collection_type.py +++ b/python/geoengine_openapi_client/models/collection_type.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class CollectionType(str, Enum): @@ -33,8 +30,8 @@ class CollectionType(str, Enum): FEATURECOLLECTION = 'FeatureCollection' @classmethod - def from_json(cls, json_str: str) -> CollectionType: + def from_json(cls, json_str: str) -> Self: """Create an instance of CollectionType from a JSON string""" - return CollectionType(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/color_param.py b/python/geoengine_openapi_client/models/color_param.py index e7277bc5..c7747c01 100644 --- a/python/geoengine_openapi_client/models/color_param.py +++ b/python/geoengine_openapi_client/models/color_param.py @@ -14,17 +14,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.color_param_static import ColorParamStatic from geoengine_openapi_client.models.derived_color import DerivedColor -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self COLORPARAM_ONE_OF_SCHEMAS = ["ColorParamStatic", "DerivedColor"] @@ -36,16 +34,16 @@ class ColorParam(BaseModel): oneof_schema_1_validator: Optional[ColorParamStatic] = None # data type: DerivedColor oneof_schema_2_validator: Optional[DerivedColor] = None - if TYPE_CHECKING: - actual_instance: Union[ColorParamStatic, DerivedColor] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(COLORPARAM_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[ColorParamStatic, DerivedColor]] = None + one_of_schemas: Set[str] = { "ColorParamStatic", "DerivedColor" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -58,9 +56,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = ColorParam.construct() + instance = ColorParam.model_construct() error_messages = [] match = 0 # validate data type: ColorParamStatic @@ -83,13 +81,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> ColorParam: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> ColorParam: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = ColorParam.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -98,16 +96,6 @@ def from_json(cls, json_str: str) -> ColorParam: if not _data_type: raise ValueError("Failed to lookup data type from the field `type` in the input.") - # check if data type is `ColorParamStatic` - if _data_type == "ColorParamStatic": - instance.actual_instance = ColorParamStatic.from_json(json_str) - return instance - - # check if data type is `DerivedColor` - if _data_type == "DerivedColor": - instance.actual_instance = DerivedColor.from_json(json_str) - return instance - # check if data type is `DerivedColor` if _data_type == "derived": instance.actual_instance = DerivedColor.from_json(json_str) @@ -118,6 +106,16 @@ def from_json(cls, json_str: str) -> ColorParam: instance.actual_instance = ColorParamStatic.from_json(json_str) return instance + # check if data type is `ColorParamStatic` + if _data_type == "ColorParamStatic": + instance.actual_instance = ColorParamStatic.from_json(json_str) + return instance + + # check if data type is `DerivedColor` + if _data_type == "DerivedColor": + instance.actual_instance = DerivedColor.from_json(json_str) + return instance + # deserialize data into ColorParamStatic try: instance.actual_instance = ColorParamStatic.from_json(json_str) @@ -145,19 +143,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], ColorParamStatic, DerivedColor]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -165,6 +161,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/color_param_static.py b/python/geoengine_openapi_client/models/color_param_static.py index 810a351a..a5cd7de6 100644 --- a/python/geoengine_openapi_client/models/color_param_static.py +++ b/python/geoengine_openapi_client/models/color_param_static.py @@ -18,61 +18,78 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class ColorParamStatic(BaseModel): """ ColorParamStatic - """ - color: conlist(StrictInt, max_items=4, min_items=4) = Field(...) - type: StrictStr = Field(...) - __properties = ["color", "type"] + """ # noqa: E501 + color: Annotated[List[StrictInt], Field(min_length=4, max_length=4)] + type: StrictStr + __properties: ClassVar[List[str]] = ["color", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('static', 'derived'): - raise ValueError("must be one of enum values ('static', 'derived')") + if value not in set(['static']): + raise ValueError("must be one of enum values ('static')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> ColorParamStatic: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ColorParamStatic 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) + 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: dict) -> ColorParamStatic: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ColorParamStatic from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ColorParamStatic.parse_obj(obj) + return cls.model_validate(obj) - _obj = ColorParamStatic.parse_obj({ + _obj = cls.model_validate({ "color": obj.get("color"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/colorizer.py b/python/geoengine_openapi_client/models/colorizer.py index 17612998..cd242dba 100644 --- a/python/geoengine_openapi_client/models/colorizer.py +++ b/python/geoengine_openapi_client/models/colorizer.py @@ -14,18 +14,16 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.linear_gradient import LinearGradient from geoengine_openapi_client.models.logarithmic_gradient import LogarithmicGradient from geoengine_openapi_client.models.palette_colorizer import PaletteColorizer -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self COLORIZER_ONE_OF_SCHEMAS = ["LinearGradient", "LogarithmicGradient", "PaletteColorizer"] @@ -39,16 +37,16 @@ class Colorizer(BaseModel): oneof_schema_2_validator: Optional[LogarithmicGradient] = None # data type: PaletteColorizer oneof_schema_3_validator: Optional[PaletteColorizer] = None - if TYPE_CHECKING: - actual_instance: Union[LinearGradient, LogarithmicGradient, PaletteColorizer] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(COLORIZER_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[LinearGradient, LogarithmicGradient, PaletteColorizer]] = None + one_of_schemas: Set[str] = { "LinearGradient", "LogarithmicGradient", "PaletteColorizer" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -61,9 +59,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = Colorizer.construct() + instance = Colorizer.model_construct() error_messages = [] match = 0 # validate data type: LinearGradient @@ -91,13 +89,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> Colorizer: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> Colorizer: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = Colorizer.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -107,32 +105,32 @@ def from_json(cls, json_str: str) -> Colorizer: raise ValueError("Failed to lookup data type from the field `type` in the input.") # check if data type is `LinearGradient` - if _data_type == "LinearGradient": + if _data_type == "linearGradient": instance.actual_instance = LinearGradient.from_json(json_str) return instance # check if data type is `LogarithmicGradient` - if _data_type == "LogarithmicGradient": + if _data_type == "logarithmicGradient": instance.actual_instance = LogarithmicGradient.from_json(json_str) return instance # check if data type is `PaletteColorizer` - if _data_type == "PaletteColorizer": + if _data_type == "palette": instance.actual_instance = PaletteColorizer.from_json(json_str) return instance # check if data type is `LinearGradient` - if _data_type == "linearGradient": + if _data_type == "LinearGradient": instance.actual_instance = LinearGradient.from_json(json_str) return instance # check if data type is `LogarithmicGradient` - if _data_type == "logarithmicGradient": + if _data_type == "LogarithmicGradient": instance.actual_instance = LogarithmicGradient.from_json(json_str) return instance # check if data type is `PaletteColorizer` - if _data_type == "palette": + if _data_type == "PaletteColorizer": instance.actual_instance = PaletteColorizer.from_json(json_str) return instance @@ -169,19 +167,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], LinearGradient, LogarithmicGradient, PaletteColorizer]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -189,6 +185,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/computation_quota.py b/python/geoengine_openapi_client/models/computation_quota.py index faddf435..879e28a3 100644 --- a/python/geoengine_openapi_client/models/computation_quota.py +++ b/python/geoengine_openapi_client/models/computation_quota.py @@ -19,59 +19,77 @@ import json from datetime import datetime - -from pydantic import BaseModel, Field, StrictStr, conint +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class ComputationQuota(BaseModel): """ ComputationQuota - """ - computation_id: StrictStr = Field(..., alias="computationId") - count: conint(strict=True, ge=0) = Field(...) - timestamp: datetime = Field(...) - workflow_id: StrictStr = Field(..., alias="workflowId") - __properties = ["computationId", "count", "timestamp", "workflowId"] + """ # noqa: E501 + computation_id: StrictStr = Field(alias="computationId") + count: Annotated[int, Field(strict=True, ge=0)] + timestamp: datetime + workflow_id: StrictStr = Field(alias="workflowId") + __properties: ClassVar[List[str]] = ["computationId", "count", "timestamp", "workflowId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> ComputationQuota: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ComputationQuota 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) + 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: dict) -> ComputationQuota: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ComputationQuota from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ComputationQuota.parse_obj(obj) + return cls.model_validate(obj) - _obj = ComputationQuota.parse_obj({ - "computation_id": obj.get("computationId"), + _obj = cls.model_validate({ + "computationId": obj.get("computationId"), "count": obj.get("count"), "timestamp": obj.get("timestamp"), - "workflow_id": obj.get("workflowId") + "workflowId": obj.get("workflowId") }) return _obj diff --git a/python/geoengine_openapi_client/models/continuous_measurement.py b/python/geoengine_openapi_client/models/continuous_measurement.py index c3182066..7e931a0d 100644 --- a/python/geoengine_openapi_client/models/continuous_measurement.py +++ b/python/geoengine_openapi_client/models/continuous_measurement.py @@ -18,67 +18,83 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ContinuousMeasurement(BaseModel): """ ContinuousMeasurement - """ - measurement: StrictStr = Field(...) - type: StrictStr = Field(...) + """ # noqa: E501 + measurement: StrictStr + type: StrictStr unit: Optional[StrictStr] = None - __properties = ["measurement", "type", "unit"] + __properties: ClassVar[List[str]] = ["measurement", "type", "unit"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('continuous'): + if value not in set(['continuous']): raise ValueError("must be one of enum values ('continuous')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> ContinuousMeasurement: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ContinuousMeasurement 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) + 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 unit (nullable) is None - # and __fields_set__ contains the field - if self.unit is None and "unit" in self.__fields_set__: + # and model_fields_set contains the field + if self.unit is None and "unit" in self.model_fields_set: _dict['unit'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ContinuousMeasurement: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ContinuousMeasurement from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ContinuousMeasurement.parse_obj(obj) + return cls.model_validate(obj) - _obj = ContinuousMeasurement.parse_obj({ + _obj = cls.model_validate({ "measurement": obj.get("measurement"), "type": obj.get("type"), "unit": obj.get("unit") diff --git a/python/geoengine_openapi_client/models/coordinate2_d.py b/python/geoengine_openapi_client/models/coordinate2_d.py index 0a425ac8..5c5eed3f 100644 --- a/python/geoengine_openapi_client/models/coordinate2_d.py +++ b/python/geoengine_openapi_client/models/coordinate2_d.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - -from typing import Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self class Coordinate2D(BaseModel): """ Coordinate2D - """ - x: Union[StrictFloat, StrictInt] = Field(...) - y: Union[StrictFloat, StrictInt] = Field(...) - __properties = ["x", "y"] + """ # noqa: E501 + x: Union[StrictFloat, StrictInt] + y: Union[StrictFloat, StrictInt] + __properties: ClassVar[List[str]] = ["x", "y"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> Coordinate2D: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Coordinate2D 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) + 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: dict) -> Coordinate2D: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Coordinate2D from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Coordinate2D.parse_obj(obj) + return cls.model_validate(obj) - _obj = Coordinate2D.parse_obj({ + _obj = cls.model_validate({ "x": obj.get("x"), "y": obj.get("y") }) diff --git a/python/geoengine_openapi_client/models/create_dataset.py b/python/geoengine_openapi_client/models/create_dataset.py index 59755cd0..18c896d8 100644 --- a/python/geoengine_openapi_client/models/create_dataset.py +++ b/python/geoengine_openapi_client/models/create_dataset.py @@ -18,44 +18,60 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.data_path import DataPath from geoengine_openapi_client.models.dataset_definition import DatasetDefinition +from typing import Optional, Set +from typing_extensions import Self class CreateDataset(BaseModel): """ CreateDataset - """ - data_path: DataPath = Field(..., alias="dataPath") - definition: DatasetDefinition = Field(...) - __properties = ["dataPath", "definition"] + """ # noqa: E501 + data_path: DataPath = Field(alias="dataPath") + definition: DatasetDefinition + __properties: ClassVar[List[str]] = ["dataPath", "definition"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> CreateDataset: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CreateDataset 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of data_path if self.data_path: _dict['dataPath'] = self.data_path.to_dict() @@ -65,17 +81,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> CreateDataset: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CreateDataset from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CreateDataset.parse_obj(obj) + return cls.model_validate(obj) - _obj = CreateDataset.parse_obj({ - "data_path": DataPath.from_dict(obj.get("dataPath")) if obj.get("dataPath") is not None else None, - "definition": DatasetDefinition.from_dict(obj.get("definition")) if obj.get("definition") is not None else None + _obj = cls.model_validate({ + "dataPath": DataPath.from_dict(obj["dataPath"]) if obj.get("dataPath") is not None else None, + "definition": DatasetDefinition.from_dict(obj["definition"]) if obj.get("definition") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/create_dataset_handler200_response.py b/python/geoengine_openapi_client/models/create_dataset_handler200_response.py index 5cf44243..6e095356 100644 --- a/python/geoengine_openapi_client/models/create_dataset_handler200_response.py +++ b/python/geoengine_openapi_client/models/create_dataset_handler200_response.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +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 CreateDatasetHandler200Response(BaseModel): """ CreateDatasetHandler200Response - """ - dataset_name: StrictStr = Field(..., alias="datasetName") - __properties = ["datasetName"] + """ # noqa: E501 + dataset_name: StrictStr = Field(alias="datasetName") + __properties: ClassVar[List[str]] = ["datasetName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> CreateDatasetHandler200Response: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CreateDatasetHandler200Response 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) + 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: dict) -> CreateDatasetHandler200Response: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CreateDatasetHandler200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CreateDatasetHandler200Response.parse_obj(obj) + return cls.model_validate(obj) - _obj = CreateDatasetHandler200Response.parse_obj({ - "dataset_name": obj.get("datasetName") + _obj = cls.model_validate({ + "datasetName": obj.get("datasetName") }) return _obj diff --git a/python/geoengine_openapi_client/models/create_project.py b/python/geoengine_openapi_client/models/create_project.py index 0a3cf702..f1908bcd 100644 --- a/python/geoengine_openapi_client/models/create_project.py +++ b/python/geoengine_openapi_client/models/create_project.py @@ -18,46 +18,62 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.st_rectangle import STRectangle from geoengine_openapi_client.models.time_step import TimeStep +from typing import Optional, Set +from typing_extensions import Self class CreateProject(BaseModel): """ CreateProject - """ - bounds: STRectangle = Field(...) - description: StrictStr = Field(...) - name: StrictStr = Field(...) - time_step: Optional[TimeStep] = Field(None, alias="timeStep") - __properties = ["bounds", "description", "name", "timeStep"] + """ # noqa: E501 + bounds: STRectangle + description: StrictStr + name: StrictStr + time_step: Optional[TimeStep] = Field(default=None, alias="timeStep") + __properties: ClassVar[List[str]] = ["bounds", "description", "name", "timeStep"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> CreateProject: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CreateProject 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of bounds if self.bounds: _dict['bounds'] = self.bounds.to_dict() @@ -65,26 +81,26 @@ def to_dict(self): if self.time_step: _dict['timeStep'] = self.time_step.to_dict() # set to None if time_step (nullable) is None - # and __fields_set__ contains the field - if self.time_step is None and "time_step" in self.__fields_set__: + # and model_fields_set contains the field + if self.time_step is None and "time_step" in self.model_fields_set: _dict['timeStep'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> CreateProject: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CreateProject from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CreateProject.parse_obj(obj) + return cls.model_validate(obj) - _obj = CreateProject.parse_obj({ - "bounds": STRectangle.from_dict(obj.get("bounds")) if obj.get("bounds") is not None else None, + _obj = cls.model_validate({ + "bounds": STRectangle.from_dict(obj["bounds"]) if obj.get("bounds") is not None else None, "description": obj.get("description"), "name": obj.get("name"), - "time_step": TimeStep.from_dict(obj.get("timeStep")) if obj.get("timeStep") is not None else None + "timeStep": TimeStep.from_dict(obj["timeStep"]) if obj.get("timeStep") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/csv_header.py b/python/geoengine_openapi_client/models/csv_header.py index c4541a8e..149132f0 100644 --- a/python/geoengine_openapi_client/models/csv_header.py +++ b/python/geoengine_openapi_client/models/csv_header.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class CsvHeader(str, Enum): @@ -35,8 +32,8 @@ class CsvHeader(str, Enum): AUTO = 'auto' @classmethod - def from_json(cls, json_str: str) -> CsvHeader: + def from_json(cls, json_str: str) -> Self: """Create an instance of CsvHeader from a JSON string""" - return CsvHeader(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/data_id.py b/python/geoengine_openapi_client/models/data_id.py index 10d22660..e09b8935 100644 --- a/python/geoengine_openapi_client/models/data_id.py +++ b/python/geoengine_openapi_client/models/data_id.py @@ -14,17 +14,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.external_data_id import ExternalDataId from geoengine_openapi_client.models.internal_data_id import InternalDataId -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self DATAID_ONE_OF_SCHEMAS = ["ExternalDataId", "InternalDataId"] @@ -36,16 +34,16 @@ class DataId(BaseModel): oneof_schema_1_validator: Optional[InternalDataId] = None # data type: ExternalDataId oneof_schema_2_validator: Optional[ExternalDataId] = None - if TYPE_CHECKING: - actual_instance: Union[ExternalDataId, InternalDataId] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(DATAID_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[ExternalDataId, InternalDataId]] = None + one_of_schemas: Set[str] = { "ExternalDataId", "InternalDataId" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -58,9 +56,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = DataId.construct() + instance = DataId.model_construct() error_messages = [] match = 0 # validate data type: InternalDataId @@ -83,13 +81,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> DataId: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> DataId: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = DataId.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -99,22 +97,22 @@ def from_json(cls, json_str: str) -> DataId: raise ValueError("Failed to lookup data type from the field `type` in the input.") # check if data type is `ExternalDataId` - if _data_type == "ExternalDataId": + if _data_type == "external": instance.actual_instance = ExternalDataId.from_json(json_str) return instance # check if data type is `InternalDataId` - if _data_type == "InternalDataId": + if _data_type == "internal": instance.actual_instance = InternalDataId.from_json(json_str) return instance # check if data type is `ExternalDataId` - if _data_type == "external": + if _data_type == "ExternalDataId": instance.actual_instance = ExternalDataId.from_json(json_str) return instance # check if data type is `InternalDataId` - if _data_type == "internal": + if _data_type == "InternalDataId": instance.actual_instance = InternalDataId.from_json(json_str) return instance @@ -145,19 +143,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], ExternalDataId, InternalDataId]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -165,6 +161,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/data_path.py b/python/geoengine_openapi_client/models/data_path.py index 7c575994..27906fdf 100644 --- a/python/geoengine_openapi_client/models/data_path.py +++ b/python/geoengine_openapi_client/models/data_path.py @@ -14,17 +14,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.data_path_one_of import DataPathOneOf from geoengine_openapi_client.models.data_path_one_of1 import DataPathOneOf1 -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self DATAPATH_ONE_OF_SCHEMAS = ["DataPathOneOf", "DataPathOneOf1"] @@ -36,14 +34,14 @@ class DataPath(BaseModel): oneof_schema_1_validator: Optional[DataPathOneOf] = None # data type: DataPathOneOf1 oneof_schema_2_validator: Optional[DataPathOneOf1] = None - if TYPE_CHECKING: - actual_instance: Union[DataPathOneOf, DataPathOneOf1] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(DATAPATH_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[DataPathOneOf, DataPathOneOf1]] = None + one_of_schemas: Set[str] = { "DataPathOneOf", "DataPathOneOf1" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True def __init__(self, *args, **kwargs) -> None: if args: @@ -55,9 +53,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = DataPath.construct() + instance = DataPath.model_construct() error_messages = [] match = 0 # validate data type: DataPathOneOf @@ -80,13 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> DataPath: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> DataPath: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = DataPath.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -117,19 +115,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], DataPathOneOf, DataPathOneOf1]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -137,6 +133,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/data_path_one_of.py b/python/geoengine_openapi_client/models/data_path_one_of.py index 78b42641..18fcf369 100644 --- a/python/geoengine_openapi_client/models/data_path_one_of.py +++ b/python/geoengine_openapi_client/models/data_path_one_of.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class DataPathOneOf(BaseModel): """ DataPathOneOf - """ - volume: StrictStr = Field(...) - __properties = ["volume"] + """ # noqa: E501 + volume: StrictStr + __properties: ClassVar[List[str]] = ["volume"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> DataPathOneOf: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of DataPathOneOf 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) + 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: dict) -> DataPathOneOf: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of DataPathOneOf from a dict""" if obj is None: return None if not isinstance(obj, dict): - return DataPathOneOf.parse_obj(obj) + return cls.model_validate(obj) - _obj = DataPathOneOf.parse_obj({ + _obj = cls.model_validate({ "volume": obj.get("volume") }) return _obj diff --git a/python/geoengine_openapi_client/models/data_path_one_of1.py b/python/geoengine_openapi_client/models/data_path_one_of1.py index ec5d149d..f3bbee58 100644 --- a/python/geoengine_openapi_client/models/data_path_one_of1.py +++ b/python/geoengine_openapi_client/models/data_path_one_of1.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class DataPathOneOf1(BaseModel): """ DataPathOneOf1 - """ - upload: StrictStr = Field(...) - __properties = ["upload"] + """ # noqa: E501 + upload: StrictStr + __properties: ClassVar[List[str]] = ["upload"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> DataPathOneOf1: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of DataPathOneOf1 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) + 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: dict) -> DataPathOneOf1: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of DataPathOneOf1 from a dict""" if obj is None: return None if not isinstance(obj, dict): - return DataPathOneOf1.parse_obj(obj) + return cls.model_validate(obj) - _obj = DataPathOneOf1.parse_obj({ + _obj = cls.model_validate({ "upload": obj.get("upload") }) return _obj diff --git a/python/geoengine_openapi_client/models/data_usage.py b/python/geoengine_openapi_client/models/data_usage.py index af2fa72b..e1ae09eb 100644 --- a/python/geoengine_openapi_client/models/data_usage.py +++ b/python/geoengine_openapi_client/models/data_usage.py @@ -19,61 +19,79 @@ import json from datetime import datetime - -from pydantic import BaseModel, Field, StrictStr, conint +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class DataUsage(BaseModel): """ DataUsage - """ - computation_id: StrictStr = Field(..., alias="computationId") - count: conint(strict=True, ge=0) = Field(...) - data: StrictStr = Field(...) - timestamp: datetime = Field(...) - user_id: StrictStr = Field(..., alias="userId") - __properties = ["computationId", "count", "data", "timestamp", "userId"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + computation_id: StrictStr = Field(alias="computationId") + count: Annotated[int, Field(strict=True, ge=0)] + data: StrictStr + timestamp: datetime + user_id: StrictStr = Field(alias="userId") + __properties: ClassVar[List[str]] = ["computationId", "count", "data", "timestamp", "userId"] + + 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.dict(by_alias=True)) + 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) -> DataUsage: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of DataUsage 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) + 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: dict) -> DataUsage: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of DataUsage from a dict""" if obj is None: return None if not isinstance(obj, dict): - return DataUsage.parse_obj(obj) + return cls.model_validate(obj) - _obj = DataUsage.parse_obj({ - "computation_id": obj.get("computationId"), + _obj = cls.model_validate({ + "computationId": obj.get("computationId"), "count": obj.get("count"), "data": obj.get("data"), "timestamp": obj.get("timestamp"), - "user_id": obj.get("userId") + "userId": obj.get("userId") }) return _obj diff --git a/python/geoengine_openapi_client/models/data_usage_summary.py b/python/geoengine_openapi_client/models/data_usage_summary.py index a2abbbd2..fc232191 100644 --- a/python/geoengine_openapi_client/models/data_usage_summary.py +++ b/python/geoengine_openapi_client/models/data_usage_summary.py @@ -19,54 +19,72 @@ import json from datetime import datetime - -from pydantic import BaseModel, Field, StrictStr, conint +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class DataUsageSummary(BaseModel): """ DataUsageSummary - """ - count: conint(strict=True, ge=0) = Field(...) - data: StrictStr = Field(...) - timestamp: datetime = Field(...) - __properties = ["count", "data", "timestamp"] + """ # noqa: E501 + count: Annotated[int, Field(strict=True, ge=0)] + data: StrictStr + timestamp: datetime + __properties: ClassVar[List[str]] = ["count", "data", "timestamp"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> DataUsageSummary: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of DataUsageSummary 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) + 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: dict) -> DataUsageSummary: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of DataUsageSummary from a dict""" if obj is None: return None if not isinstance(obj, dict): - return DataUsageSummary.parse_obj(obj) + return cls.model_validate(obj) - _obj = DataUsageSummary.parse_obj({ + _obj = cls.model_validate({ "count": obj.get("count"), "data": obj.get("data"), "timestamp": obj.get("timestamp") diff --git a/python/geoengine_openapi_client/models/dataset.py b/python/geoengine_openapi_client/models/dataset.py index f93cf589..5637b012 100644 --- a/python/geoengine_openapi_client/models/dataset.py +++ b/python/geoengine_openapi_client/models/dataset.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.provenance import Provenance from geoengine_openapi_client.models.symbology import Symbology from geoengine_openapi_client.models.typed_result_descriptor import TypedResultDescriptor +from typing import Optional, Set +from typing_extensions import Self class Dataset(BaseModel): """ Dataset - """ - description: StrictStr = Field(...) - display_name: StrictStr = Field(..., alias="displayName") - id: StrictStr = Field(...) - name: StrictStr = Field(...) - provenance: Optional[conlist(Provenance)] = None - result_descriptor: TypedResultDescriptor = Field(..., alias="resultDescriptor") - source_operator: StrictStr = Field(..., alias="sourceOperator") + """ # noqa: E501 + description: StrictStr + display_name: StrictStr = Field(alias="displayName") + id: StrictStr + name: StrictStr + provenance: Optional[List[Provenance]] = None + result_descriptor: TypedResultDescriptor = Field(alias="resultDescriptor") + source_operator: StrictStr = Field(alias="sourceOperator") symbology: Optional[Symbology] = None - tags: Optional[conlist(StrictStr)] = None - __properties = ["description", "displayName", "id", "name", "provenance", "resultDescriptor", "sourceOperator", "symbology", "tags"] + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["description", "displayName", "id", "name", "provenance", "resultDescriptor", "sourceOperator", "symbology", "tags"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> Dataset: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Dataset 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in provenance (list) _items = [] if self.provenance: - for _item in self.provenance: - if _item: - _items.append(_item.to_dict()) + for _item_provenance in self.provenance: + if _item_provenance: + _items.append(_item_provenance.to_dict()) _dict['provenance'] = _items # override the default output from pydantic by calling `to_dict()` of result_descriptor if self.result_descriptor: @@ -78,40 +94,40 @@ def to_dict(self): if self.symbology: _dict['symbology'] = self.symbology.to_dict() # set to None if provenance (nullable) is None - # and __fields_set__ contains the field - if self.provenance is None and "provenance" in self.__fields_set__: + # and model_fields_set contains the field + if self.provenance is None and "provenance" in self.model_fields_set: _dict['provenance'] = None # 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__: + # and model_fields_set contains the field + if self.symbology is None and "symbology" in self.model_fields_set: _dict['symbology'] = None # set to None if tags (nullable) is None - # and __fields_set__ contains the field - if self.tags is None and "tags" in self.__fields_set__: + # and model_fields_set contains the field + if self.tags is None and "tags" in self.model_fields_set: _dict['tags'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Dataset: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Dataset from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Dataset.parse_obj(obj) + return cls.model_validate(obj) - _obj = Dataset.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), - "display_name": obj.get("displayName"), + "displayName": obj.get("displayName"), "id": obj.get("id"), "name": obj.get("name"), - "provenance": [Provenance.from_dict(_item) for _item in obj.get("provenance")] if obj.get("provenance") is not None else None, - "result_descriptor": TypedResultDescriptor.from_dict(obj.get("resultDescriptor")) if obj.get("resultDescriptor") is not None else None, - "source_operator": obj.get("sourceOperator"), - "symbology": Symbology.from_dict(obj.get("symbology")) if obj.get("symbology") is not None else None, + "provenance": [Provenance.from_dict(_item) for _item in obj["provenance"]] if obj.get("provenance") is not None else None, + "resultDescriptor": TypedResultDescriptor.from_dict(obj["resultDescriptor"]) if obj.get("resultDescriptor") is not None else None, + "sourceOperator": obj.get("sourceOperator"), + "symbology": Symbology.from_dict(obj["symbology"]) if obj.get("symbology") is not None else None, "tags": obj.get("tags") }) return _obj diff --git a/python/geoengine_openapi_client/models/dataset_definition.py b/python/geoengine_openapi_client/models/dataset_definition.py index a831d24f..3fbe5829 100644 --- a/python/geoengine_openapi_client/models/dataset_definition.py +++ b/python/geoengine_openapi_client/models/dataset_definition.py @@ -18,44 +18,60 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.add_dataset import AddDataset from geoengine_openapi_client.models.meta_data_definition import MetaDataDefinition +from typing import Optional, Set +from typing_extensions import Self class DatasetDefinition(BaseModel): """ DatasetDefinition - """ - meta_data: MetaDataDefinition = Field(..., alias="metaData") - properties: AddDataset = Field(...) - __properties = ["metaData", "properties"] + """ # noqa: E501 + meta_data: MetaDataDefinition = Field(alias="metaData") + properties: AddDataset + __properties: ClassVar[List[str]] = ["metaData", "properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> DatasetDefinition: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of DatasetDefinition 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of meta_data if self.meta_data: _dict['metaData'] = self.meta_data.to_dict() @@ -65,17 +81,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> DatasetDefinition: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of DatasetDefinition from a dict""" if obj is None: return None if not isinstance(obj, dict): - return DatasetDefinition.parse_obj(obj) + return cls.model_validate(obj) - _obj = DatasetDefinition.parse_obj({ - "meta_data": MetaDataDefinition.from_dict(obj.get("metaData")) if obj.get("metaData") is not None else None, - "properties": AddDataset.from_dict(obj.get("properties")) if obj.get("properties") is not None else None + _obj = cls.model_validate({ + "metaData": MetaDataDefinition.from_dict(obj["metaData"]) if obj.get("metaData") is not None else None, + "properties": AddDataset.from_dict(obj["properties"]) if obj.get("properties") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/dataset_listing.py b/python/geoengine_openapi_client/models/dataset_listing.py index 7a81474e..1b0142d9 100644 --- a/python/geoengine_openapi_client/models/dataset_listing.py +++ b/python/geoengine_openapi_client/models/dataset_listing.py @@ -18,50 +18,66 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.symbology import Symbology from geoengine_openapi_client.models.typed_result_descriptor import TypedResultDescriptor +from typing import Optional, Set +from typing_extensions import Self class DatasetListing(BaseModel): """ DatasetListing - """ - description: StrictStr = Field(...) - display_name: StrictStr = Field(..., alias="displayName") - id: StrictStr = Field(...) - name: StrictStr = Field(...) - result_descriptor: TypedResultDescriptor = Field(..., alias="resultDescriptor") - source_operator: StrictStr = Field(..., alias="sourceOperator") + """ # noqa: E501 + description: StrictStr + display_name: StrictStr = Field(alias="displayName") + id: StrictStr + name: StrictStr + result_descriptor: TypedResultDescriptor = Field(alias="resultDescriptor") + source_operator: StrictStr = Field(alias="sourceOperator") symbology: Optional[Symbology] = None - tags: conlist(StrictStr) = Field(...) - __properties = ["description", "displayName", "id", "name", "resultDescriptor", "sourceOperator", "symbology", "tags"] + tags: List[StrictStr] + __properties: ClassVar[List[str]] = ["description", "displayName", "id", "name", "resultDescriptor", "sourceOperator", "symbology", "tags"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> DatasetListing: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of DatasetListing 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of result_descriptor if self.result_descriptor: _dict['resultDescriptor'] = self.result_descriptor.to_dict() @@ -69,29 +85,29 @@ def to_dict(self): if self.symbology: _dict['symbology'] = self.symbology.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__: + # and model_fields_set contains the field + if self.symbology is None and "symbology" in self.model_fields_set: _dict['symbology'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> DatasetListing: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of DatasetListing from a dict""" if obj is None: return None if not isinstance(obj, dict): - return DatasetListing.parse_obj(obj) + return cls.model_validate(obj) - _obj = DatasetListing.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), - "display_name": obj.get("displayName"), + "displayName": obj.get("displayName"), "id": obj.get("id"), "name": obj.get("name"), - "result_descriptor": TypedResultDescriptor.from_dict(obj.get("resultDescriptor")) if obj.get("resultDescriptor") is not None else None, - "source_operator": obj.get("sourceOperator"), - "symbology": Symbology.from_dict(obj.get("symbology")) if obj.get("symbology") is not None else None, + "resultDescriptor": TypedResultDescriptor.from_dict(obj["resultDescriptor"]) if obj.get("resultDescriptor") is not None else None, + "sourceOperator": obj.get("sourceOperator"), + "symbology": Symbology.from_dict(obj["symbology"]) if obj.get("symbology") is not None else None, "tags": obj.get("tags") }) return _obj diff --git a/python/geoengine_openapi_client/models/dataset_resource.py b/python/geoengine_openapi_client/models/dataset_resource.py index 77140160..50ec4781 100644 --- a/python/geoengine_openapi_client/models/dataset_resource.py +++ b/python/geoengine_openapi_client/models/dataset_resource.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class DatasetResource(BaseModel): """ DatasetResource - """ - id: StrictStr = Field(...) - type: StrictStr = Field(...) - __properties = ["id", "type"] + """ # noqa: E501 + id: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["id", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('dataset'): + if value not in set(['dataset']): raise ValueError("must be one of enum values ('dataset')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> DatasetResource: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of DatasetResource 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) + 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: dict) -> DatasetResource: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of DatasetResource from a dict""" if obj is None: return None if not isinstance(obj, dict): - return DatasetResource.parse_obj(obj) + return cls.model_validate(obj) - _obj = DatasetResource.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/date_time.py b/python/geoengine_openapi_client/models/date_time.py index 5176aaf3..2b8fe41d 100644 --- a/python/geoengine_openapi_client/models/date_time.py +++ b/python/geoengine_openapi_client/models/date_time.py @@ -19,52 +19,69 @@ import json from datetime import datetime - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class DateTime(BaseModel): """ - An object that composes the date and a timestamp with time zone. # noqa: E501 - """ - datetime: datetime = Field(...) - __properties = ["datetime"] + An object that composes the date and a timestamp with time zone. + """ # noqa: E501 + datetime: datetime + __properties: ClassVar[List[str]] = ["datetime"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> DateTime: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of DateTime 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) + 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: dict) -> DateTime: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of DateTime from a dict""" if obj is None: return None if not isinstance(obj, dict): - return DateTime.parse_obj(obj) + return cls.model_validate(obj) - _obj = DateTime.parse_obj({ + _obj = cls.model_validate({ "datetime": obj.get("datetime") }) return _obj diff --git a/python/geoengine_openapi_client/models/derived_color.py b/python/geoengine_openapi_client/models/derived_color.py index cc0b7061..f45cfad3 100644 --- a/python/geoengine_openapi_client/models/derived_color.py +++ b/python/geoengine_openapi_client/models/derived_color.py @@ -18,68 +18,84 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.colorizer import Colorizer +from typing import Optional, Set +from typing_extensions import Self class DerivedColor(BaseModel): """ DerivedColor - """ - attribute: StrictStr = Field(...) - colorizer: Colorizer = Field(...) - type: StrictStr = Field(...) - __properties = ["attribute", "colorizer", "type"] + """ # noqa: E501 + attribute: StrictStr + colorizer: Colorizer + type: StrictStr + __properties: ClassVar[List[str]] = ["attribute", "colorizer", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('derived'): + if value not in set(['derived']): raise ValueError("must be one of enum values ('derived')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> DerivedColor: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of DerivedColor 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of colorizer if self.colorizer: _dict['colorizer'] = self.colorizer.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> DerivedColor: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of DerivedColor from a dict""" if obj is None: return None if not isinstance(obj, dict): - return DerivedColor.parse_obj(obj) + return cls.model_validate(obj) - _obj = DerivedColor.parse_obj({ + _obj = cls.model_validate({ "attribute": obj.get("attribute"), - "colorizer": Colorizer.from_dict(obj.get("colorizer")) if obj.get("colorizer") is not None else None, + "colorizer": Colorizer.from_dict(obj["colorizer"]) if obj.get("colorizer") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/derived_number.py b/python/geoengine_openapi_client/models/derived_number.py index 059d8f45..dd9537f0 100644 --- a/python/geoengine_openapi_client/models/derived_number.py +++ b/python/geoengine_openapi_client/models/derived_number.py @@ -18,65 +18,81 @@ import re # noqa: F401 import json - -from typing import Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self class DerivedNumber(BaseModel): """ DerivedNumber - """ - attribute: StrictStr = Field(...) - default_value: Union[StrictFloat, StrictInt] = Field(..., alias="defaultValue") - factor: Union[StrictFloat, StrictInt] = Field(...) - type: StrictStr = Field(...) - __properties = ["attribute", "defaultValue", "factor", "type"] - - @validator('type') + """ # noqa: E501 + attribute: StrictStr + default_value: Union[StrictFloat, StrictInt] = Field(alias="defaultValue") + factor: Union[StrictFloat, StrictInt] + type: StrictStr + __properties: ClassVar[List[str]] = ["attribute", "defaultValue", "factor", "type"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('derived'): + if value not in set(['derived']): raise ValueError("must be one of enum values ('derived')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> DerivedNumber: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of DerivedNumber 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) + 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: dict) -> DerivedNumber: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of DerivedNumber from a dict""" if obj is None: return None if not isinstance(obj, dict): - return DerivedNumber.parse_obj(obj) + return cls.model_validate(obj) - _obj = DerivedNumber.parse_obj({ + _obj = cls.model_validate({ "attribute": obj.get("attribute"), - "default_value": obj.get("defaultValue"), + "defaultValue": obj.get("defaultValue"), "factor": obj.get("factor"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/describe_coverage_request.py b/python/geoengine_openapi_client/models/describe_coverage_request.py index 91a0efb6..20c93cce 100644 --- a/python/geoengine_openapi_client/models/describe_coverage_request.py +++ b/python/geoengine_openapi_client/models/describe_coverage_request.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class DescribeCoverageRequest(str, Enum): @@ -33,8 +30,8 @@ class DescribeCoverageRequest(str, Enum): DESCRIBECOVERAGE = 'DescribeCoverage' @classmethod - def from_json(cls, json_str: str) -> DescribeCoverageRequest: + def from_json(cls, json_str: str) -> Self: """Create an instance of DescribeCoverageRequest from a JSON string""" - return DescribeCoverageRequest(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/error_response.py b/python/geoengine_openapi_client/models/error_response.py index cfe5386e..0fce584d 100644 --- a/python/geoengine_openapi_client/models/error_response.py +++ b/python/geoengine_openapi_client/models/error_response.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ErrorResponse(BaseModel): """ ErrorResponse - """ - error: StrictStr = Field(...) - message: StrictStr = Field(...) - __properties = ["error", "message"] + """ # noqa: E501 + error: StrictStr + message: StrictStr + __properties: ClassVar[List[str]] = ["error", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> ErrorResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ErrorResponse 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) + 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: dict) -> ErrorResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ErrorResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ErrorResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = ErrorResponse.parse_obj({ + _obj = cls.model_validate({ "error": obj.get("error"), "message": obj.get("message") }) diff --git a/python/geoengine_openapi_client/models/external_data_id.py b/python/geoengine_openapi_client/models/external_data_id.py index e8d6cc8e..e6614056 100644 --- a/python/geoengine_openapi_client/models/external_data_id.py +++ b/python/geoengine_openapi_client/models/external_data_id.py @@ -18,64 +18,80 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ExternalDataId(BaseModel): """ ExternalDataId - """ - layer_id: StrictStr = Field(..., alias="layerId") - provider_id: StrictStr = Field(..., alias="providerId") - type: StrictStr = Field(...) - __properties = ["layerId", "providerId", "type"] + """ # noqa: E501 + layer_id: StrictStr = Field(alias="layerId") + provider_id: StrictStr = Field(alias="providerId") + type: StrictStr + __properties: ClassVar[List[str]] = ["layerId", "providerId", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('external'): + if value not in set(['external']): raise ValueError("must be one of enum values ('external')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> ExternalDataId: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ExternalDataId 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) + 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: dict) -> ExternalDataId: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ExternalDataId from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ExternalDataId.parse_obj(obj) + return cls.model_validate(obj) - _obj = ExternalDataId.parse_obj({ - "layer_id": obj.get("layerId"), - "provider_id": obj.get("providerId"), + _obj = cls.model_validate({ + "layerId": obj.get("layerId"), + "providerId": obj.get("providerId"), "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/feature_data_type.py b/python/geoengine_openapi_client/models/feature_data_type.py index 3e52f265..26c9e6b3 100644 --- a/python/geoengine_openapi_client/models/feature_data_type.py +++ b/python/geoengine_openapi_client/models/feature_data_type.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class FeatureDataType(str, Enum): @@ -38,8 +35,8 @@ class FeatureDataType(str, Enum): DATETIME = 'dateTime' @classmethod - def from_json(cls, json_str: str) -> FeatureDataType: + def from_json(cls, json_str: str) -> Self: """Create an instance of FeatureDataType from a JSON string""" - return FeatureDataType(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/file_not_found_handling.py b/python/geoengine_openapi_client/models/file_not_found_handling.py index e1da61c4..ef14ea1a 100644 --- a/python/geoengine_openapi_client/models/file_not_found_handling.py +++ b/python/geoengine_openapi_client/models/file_not_found_handling.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class FileNotFoundHandling(str, Enum): @@ -34,8 +31,8 @@ class FileNotFoundHandling(str, Enum): ERROR = 'Error' @classmethod - def from_json(cls, json_str: str) -> FileNotFoundHandling: + def from_json(cls, json_str: str) -> Self: """Create an instance of FileNotFoundHandling from a JSON string""" - return FileNotFoundHandling(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/format_specifics.py b/python/geoengine_openapi_client/models/format_specifics.py index 4fee84d7..782adccb 100644 --- a/python/geoengine_openapi_client/models/format_specifics.py +++ b/python/geoengine_openapi_client/models/format_specifics.py @@ -14,16 +14,14 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.format_specifics_one_of import FormatSpecificsOneOf -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self FORMATSPECIFICS_ONE_OF_SCHEMAS = ["FormatSpecificsOneOf"] @@ -33,14 +31,14 @@ class FormatSpecifics(BaseModel): """ # data type: FormatSpecificsOneOf oneof_schema_1_validator: Optional[FormatSpecificsOneOf] = None - if TYPE_CHECKING: - actual_instance: Union[FormatSpecificsOneOf] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(FORMATSPECIFICS_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[FormatSpecificsOneOf]] = None + one_of_schemas: Set[str] = { "FormatSpecificsOneOf" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True def __init__(self, *args, **kwargs) -> None: if args: @@ -52,9 +50,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = FormatSpecifics.construct() + instance = FormatSpecifics.model_construct() error_messages = [] match = 0 # validate data type: FormatSpecificsOneOf @@ -72,13 +70,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> FormatSpecifics: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> FormatSpecifics: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = FormatSpecifics.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -103,19 +101,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], FormatSpecificsOneOf]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -123,6 +119,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/format_specifics_one_of.py b/python/geoengine_openapi_client/models/format_specifics_one_of.py index d5964ece..356387fc 100644 --- a/python/geoengine_openapi_client/models/format_specifics_one_of.py +++ b/python/geoengine_openapi_client/models/format_specifics_one_of.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.format_specifics_one_of_csv import FormatSpecificsOneOfCsv +from typing import Optional, Set +from typing_extensions import Self class FormatSpecificsOneOf(BaseModel): """ FormatSpecificsOneOf - """ - csv: FormatSpecificsOneOfCsv = Field(...) - __properties = ["csv"] + """ # noqa: E501 + csv: FormatSpecificsOneOfCsv + __properties: ClassVar[List[str]] = ["csv"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> FormatSpecificsOneOf: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of FormatSpecificsOneOf 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of csv if self.csv: _dict['csv'] = self.csv.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> FormatSpecificsOneOf: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of FormatSpecificsOneOf from a dict""" if obj is None: return None if not isinstance(obj, dict): - return FormatSpecificsOneOf.parse_obj(obj) + return cls.model_validate(obj) - _obj = FormatSpecificsOneOf.parse_obj({ - "csv": FormatSpecificsOneOfCsv.from_dict(obj.get("csv")) if obj.get("csv") is not None else None + _obj = cls.model_validate({ + "csv": FormatSpecificsOneOfCsv.from_dict(obj["csv"]) if obj.get("csv") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/format_specifics_one_of_csv.py b/python/geoengine_openapi_client/models/format_specifics_one_of_csv.py index d450b400..14330498 100644 --- a/python/geoengine_openapi_client/models/format_specifics_one_of_csv.py +++ b/python/geoengine_openapi_client/models/format_specifics_one_of_csv.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.csv_header import CsvHeader +from typing import Optional, Set +from typing_extensions import Self class FormatSpecificsOneOfCsv(BaseModel): """ FormatSpecificsOneOfCsv - """ - header: CsvHeader = Field(...) - __properties = ["header"] + """ # noqa: E501 + header: CsvHeader + __properties: ClassVar[List[str]] = ["header"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> FormatSpecificsOneOfCsv: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of FormatSpecificsOneOfCsv 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) + 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: dict) -> FormatSpecificsOneOfCsv: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of FormatSpecificsOneOfCsv from a dict""" if obj is None: return None if not isinstance(obj, dict): - return FormatSpecificsOneOfCsv.parse_obj(obj) + return cls.model_validate(obj) - _obj = FormatSpecificsOneOfCsv.parse_obj({ + _obj = cls.model_validate({ "header": obj.get("header") }) return _obj diff --git a/python/geoengine_openapi_client/models/gdal_dataset_geo_transform.py b/python/geoengine_openapi_client/models/gdal_dataset_geo_transform.py index 65587959..e54e8bc9 100644 --- a/python/geoengine_openapi_client/models/gdal_dataset_geo_transform.py +++ b/python/geoengine_openapi_client/models/gdal_dataset_geo_transform.py @@ -18,62 +18,78 @@ import re # noqa: F401 import json - -from typing import Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union from geoengine_openapi_client.models.coordinate2_d import Coordinate2D +from typing import Optional, Set +from typing_extensions import Self class GdalDatasetGeoTransform(BaseModel): """ GdalDatasetGeoTransform - """ - origin_coordinate: Coordinate2D = Field(..., alias="originCoordinate") - x_pixel_size: Union[StrictFloat, StrictInt] = Field(..., alias="xPixelSize") - y_pixel_size: Union[StrictFloat, StrictInt] = Field(..., alias="yPixelSize") - __properties = ["originCoordinate", "xPixelSize", "yPixelSize"] + """ # noqa: E501 + origin_coordinate: Coordinate2D = Field(alias="originCoordinate") + x_pixel_size: Union[StrictFloat, StrictInt] = Field(alias="xPixelSize") + y_pixel_size: Union[StrictFloat, StrictInt] = Field(alias="yPixelSize") + __properties: ClassVar[List[str]] = ["originCoordinate", "xPixelSize", "yPixelSize"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> GdalDatasetGeoTransform: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GdalDatasetGeoTransform 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of origin_coordinate if self.origin_coordinate: _dict['originCoordinate'] = self.origin_coordinate.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> GdalDatasetGeoTransform: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GdalDatasetGeoTransform from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GdalDatasetGeoTransform.parse_obj(obj) + return cls.model_validate(obj) - _obj = GdalDatasetGeoTransform.parse_obj({ - "origin_coordinate": Coordinate2D.from_dict(obj.get("originCoordinate")) if obj.get("originCoordinate") is not None else None, - "x_pixel_size": obj.get("xPixelSize"), - "y_pixel_size": obj.get("yPixelSize") + _obj = cls.model_validate({ + "originCoordinate": Coordinate2D.from_dict(obj["originCoordinate"]) if obj.get("originCoordinate") is not None else None, + "xPixelSize": obj.get("xPixelSize"), + "yPixelSize": obj.get("yPixelSize") }) return _obj diff --git a/python/geoengine_openapi_client/models/gdal_dataset_parameters.py b/python/geoengine_openapi_client/models/gdal_dataset_parameters.py index 793f5f0b..6d0686d7 100644 --- a/python/geoengine_openapi_client/models/gdal_dataset_parameters.py +++ b/python/geoengine_openapi_client/models/gdal_dataset_parameters.py @@ -18,106 +18,123 @@ import re # noqa: F401 import json - -from typing import List, Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conint, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from geoengine_openapi_client.models.file_not_found_handling import FileNotFoundHandling from geoengine_openapi_client.models.gdal_dataset_geo_transform import GdalDatasetGeoTransform from geoengine_openapi_client.models.gdal_metadata_mapping import GdalMetadataMapping +from typing import Optional, Set +from typing_extensions import Self class GdalDatasetParameters(BaseModel): """ - Parameters for loading data using Gdal # noqa: E501 - """ - allow_alphaband_as_mask: Optional[StrictBool] = Field(None, alias="allowAlphabandAsMask") - file_not_found_handling: FileNotFoundHandling = Field(..., alias="fileNotFoundHandling") - file_path: StrictStr = Field(..., alias="filePath") - gdal_config_options: Optional[conlist(conlist(StrictStr, max_items=2, min_items=2))] = Field(None, alias="gdalConfigOptions") - gdal_open_options: Optional[conlist(StrictStr)] = Field(None, alias="gdalOpenOptions") - geo_transform: GdalDatasetGeoTransform = Field(..., alias="geoTransform") - height: conint(strict=True, ge=0) = Field(...) - no_data_value: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="noDataValue") - properties_mapping: Optional[conlist(GdalMetadataMapping)] = Field(None, alias="propertiesMapping") - rasterband_channel: conint(strict=True, ge=0) = Field(..., alias="rasterbandChannel") - width: conint(strict=True, ge=0) = Field(...) - __properties = ["allowAlphabandAsMask", "fileNotFoundHandling", "filePath", "gdalConfigOptions", "gdalOpenOptions", "geoTransform", "height", "noDataValue", "propertiesMapping", "rasterbandChannel", "width"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + Parameters for loading data using Gdal + """ # noqa: E501 + allow_alphaband_as_mask: Optional[StrictBool] = Field(default=None, alias="allowAlphabandAsMask") + file_not_found_handling: FileNotFoundHandling = Field(alias="fileNotFoundHandling") + file_path: StrictStr = Field(alias="filePath") + gdal_config_options: Optional[List[Annotated[List[StrictStr], Field(min_length=2, max_length=2)]]] = Field(default=None, alias="gdalConfigOptions") + gdal_open_options: Optional[List[StrictStr]] = Field(default=None, alias="gdalOpenOptions") + geo_transform: GdalDatasetGeoTransform = Field(alias="geoTransform") + height: Annotated[int, Field(strict=True, ge=0)] + no_data_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="noDataValue") + properties_mapping: Optional[List[GdalMetadataMapping]] = Field(default=None, alias="propertiesMapping") + rasterband_channel: Annotated[int, Field(strict=True, ge=0)] = Field(alias="rasterbandChannel") + width: Annotated[int, Field(strict=True, ge=0)] + __properties: ClassVar[List[str]] = ["allowAlphabandAsMask", "fileNotFoundHandling", "filePath", "gdalConfigOptions", "gdalOpenOptions", "geoTransform", "height", "noDataValue", "propertiesMapping", "rasterbandChannel", "width"] + + 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.dict(by_alias=True)) + 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) -> GdalDatasetParameters: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GdalDatasetParameters 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of geo_transform if self.geo_transform: _dict['geoTransform'] = self.geo_transform.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in properties_mapping (list) _items = [] if self.properties_mapping: - for _item in self.properties_mapping: - if _item: - _items.append(_item.to_dict()) + for _item_properties_mapping in self.properties_mapping: + if _item_properties_mapping: + _items.append(_item_properties_mapping.to_dict()) _dict['propertiesMapping'] = _items # set to None if gdal_config_options (nullable) is None - # and __fields_set__ contains the field - if self.gdal_config_options is None and "gdal_config_options" in self.__fields_set__: + # and model_fields_set contains the field + if self.gdal_config_options is None and "gdal_config_options" in self.model_fields_set: _dict['gdalConfigOptions'] = None # set to None if gdal_open_options (nullable) is None - # and __fields_set__ contains the field - if self.gdal_open_options is None and "gdal_open_options" in self.__fields_set__: + # and model_fields_set contains the field + if self.gdal_open_options is None and "gdal_open_options" in self.model_fields_set: _dict['gdalOpenOptions'] = None # set to None if no_data_value (nullable) is None - # and __fields_set__ contains the field - if self.no_data_value is None and "no_data_value" in self.__fields_set__: + # and model_fields_set contains the field + if self.no_data_value is None and "no_data_value" in self.model_fields_set: _dict['noDataValue'] = None # set to None if properties_mapping (nullable) is None - # and __fields_set__ contains the field - if self.properties_mapping is None and "properties_mapping" in self.__fields_set__: + # and model_fields_set contains the field + if self.properties_mapping is None and "properties_mapping" in self.model_fields_set: _dict['propertiesMapping'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> GdalDatasetParameters: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GdalDatasetParameters from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GdalDatasetParameters.parse_obj(obj) - - _obj = GdalDatasetParameters.parse_obj({ - "allow_alphaband_as_mask": obj.get("allowAlphabandAsMask"), - "file_not_found_handling": obj.get("fileNotFoundHandling"), - "file_path": obj.get("filePath"), - "gdal_config_options": obj.get("gdalConfigOptions"), - "gdal_open_options": obj.get("gdalOpenOptions"), - "geo_transform": GdalDatasetGeoTransform.from_dict(obj.get("geoTransform")) if obj.get("geoTransform") is not None else None, + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allowAlphabandAsMask": obj.get("allowAlphabandAsMask"), + "fileNotFoundHandling": obj.get("fileNotFoundHandling"), + "filePath": obj.get("filePath"), + "gdalConfigOptions": obj.get("gdalConfigOptions"), + "gdalOpenOptions": obj.get("gdalOpenOptions"), + "geoTransform": GdalDatasetGeoTransform.from_dict(obj["geoTransform"]) if obj.get("geoTransform") is not None else None, "height": obj.get("height"), - "no_data_value": obj.get("noDataValue"), - "properties_mapping": [GdalMetadataMapping.from_dict(_item) for _item in obj.get("propertiesMapping")] if obj.get("propertiesMapping") is not None else None, - "rasterband_channel": obj.get("rasterbandChannel"), + "noDataValue": obj.get("noDataValue"), + "propertiesMapping": [GdalMetadataMapping.from_dict(_item) for _item in obj["propertiesMapping"]] if obj.get("propertiesMapping") is not None else None, + "rasterbandChannel": obj.get("rasterbandChannel"), "width": obj.get("width") }) return _obj diff --git a/python/geoengine_openapi_client/models/gdal_loading_info_temporal_slice.py b/python/geoengine_openapi_client/models/gdal_loading_info_temporal_slice.py index df33199e..a335ac5e 100644 --- a/python/geoengine_openapi_client/models/gdal_loading_info_temporal_slice.py +++ b/python/geoengine_openapi_client/models/gdal_loading_info_temporal_slice.py @@ -18,45 +18,62 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, conint +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.gdal_dataset_parameters import GdalDatasetParameters from geoengine_openapi_client.models.time_interval import TimeInterval +from typing import Optional, Set +from typing_extensions import Self class GdalLoadingInfoTemporalSlice(BaseModel): """ - one temporal slice of the dataset that requires reading from exactly one Gdal dataset # noqa: E501 - """ - cache_ttl: Optional[conint(strict=True, ge=0)] = Field(None, alias="cacheTtl") + one temporal slice of the dataset that requires reading from exactly one Gdal dataset + """ # noqa: E501 + cache_ttl: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, alias="cacheTtl") params: Optional[GdalDatasetParameters] = None - time: TimeInterval = Field(...) - __properties = ["cacheTtl", "params", "time"] + time: TimeInterval + __properties: ClassVar[List[str]] = ["cacheTtl", "params", "time"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> GdalLoadingInfoTemporalSlice: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GdalLoadingInfoTemporalSlice 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of params if self.params: _dict['params'] = self.params.to_dict() @@ -64,25 +81,25 @@ def to_dict(self): if self.time: _dict['time'] = self.time.to_dict() # set to None if params (nullable) is None - # and __fields_set__ contains the field - if self.params is None and "params" in self.__fields_set__: + # and model_fields_set contains the field + if self.params is None and "params" in self.model_fields_set: _dict['params'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> GdalLoadingInfoTemporalSlice: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GdalLoadingInfoTemporalSlice from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GdalLoadingInfoTemporalSlice.parse_obj(obj) + return cls.model_validate(obj) - _obj = GdalLoadingInfoTemporalSlice.parse_obj({ - "cache_ttl": obj.get("cacheTtl"), - "params": GdalDatasetParameters.from_dict(obj.get("params")) if obj.get("params") is not None else None, - "time": TimeInterval.from_dict(obj.get("time")) if obj.get("time") is not None else None + _obj = cls.model_validate({ + "cacheTtl": obj.get("cacheTtl"), + "params": GdalDatasetParameters.from_dict(obj["params"]) if obj.get("params") is not None else None, + "time": TimeInterval.from_dict(obj["time"]) if obj.get("time") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/gdal_meta_data_list.py b/python/geoengine_openapi_client/models/gdal_meta_data_list.py index 7ffad540..c25dacd7 100644 --- a/python/geoengine_openapi_client/models/gdal_meta_data_list.py +++ b/python/geoengine_openapi_client/models/gdal_meta_data_list.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.gdal_loading_info_temporal_slice import GdalLoadingInfoTemporalSlice from geoengine_openapi_client.models.raster_result_descriptor import RasterResultDescriptor +from typing import Optional, Set +from typing_extensions import Self class GdalMetaDataList(BaseModel): """ GdalMetaDataList - """ - params: conlist(GdalLoadingInfoTemporalSlice) = Field(...) - result_descriptor: RasterResultDescriptor = Field(..., alias="resultDescriptor") - type: StrictStr = Field(...) - __properties = ["params", "resultDescriptor", "type"] + """ # noqa: E501 + params: List[GdalLoadingInfoTemporalSlice] + result_descriptor: RasterResultDescriptor = Field(alias="resultDescriptor") + type: StrictStr + __properties: ClassVar[List[str]] = ["params", "resultDescriptor", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('GdalMetaDataList'): + if value not in set(['GdalMetaDataList']): raise ValueError("must be one of enum values ('GdalMetaDataList')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> GdalMetaDataList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GdalMetaDataList 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in params (list) _items = [] if self.params: - for _item in self.params: - if _item: - _items.append(_item.to_dict()) + for _item_params in self.params: + if _item_params: + _items.append(_item_params.to_dict()) _dict['params'] = _items # override the default output from pydantic by calling `to_dict()` of result_descriptor if self.result_descriptor: @@ -77,17 +93,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> GdalMetaDataList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GdalMetaDataList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GdalMetaDataList.parse_obj(obj) + return cls.model_validate(obj) - _obj = GdalMetaDataList.parse_obj({ - "params": [GdalLoadingInfoTemporalSlice.from_dict(_item) for _item in obj.get("params")] if obj.get("params") is not None else None, - "result_descriptor": RasterResultDescriptor.from_dict(obj.get("resultDescriptor")) if obj.get("resultDescriptor") is not None else None, + _obj = cls.model_validate({ + "params": [GdalLoadingInfoTemporalSlice.from_dict(_item) for _item in obj["params"]] if obj.get("params") is not None else None, + "resultDescriptor": RasterResultDescriptor.from_dict(obj["resultDescriptor"]) if obj.get("resultDescriptor") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/gdal_meta_data_regular.py b/python/geoengine_openapi_client/models/gdal_meta_data_regular.py index 428c14bb..0e10b300 100644 --- a/python/geoengine_openapi_client/models/gdal_meta_data_regular.py +++ b/python/geoengine_openapi_client/models/gdal_meta_data_regular.py @@ -18,59 +18,76 @@ import re # noqa: F401 import json - -from typing import Dict, Optional -from pydantic import BaseModel, Field, StrictStr, conint, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.gdal_dataset_parameters import GdalDatasetParameters from geoengine_openapi_client.models.gdal_source_time_placeholder import GdalSourceTimePlaceholder from geoengine_openapi_client.models.raster_result_descriptor import RasterResultDescriptor from geoengine_openapi_client.models.time_interval import TimeInterval from geoengine_openapi_client.models.time_step import TimeStep +from typing import Optional, Set +from typing_extensions import Self class GdalMetaDataRegular(BaseModel): """ GdalMetaDataRegular - """ - cache_ttl: Optional[conint(strict=True, ge=0)] = Field(None, alias="cacheTtl") - data_time: TimeInterval = Field(..., alias="dataTime") - params: GdalDatasetParameters = Field(...) - result_descriptor: RasterResultDescriptor = Field(..., alias="resultDescriptor") - step: TimeStep = Field(...) - time_placeholders: Dict[str, GdalSourceTimePlaceholder] = Field(..., alias="timePlaceholders") - type: StrictStr = Field(...) - __properties = ["cacheTtl", "dataTime", "params", "resultDescriptor", "step", "timePlaceholders", "type"] - - @validator('type') + """ # noqa: E501 + cache_ttl: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, alias="cacheTtl") + data_time: TimeInterval = Field(alias="dataTime") + params: GdalDatasetParameters + result_descriptor: RasterResultDescriptor = Field(alias="resultDescriptor") + step: TimeStep + time_placeholders: Dict[str, GdalSourceTimePlaceholder] = Field(alias="timePlaceholders") + type: StrictStr + __properties: ClassVar[List[str]] = ["cacheTtl", "dataTime", "params", "resultDescriptor", "step", "timePlaceholders", "type"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('GdalMetaDataRegular'): + if value not in set(['GdalMetaDataRegular']): raise ValueError("must be one of enum values ('GdalMetaDataRegular')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> GdalMetaDataRegular: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GdalMetaDataRegular 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of data_time if self.data_time: _dict['dataTime'] = self.data_time.to_dict() @@ -86,30 +103,30 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of each value in time_placeholders (dict) _field_dict = {} if self.time_placeholders: - for _key in self.time_placeholders: - if self.time_placeholders[_key]: - _field_dict[_key] = self.time_placeholders[_key].to_dict() + for _key_time_placeholders in self.time_placeholders: + if self.time_placeholders[_key_time_placeholders]: + _field_dict[_key_time_placeholders] = self.time_placeholders[_key_time_placeholders].to_dict() _dict['timePlaceholders'] = _field_dict return _dict @classmethod - def from_dict(cls, obj: dict) -> GdalMetaDataRegular: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GdalMetaDataRegular from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GdalMetaDataRegular.parse_obj(obj) - - _obj = GdalMetaDataRegular.parse_obj({ - "cache_ttl": obj.get("cacheTtl"), - "data_time": TimeInterval.from_dict(obj.get("dataTime")) if obj.get("dataTime") is not None else None, - "params": GdalDatasetParameters.from_dict(obj.get("params")) if obj.get("params") is not None else None, - "result_descriptor": RasterResultDescriptor.from_dict(obj.get("resultDescriptor")) if obj.get("resultDescriptor") is not None else None, - "step": TimeStep.from_dict(obj.get("step")) if obj.get("step") is not None else None, - "time_placeholders": dict( + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cacheTtl": obj.get("cacheTtl"), + "dataTime": TimeInterval.from_dict(obj["dataTime"]) if obj.get("dataTime") is not None else None, + "params": GdalDatasetParameters.from_dict(obj["params"]) if obj.get("params") is not None else None, + "resultDescriptor": RasterResultDescriptor.from_dict(obj["resultDescriptor"]) if obj.get("resultDescriptor") is not None else None, + "step": TimeStep.from_dict(obj["step"]) if obj.get("step") is not None else None, + "timePlaceholders": dict( (_k, GdalSourceTimePlaceholder.from_dict(_v)) - for _k, _v in obj.get("timePlaceholders").items() + for _k, _v in obj["timePlaceholders"].items() ) if obj.get("timePlaceholders") is not None else None, diff --git a/python/geoengine_openapi_client/models/gdal_meta_data_static.py b/python/geoengine_openapi_client/models/gdal_meta_data_static.py index cfe6ebdc..6ab704c0 100644 --- a/python/geoengine_openapi_client/models/gdal_meta_data_static.py +++ b/python/geoengine_openapi_client/models/gdal_meta_data_static.py @@ -18,55 +18,72 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr, conint, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.gdal_dataset_parameters import GdalDatasetParameters from geoengine_openapi_client.models.raster_result_descriptor import RasterResultDescriptor from geoengine_openapi_client.models.time_interval import TimeInterval +from typing import Optional, Set +from typing_extensions import Self class GdalMetaDataStatic(BaseModel): """ GdalMetaDataStatic - """ - cache_ttl: Optional[conint(strict=True, ge=0)] = Field(None, alias="cacheTtl") - params: GdalDatasetParameters = Field(...) - result_descriptor: RasterResultDescriptor = Field(..., alias="resultDescriptor") + """ # noqa: E501 + cache_ttl: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, alias="cacheTtl") + params: GdalDatasetParameters + result_descriptor: RasterResultDescriptor = Field(alias="resultDescriptor") time: Optional[TimeInterval] = None - type: StrictStr = Field(...) - __properties = ["cacheTtl", "params", "resultDescriptor", "time", "type"] + type: StrictStr + __properties: ClassVar[List[str]] = ["cacheTtl", "params", "resultDescriptor", "time", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('GdalStatic'): + if value not in set(['GdalStatic']): raise ValueError("must be one of enum values ('GdalStatic')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> GdalMetaDataStatic: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GdalMetaDataStatic 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of params if self.params: _dict['params'] = self.params.to_dict() @@ -77,26 +94,26 @@ def to_dict(self): if self.time: _dict['time'] = self.time.to_dict() # set to None if time (nullable) is None - # and __fields_set__ contains the field - if self.time is None and "time" in self.__fields_set__: + # and model_fields_set contains the field + if self.time is None and "time" in self.model_fields_set: _dict['time'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> GdalMetaDataStatic: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GdalMetaDataStatic from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GdalMetaDataStatic.parse_obj(obj) + return cls.model_validate(obj) - _obj = GdalMetaDataStatic.parse_obj({ - "cache_ttl": obj.get("cacheTtl"), - "params": GdalDatasetParameters.from_dict(obj.get("params")) if obj.get("params") is not None else None, - "result_descriptor": RasterResultDescriptor.from_dict(obj.get("resultDescriptor")) if obj.get("resultDescriptor") is not None else None, - "time": TimeInterval.from_dict(obj.get("time")) if obj.get("time") is not None else None, + _obj = cls.model_validate({ + "cacheTtl": obj.get("cacheTtl"), + "params": GdalDatasetParameters.from_dict(obj["params"]) if obj.get("params") is not None else None, + "resultDescriptor": RasterResultDescriptor.from_dict(obj["resultDescriptor"]) if obj.get("resultDescriptor") is not None else None, + "time": TimeInterval.from_dict(obj["time"]) if obj.get("time") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/gdal_metadata_mapping.py b/python/geoengine_openapi_client/models/gdal_metadata_mapping.py index df3642db..deceaed7 100644 --- a/python/geoengine_openapi_client/models/gdal_metadata_mapping.py +++ b/python/geoengine_openapi_client/models/gdal_metadata_mapping.py @@ -18,45 +18,61 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.raster_properties_entry_type import RasterPropertiesEntryType from geoengine_openapi_client.models.raster_properties_key import RasterPropertiesKey +from typing import Optional, Set +from typing_extensions import Self class GdalMetadataMapping(BaseModel): """ GdalMetadataMapping - """ - source_key: RasterPropertiesKey = Field(...) - target_key: RasterPropertiesKey = Field(...) - target_type: RasterPropertiesEntryType = Field(...) - __properties = ["source_key", "target_key", "target_type"] + """ # noqa: E501 + source_key: RasterPropertiesKey + target_key: RasterPropertiesKey + target_type: RasterPropertiesEntryType + __properties: ClassVar[List[str]] = ["source_key", "target_key", "target_type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> GdalMetadataMapping: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GdalMetadataMapping 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of source_key if self.source_key: _dict['source_key'] = self.source_key.to_dict() @@ -66,17 +82,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> GdalMetadataMapping: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GdalMetadataMapping from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GdalMetadataMapping.parse_obj(obj) + return cls.model_validate(obj) - _obj = GdalMetadataMapping.parse_obj({ - "source_key": RasterPropertiesKey.from_dict(obj.get("source_key")) if obj.get("source_key") is not None else None, - "target_key": RasterPropertiesKey.from_dict(obj.get("target_key")) if obj.get("target_key") is not None else None, + _obj = cls.model_validate({ + "source_key": RasterPropertiesKey.from_dict(obj["source_key"]) if obj.get("source_key") is not None else None, + "target_key": RasterPropertiesKey.from_dict(obj["target_key"]) if obj.get("target_key") is not None else None, "target_type": obj.get("target_type") }) return _obj diff --git a/python/geoengine_openapi_client/models/gdal_metadata_net_cdf_cf.py b/python/geoengine_openapi_client/models/gdal_metadata_net_cdf_cf.py index 38efe1eb..74705d13 100644 --- a/python/geoengine_openapi_client/models/gdal_metadata_net_cdf_cf.py +++ b/python/geoengine_openapi_client/models/gdal_metadata_net_cdf_cf.py @@ -18,58 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, conint, validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.gdal_dataset_parameters import GdalDatasetParameters from geoengine_openapi_client.models.raster_result_descriptor import RasterResultDescriptor from geoengine_openapi_client.models.time_step import TimeStep +from typing import Optional, Set +from typing_extensions import Self class GdalMetadataNetCdfCf(BaseModel): """ - Meta data for 4D `NetCDF` CF datasets # noqa: E501 - """ - band_offset: conint(strict=True, ge=0) = Field(..., alias="bandOffset", description="A band offset specifies the first band index to use for the first point in time. All other time steps are added to this offset.") - cache_ttl: Optional[conint(strict=True, ge=0)] = Field(None, alias="cacheTtl") - end: StrictInt = Field(...) - params: GdalDatasetParameters = Field(...) - result_descriptor: RasterResultDescriptor = Field(..., alias="resultDescriptor") - start: StrictInt = Field(...) - step: TimeStep = Field(...) - type: StrictStr = Field(...) - __properties = ["bandOffset", "cacheTtl", "end", "params", "resultDescriptor", "start", "step", "type"] - - @validator('type') + Meta data for 4D `NetCDF` CF datasets + """ # noqa: E501 + band_offset: Annotated[int, Field(strict=True, ge=0)] = Field(description="A band offset specifies the first band index to use for the first point in time. All other time steps are added to this offset.", alias="bandOffset") + cache_ttl: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, alias="cacheTtl") + end: StrictInt + params: GdalDatasetParameters + result_descriptor: RasterResultDescriptor = Field(alias="resultDescriptor") + start: StrictInt + step: TimeStep + type: StrictStr + __properties: ClassVar[List[str]] = ["bandOffset", "cacheTtl", "end", "params", "resultDescriptor", "start", "step", "type"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('GdalMetadataNetCdfCf'): + if value not in set(['GdalMetadataNetCdfCf']): raise ValueError("must be one of enum values ('GdalMetadataNetCdfCf')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> GdalMetadataNetCdfCf: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GdalMetadataNetCdfCf 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of params if self.params: _dict['params'] = self.params.to_dict() @@ -82,22 +99,22 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> GdalMetadataNetCdfCf: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GdalMetadataNetCdfCf from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GdalMetadataNetCdfCf.parse_obj(obj) + return cls.model_validate(obj) - _obj = GdalMetadataNetCdfCf.parse_obj({ - "band_offset": obj.get("bandOffset"), - "cache_ttl": obj.get("cacheTtl"), + _obj = cls.model_validate({ + "bandOffset": obj.get("bandOffset"), + "cacheTtl": obj.get("cacheTtl"), "end": obj.get("end"), - "params": GdalDatasetParameters.from_dict(obj.get("params")) if obj.get("params") is not None else None, - "result_descriptor": RasterResultDescriptor.from_dict(obj.get("resultDescriptor")) if obj.get("resultDescriptor") is not None else None, + "params": GdalDatasetParameters.from_dict(obj["params"]) if obj.get("params") is not None else None, + "resultDescriptor": RasterResultDescriptor.from_dict(obj["resultDescriptor"]) if obj.get("resultDescriptor") is not None else None, "start": obj.get("start"), - "step": TimeStep.from_dict(obj.get("step")) if obj.get("step") is not None else None, + "step": TimeStep.from_dict(obj["step"]) if obj.get("step") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/gdal_source_time_placeholder.py b/python/geoengine_openapi_client/models/gdal_source_time_placeholder.py index 47cabb16..34ddd25e 100644 --- a/python/geoengine_openapi_client/models/gdal_source_time_placeholder.py +++ b/python/geoengine_openapi_client/models/gdal_source_time_placeholder.py @@ -18,55 +18,71 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.time_reference import TimeReference +from typing import Optional, Set +from typing_extensions import Self class GdalSourceTimePlaceholder(BaseModel): """ GdalSourceTimePlaceholder - """ - format: StrictStr = Field(...) - reference: TimeReference = Field(...) - __properties = ["format", "reference"] + """ # noqa: E501 + format: StrictStr + reference: TimeReference + __properties: ClassVar[List[str]] = ["format", "reference"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> GdalSourceTimePlaceholder: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GdalSourceTimePlaceholder 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) + 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: dict) -> GdalSourceTimePlaceholder: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GdalSourceTimePlaceholder from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GdalSourceTimePlaceholder.parse_obj(obj) + return cls.model_validate(obj) - _obj = GdalSourceTimePlaceholder.parse_obj({ + _obj = cls.model_validate({ "format": obj.get("format"), "reference": obj.get("reference") }) diff --git a/python/geoengine_openapi_client/models/geo_json.py b/python/geoengine_openapi_client/models/geo_json.py index ff9f114c..65dd2489 100644 --- a/python/geoengine_openapi_client/models/geo_json.py +++ b/python/geoengine_openapi_client/models/geo_json.py @@ -18,55 +18,71 @@ import re # noqa: F401 import json - -from typing import Any, List -from pydantic import BaseModel, Field, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.collection_type import CollectionType +from typing import Optional, Set +from typing_extensions import Self class GeoJson(BaseModel): """ GeoJson - """ - features: conlist(Any) = Field(...) - type: CollectionType = Field(...) - __properties = ["features", "type"] + """ # noqa: E501 + features: List[Any] + type: CollectionType + __properties: ClassVar[List[str]] = ["features", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> GeoJson: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GeoJson 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) + 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: dict) -> GeoJson: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GeoJson from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GeoJson.parse_obj(obj) + return cls.model_validate(obj) - _obj = GeoJson.parse_obj({ + _obj = cls.model_validate({ "features": obj.get("features"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/get_capabilities_format.py b/python/geoengine_openapi_client/models/get_capabilities_format.py index 9061c98c..58eac3b9 100644 --- a/python/geoengine_openapi_client/models/get_capabilities_format.py +++ b/python/geoengine_openapi_client/models/get_capabilities_format.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class GetCapabilitiesFormat(str, Enum): @@ -33,8 +30,8 @@ class GetCapabilitiesFormat(str, Enum): TEXT_SLASH_XML = 'text/xml' @classmethod - def from_json(cls, json_str: str) -> GetCapabilitiesFormat: + def from_json(cls, json_str: str) -> Self: """Create an instance of GetCapabilitiesFormat from a JSON string""" - return GetCapabilitiesFormat(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/get_capabilities_request.py b/python/geoengine_openapi_client/models/get_capabilities_request.py index 9c101416..07b5b608 100644 --- a/python/geoengine_openapi_client/models/get_capabilities_request.py +++ b/python/geoengine_openapi_client/models/get_capabilities_request.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class GetCapabilitiesRequest(str, Enum): @@ -33,8 +30,8 @@ class GetCapabilitiesRequest(str, Enum): GETCAPABILITIES = 'GetCapabilities' @classmethod - def from_json(cls, json_str: str) -> GetCapabilitiesRequest: + def from_json(cls, json_str: str) -> Self: """Create an instance of GetCapabilitiesRequest from a JSON string""" - return GetCapabilitiesRequest(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/get_coverage_format.py b/python/geoengine_openapi_client/models/get_coverage_format.py index cb706fe4..39d1d573 100644 --- a/python/geoengine_openapi_client/models/get_coverage_format.py +++ b/python/geoengine_openapi_client/models/get_coverage_format.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class GetCoverageFormat(str, Enum): @@ -33,8 +30,8 @@ class GetCoverageFormat(str, Enum): IMAGE_SLASH_TIFF = 'image/tiff' @classmethod - def from_json(cls, json_str: str) -> GetCoverageFormat: + def from_json(cls, json_str: str) -> Self: """Create an instance of GetCoverageFormat from a JSON string""" - return GetCoverageFormat(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/get_coverage_request.py b/python/geoengine_openapi_client/models/get_coverage_request.py index 7af14cdd..9df3ab15 100644 --- a/python/geoengine_openapi_client/models/get_coverage_request.py +++ b/python/geoengine_openapi_client/models/get_coverage_request.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class GetCoverageRequest(str, Enum): @@ -33,8 +30,8 @@ class GetCoverageRequest(str, Enum): GETCOVERAGE = 'GetCoverage' @classmethod - def from_json(cls, json_str: str) -> GetCoverageRequest: + def from_json(cls, json_str: str) -> Self: """Create an instance of GetCoverageRequest from a JSON string""" - return GetCoverageRequest(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/get_feature_request.py b/python/geoengine_openapi_client/models/get_feature_request.py index c0bcbae7..a4cd6056 100644 --- a/python/geoengine_openapi_client/models/get_feature_request.py +++ b/python/geoengine_openapi_client/models/get_feature_request.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class GetFeatureRequest(str, Enum): @@ -33,8 +30,8 @@ class GetFeatureRequest(str, Enum): GETFEATURE = 'GetFeature' @classmethod - def from_json(cls, json_str: str) -> GetFeatureRequest: + def from_json(cls, json_str: str) -> Self: """Create an instance of GetFeatureRequest from a JSON string""" - return GetFeatureRequest(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/get_legend_graphic_request.py b/python/geoengine_openapi_client/models/get_legend_graphic_request.py index 4a1a29b9..48aab927 100644 --- a/python/geoengine_openapi_client/models/get_legend_graphic_request.py +++ b/python/geoengine_openapi_client/models/get_legend_graphic_request.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class GetLegendGraphicRequest(str, Enum): @@ -33,8 +30,8 @@ class GetLegendGraphicRequest(str, Enum): GETLEGENDGRAPHIC = 'GetLegendGraphic' @classmethod - def from_json(cls, json_str: str) -> GetLegendGraphicRequest: + def from_json(cls, json_str: str) -> Self: """Create an instance of GetLegendGraphicRequest from a JSON string""" - return GetLegendGraphicRequest(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/get_map_exception_format.py b/python/geoengine_openapi_client/models/get_map_exception_format.py index 3a27ba95..5ef5613b 100644 --- a/python/geoengine_openapi_client/models/get_map_exception_format.py +++ b/python/geoengine_openapi_client/models/get_map_exception_format.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class GetMapExceptionFormat(str, Enum): @@ -34,8 +31,8 @@ class GetMapExceptionFormat(str, Enum): JSON = 'JSON' @classmethod - def from_json(cls, json_str: str) -> GetMapExceptionFormat: + def from_json(cls, json_str: str) -> Self: """Create an instance of GetMapExceptionFormat from a JSON string""" - return GetMapExceptionFormat(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/get_map_format.py b/python/geoengine_openapi_client/models/get_map_format.py index 93434f6f..1da506de 100644 --- a/python/geoengine_openapi_client/models/get_map_format.py +++ b/python/geoengine_openapi_client/models/get_map_format.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class GetMapFormat(str, Enum): @@ -33,8 +30,8 @@ class GetMapFormat(str, Enum): IMAGE_SLASH_PNG = 'image/png' @classmethod - def from_json(cls, json_str: str) -> GetMapFormat: + def from_json(cls, json_str: str) -> Self: """Create an instance of GetMapFormat from a JSON string""" - return GetMapFormat(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/get_map_request.py b/python/geoengine_openapi_client/models/get_map_request.py index 2411dcf5..9effd255 100644 --- a/python/geoengine_openapi_client/models/get_map_request.py +++ b/python/geoengine_openapi_client/models/get_map_request.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class GetMapRequest(str, Enum): @@ -33,8 +30,8 @@ class GetMapRequest(str, Enum): GETMAP = 'GetMap' @classmethod - def from_json(cls, json_str: str) -> GetMapRequest: + def from_json(cls, json_str: str) -> Self: """Create an instance of GetMapRequest from a JSON string""" - return GetMapRequest(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/inline_object.py b/python/geoengine_openapi_client/models/inline_object.py new file mode 100644 index 00000000..95df4a44 --- /dev/null +++ b/python/geoengine_openapi_client/models/inline_object.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Geo Engine API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.8.0 + 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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class InlineObject(BaseModel): + """ + InlineObject + """ # noqa: E501 + url: StrictStr + __properties: ClassVar[List[str]] = ["url"] + + 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 InlineObject 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 InlineObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "url": obj.get("url") + }) + return _obj + + diff --git a/python/geoengine_openapi_client/models/internal_data_id.py b/python/geoengine_openapi_client/models/internal_data_id.py index c25ec397..948a67a6 100644 --- a/python/geoengine_openapi_client/models/internal_data_id.py +++ b/python/geoengine_openapi_client/models/internal_data_id.py @@ -18,62 +18,78 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class InternalDataId(BaseModel): """ InternalDataId - """ - dataset_id: StrictStr = Field(..., alias="datasetId") - type: StrictStr = Field(...) - __properties = ["datasetId", "type"] + """ # noqa: E501 + dataset_id: StrictStr = Field(alias="datasetId") + type: StrictStr + __properties: ClassVar[List[str]] = ["datasetId", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('internal', 'external'): - raise ValueError("must be one of enum values ('internal', 'external')") + if value not in set(['internal']): + raise ValueError("must be one of enum values ('internal')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> InternalDataId: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of InternalDataId 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) + 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: dict) -> InternalDataId: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of InternalDataId from a dict""" if obj is None: return None if not isinstance(obj, dict): - return InternalDataId.parse_obj(obj) + return cls.model_validate(obj) - _obj = InternalDataId.parse_obj({ - "dataset_id": obj.get("datasetId"), + _obj = cls.model_validate({ + "datasetId": obj.get("datasetId"), "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/layer.py b/python/geoengine_openapi_client/models/layer.py index 2a0f0480..6d0e81e5 100644 --- a/python/geoengine_openapi_client/models/layer.py +++ b/python/geoengine_openapi_client/models/layer.py @@ -18,50 +18,67 @@ import re # noqa: F401 import json - -from typing import Dict, List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.provider_layer_id import ProviderLayerId from geoengine_openapi_client.models.symbology import Symbology from geoengine_openapi_client.models.workflow import Workflow +from typing import Optional, Set +from typing_extensions import Self class Layer(BaseModel): """ Layer - """ - description: StrictStr = Field(...) - id: ProviderLayerId = 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") + """ # noqa: E501 + description: StrictStr + id: ProviderLayerId + metadata: Optional[Dict[str, StrictStr]] = Field(default=None, description="metadata used for loading the data") + name: StrictStr + properties: Optional[List[Annotated[List[StrictStr], Field(min_length=2, max_length=2)]]] = Field(default=None, description="properties, for instance, to be rendered in the UI") symbology: Optional[Symbology] = None - workflow: Workflow = Field(...) - __properties = ["description", "id", "metadata", "name", "properties", "symbology", "workflow"] + workflow: Workflow + __properties: ClassVar[List[str]] = ["description", "id", "metadata", "name", "properties", "symbology", "workflow"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> Layer: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Layer 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of id if self.id: _dict['id'] = self.id.to_dict() @@ -72,29 +89,29 @@ def to_dict(self): 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__: + # and model_fields_set contains the field + if self.symbology is None and "symbology" in self.model_fields_set: _dict['symbology'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Layer: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Layer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Layer.parse_obj(obj) + return cls.model_validate(obj) - _obj = Layer.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), - "id": ProviderLayerId.from_dict(obj.get("id")) if obj.get("id") is not None else None, + "id": ProviderLayerId.from_dict(obj["id"]) if obj.get("id") is not None else None, "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 + "symbology": Symbology.from_dict(obj["symbology"]) if obj.get("symbology") is not None else None, + "workflow": Workflow.from_dict(obj["workflow"]) if obj.get("workflow") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/layer_collection.py b/python/geoengine_openapi_client/models/layer_collection.py index 2e81d393..ccd392c2 100644 --- a/python/geoengine_openapi_client/models/layer_collection.py +++ b/python/geoengine_openapi_client/models/layer_collection.py @@ -18,79 +18,96 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.collection_item import CollectionItem from geoengine_openapi_client.models.provider_layer_collection_id import ProviderLayerCollectionId +from typing import Optional, Set +from typing_extensions import Self class LayerCollection(BaseModel): """ LayerCollection - """ - description: StrictStr = Field(...) - entry_label: Optional[StrictStr] = Field(None, alias="entryLabel", description="a common label for the collection's entries, if there is any") - id: ProviderLayerCollectionId = Field(...) - items: conlist(CollectionItem) = Field(...) - name: StrictStr = Field(...) - properties: conlist(conlist(StrictStr, max_items=2, min_items=2)) = Field(...) - __properties = ["description", "entryLabel", "id", "items", "name", "properties"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + description: StrictStr + entry_label: Optional[StrictStr] = Field(default=None, description="a common label for the collection's entries, if there is any", alias="entryLabel") + id: ProviderLayerCollectionId + items: List[CollectionItem] + name: StrictStr + properties: List[Annotated[List[StrictStr], Field(min_length=2, max_length=2)]] + __properties: ClassVar[List[str]] = ["description", "entryLabel", "id", "items", "name", "properties"] + + 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.dict(by_alias=True)) + 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) -> LayerCollection: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LayerCollection 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of id if self.id: _dict['id'] = self.id.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in items (list) _items = [] if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) _dict['items'] = _items # set to None if entry_label (nullable) is None - # and __fields_set__ contains the field - if self.entry_label is None and "entry_label" in self.__fields_set__: + # and model_fields_set contains the field + if self.entry_label is None and "entry_label" in self.model_fields_set: _dict['entryLabel'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> LayerCollection: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LayerCollection from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LayerCollection.parse_obj(obj) + return cls.model_validate(obj) - _obj = LayerCollection.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), - "entry_label": obj.get("entryLabel"), - "id": ProviderLayerCollectionId.from_dict(obj.get("id")) if obj.get("id") is not None else None, - "items": [CollectionItem.from_dict(_item) for _item in obj.get("items")] if obj.get("items") is not None else None, + "entryLabel": obj.get("entryLabel"), + "id": ProviderLayerCollectionId.from_dict(obj["id"]) if obj.get("id") is not None else None, + "items": [CollectionItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, "name": obj.get("name"), "properties": obj.get("properties") }) diff --git a/python/geoengine_openapi_client/models/layer_collection_listing.py b/python/geoengine_openapi_client/models/layer_collection_listing.py index 295fa325..533647da 100644 --- a/python/geoengine_openapi_client/models/layer_collection_listing.py +++ b/python/geoengine_openapi_client/models/layer_collection_listing.py @@ -18,70 +18,87 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.provider_layer_collection_id import ProviderLayerCollectionId +from typing import Optional, Set +from typing_extensions import Self class LayerCollectionListing(BaseModel): """ LayerCollectionListing - """ - description: StrictStr = Field(...) - id: ProviderLayerCollectionId = Field(...) - name: StrictStr = Field(...) - properties: Optional[conlist(conlist(StrictStr, max_items=2, min_items=2))] = None - type: StrictStr = Field(...) - __properties = ["description", "id", "name", "properties", "type"] - - @validator('type') + """ # noqa: E501 + description: StrictStr + id: ProviderLayerCollectionId + name: StrictStr + properties: Optional[List[Annotated[List[StrictStr], Field(min_length=2, max_length=2)]]] = None + type: StrictStr + __properties: ClassVar[List[str]] = ["description", "id", "name", "properties", "type"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('collection', 'layer'): - raise ValueError("must be one of enum values ('collection', 'layer')") + if value not in set(['collection']): + raise ValueError("must be one of enum values ('collection')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> LayerCollectionListing: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LayerCollectionListing 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of id if self.id: _dict['id'] = self.id.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> LayerCollectionListing: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LayerCollectionListing from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LayerCollectionListing.parse_obj(obj) + return cls.model_validate(obj) - _obj = LayerCollectionListing.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), - "id": ProviderLayerCollectionId.from_dict(obj.get("id")) if obj.get("id") is not None else None, + "id": ProviderLayerCollectionId.from_dict(obj["id"]) if obj.get("id") is not None else None, "name": obj.get("name"), "properties": obj.get("properties"), "type": obj.get("type") diff --git a/python/geoengine_openapi_client/models/layer_collection_resource.py b/python/geoengine_openapi_client/models/layer_collection_resource.py index 7c710f88..96c12874 100644 --- a/python/geoengine_openapi_client/models/layer_collection_resource.py +++ b/python/geoengine_openapi_client/models/layer_collection_resource.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class LayerCollectionResource(BaseModel): """ LayerCollectionResource - """ - id: StrictStr = Field(...) - type: StrictStr = Field(...) - __properties = ["id", "type"] + """ # noqa: E501 + id: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["id", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('layerCollection'): + if value not in set(['layerCollection']): raise ValueError("must be one of enum values ('layerCollection')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> LayerCollectionResource: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LayerCollectionResource 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) + 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: dict) -> LayerCollectionResource: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LayerCollectionResource from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LayerCollectionResource.parse_obj(obj) + return cls.model_validate(obj) - _obj = LayerCollectionResource.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/layer_listing.py b/python/geoengine_openapi_client/models/layer_listing.py index 7add001c..50f807d2 100644 --- a/python/geoengine_openapi_client/models/layer_listing.py +++ b/python/geoengine_openapi_client/models/layer_listing.py @@ -18,70 +18,87 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.provider_layer_id import ProviderLayerId +from typing import Optional, Set +from typing_extensions import Self class LayerListing(BaseModel): """ LayerListing - """ - description: StrictStr = Field(...) - id: ProviderLayerId = Field(...) - 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") - type: StrictStr = Field(...) - __properties = ["description", "id", "name", "properties", "type"] - - @validator('type') + """ # noqa: E501 + description: StrictStr + id: ProviderLayerId + name: StrictStr + properties: Optional[List[Annotated[List[StrictStr], Field(min_length=2, max_length=2)]]] = Field(default=None, description="properties, for instance, to be rendered in the UI") + type: StrictStr + __properties: ClassVar[List[str]] = ["description", "id", "name", "properties", "type"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('layer'): + if value not in set(['layer']): raise ValueError("must be one of enum values ('layer')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> LayerListing: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LayerListing 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of id if self.id: _dict['id'] = self.id.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> LayerListing: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LayerListing from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LayerListing.parse_obj(obj) + return cls.model_validate(obj) - _obj = LayerListing.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), - "id": ProviderLayerId.from_dict(obj.get("id")) if obj.get("id") is not None else None, + "id": ProviderLayerId.from_dict(obj["id"]) if obj.get("id") is not None else None, "name": obj.get("name"), "properties": obj.get("properties"), "type": obj.get("type") diff --git a/python/geoengine_openapi_client/models/layer_resource.py b/python/geoengine_openapi_client/models/layer_resource.py index ea4d528a..1b4cab5f 100644 --- a/python/geoengine_openapi_client/models/layer_resource.py +++ b/python/geoengine_openapi_client/models/layer_resource.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class LayerResource(BaseModel): """ LayerResource - """ - id: StrictStr = Field(...) - type: StrictStr = Field(...) - __properties = ["id", "type"] + """ # noqa: E501 + id: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["id", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('layer', 'layerCollection', 'project', 'dataset', 'mlModel'): - raise ValueError("must be one of enum values ('layer', 'layerCollection', 'project', 'dataset', 'mlModel')") + if value not in set(['layer']): + raise ValueError("must be one of enum values ('layer')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> LayerResource: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LayerResource 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) + 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: dict) -> LayerResource: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LayerResource from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LayerResource.parse_obj(obj) + return cls.model_validate(obj) - _obj = LayerResource.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/layer_update.py b/python/geoengine_openapi_client/models/layer_update.py index 689a360e..b6731c5c 100644 --- a/python/geoengine_openapi_client/models/layer_update.py +++ b/python/geoengine_openapi_client/models/layer_update.py @@ -14,17 +14,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.project_layer import ProjectLayer from geoengine_openapi_client.models.project_update_token import ProjectUpdateToken -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self LAYERUPDATE_ONE_OF_SCHEMAS = ["ProjectLayer", "ProjectUpdateToken"] @@ -36,14 +34,14 @@ class LayerUpdate(BaseModel): oneof_schema_1_validator: Optional[ProjectUpdateToken] = None # data type: ProjectLayer oneof_schema_2_validator: Optional[ProjectLayer] = None - if TYPE_CHECKING: - actual_instance: Union[ProjectLayer, ProjectUpdateToken] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(LAYERUPDATE_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[ProjectLayer, ProjectUpdateToken]] = None + one_of_schemas: Set[str] = { "ProjectLayer", "ProjectUpdateToken" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True def __init__(self, *args, **kwargs) -> None: if args: @@ -55,9 +53,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = LayerUpdate.construct() + instance = LayerUpdate.model_construct() error_messages = [] match = 0 # validate data type: ProjectUpdateToken @@ -80,13 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> LayerUpdate: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> LayerUpdate: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = LayerUpdate.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -117,19 +115,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], ProjectLayer, ProjectUpdateToken]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -137,6 +133,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/layer_visibility.py b/python/geoengine_openapi_client/models/layer_visibility.py index 4401c3f8..b7c9cd54 100644 --- a/python/geoengine_openapi_client/models/layer_visibility.py +++ b/python/geoengine_openapi_client/models/layer_visibility.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictBool +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class LayerVisibility(BaseModel): """ LayerVisibility - """ - data: StrictBool = Field(...) - legend: StrictBool = Field(...) - __properties = ["data", "legend"] + """ # noqa: E501 + data: StrictBool + legend: StrictBool + __properties: ClassVar[List[str]] = ["data", "legend"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> LayerVisibility: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LayerVisibility 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) + 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: dict) -> LayerVisibility: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LayerVisibility from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LayerVisibility.parse_obj(obj) + return cls.model_validate(obj) - _obj = LayerVisibility.parse_obj({ + _obj = cls.model_validate({ "data": obj.get("data"), "legend": obj.get("legend") }) diff --git a/python/geoengine_openapi_client/models/line_symbology.py b/python/geoengine_openapi_client/models/line_symbology.py index cc72c137..618681ea 100644 --- a/python/geoengine_openapi_client/models/line_symbology.py +++ b/python/geoengine_openapi_client/models/line_symbology.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.stroke_param import StrokeParam from geoengine_openapi_client.models.text_symbology import TextSymbology +from typing import Optional, Set +from typing_extensions import Self class LineSymbology(BaseModel): """ LineSymbology - """ - auto_simplified: StrictBool = Field(..., alias="autoSimplified") - stroke: StrokeParam = Field(...) + """ # noqa: E501 + auto_simplified: StrictBool = Field(alias="autoSimplified") + stroke: StrokeParam text: Optional[TextSymbology] = None - type: StrictStr = Field(...) - __properties = ["autoSimplified", "stroke", "text", "type"] + type: StrictStr + __properties: ClassVar[List[str]] = ["autoSimplified", "stroke", "text", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('line'): + if value not in set(['line']): raise ValueError("must be one of enum values ('line')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> LineSymbology: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LineSymbology 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of stroke if self.stroke: _dict['stroke'] = self.stroke.to_dict() @@ -72,25 +88,25 @@ def to_dict(self): if self.text: _dict['text'] = self.text.to_dict() # set to None if text (nullable) is None - # and __fields_set__ contains the field - if self.text is None and "text" in self.__fields_set__: + # and model_fields_set contains the field + if self.text is None and "text" in self.model_fields_set: _dict['text'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> LineSymbology: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LineSymbology from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LineSymbology.parse_obj(obj) + return cls.model_validate(obj) - _obj = LineSymbology.parse_obj({ - "auto_simplified": obj.get("autoSimplified"), - "stroke": StrokeParam.from_dict(obj.get("stroke")) if obj.get("stroke") is not None else None, - "text": TextSymbology.from_dict(obj.get("text")) if obj.get("text") is not None else None, + _obj = cls.model_validate({ + "autoSimplified": obj.get("autoSimplified"), + "stroke": StrokeParam.from_dict(obj["stroke"]) if obj.get("stroke") is not None else None, + "text": TextSymbology.from_dict(obj["text"]) if obj.get("text") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/linear_gradient.py b/python/geoengine_openapi_client/models/linear_gradient.py index 69fb7431..2578d6d6 100644 --- a/python/geoengine_openapi_client/models/linear_gradient.py +++ b/python/geoengine_openapi_client/models/linear_gradient.py @@ -18,77 +18,94 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from geoengine_openapi_client.models.breakpoint import Breakpoint +from typing import Optional, Set +from typing_extensions import Self class LinearGradient(BaseModel): """ LinearGradient - """ - breakpoints: conlist(Breakpoint) = Field(...) - no_data_color: conlist(StrictInt, max_items=4, min_items=4) = Field(..., alias="noDataColor") - over_color: conlist(StrictInt, max_items=4, min_items=4) = Field(..., alias="overColor") - type: StrictStr = Field(...) - under_color: conlist(StrictInt, max_items=4, min_items=4) = Field(..., alias="underColor") - __properties = ["breakpoints", "noDataColor", "overColor", "type", "underColor"] - - @validator('type') + """ # noqa: E501 + breakpoints: List[Breakpoint] + no_data_color: Annotated[List[StrictInt], Field(min_length=4, max_length=4)] = Field(alias="noDataColor") + over_color: Annotated[List[StrictInt], Field(min_length=4, max_length=4)] = Field(alias="overColor") + type: StrictStr + under_color: Annotated[List[StrictInt], Field(min_length=4, max_length=4)] = Field(alias="underColor") + __properties: ClassVar[List[str]] = ["breakpoints", "noDataColor", "overColor", "type", "underColor"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('linearGradient', 'logarithmicGradient', 'palette'): - raise ValueError("must be one of enum values ('linearGradient', 'logarithmicGradient', 'palette')") + if value not in set(['linearGradient']): + raise ValueError("must be one of enum values ('linearGradient')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> LinearGradient: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LinearGradient 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in breakpoints (list) _items = [] if self.breakpoints: - for _item in self.breakpoints: - if _item: - _items.append(_item.to_dict()) + for _item_breakpoints in self.breakpoints: + if _item_breakpoints: + _items.append(_item_breakpoints.to_dict()) _dict['breakpoints'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> LinearGradient: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LinearGradient from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LinearGradient.parse_obj(obj) + return cls.model_validate(obj) - _obj = LinearGradient.parse_obj({ - "breakpoints": [Breakpoint.from_dict(_item) for _item in obj.get("breakpoints")] if obj.get("breakpoints") is not None else None, - "no_data_color": obj.get("noDataColor"), - "over_color": obj.get("overColor"), + _obj = cls.model_validate({ + "breakpoints": [Breakpoint.from_dict(_item) for _item in obj["breakpoints"]] if obj.get("breakpoints") is not None else None, + "noDataColor": obj.get("noDataColor"), + "overColor": obj.get("overColor"), "type": obj.get("type"), - "under_color": obj.get("underColor") + "underColor": obj.get("underColor") }) return _obj diff --git a/python/geoengine_openapi_client/models/logarithmic_gradient.py b/python/geoengine_openapi_client/models/logarithmic_gradient.py index cb4737eb..98a479a5 100644 --- a/python/geoengine_openapi_client/models/logarithmic_gradient.py +++ b/python/geoengine_openapi_client/models/logarithmic_gradient.py @@ -18,77 +18,94 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from geoengine_openapi_client.models.breakpoint import Breakpoint +from typing import Optional, Set +from typing_extensions import Self class LogarithmicGradient(BaseModel): """ LogarithmicGradient - """ - breakpoints: conlist(Breakpoint) = Field(...) - no_data_color: conlist(StrictInt, max_items=4, min_items=4) = Field(..., alias="noDataColor") - over_color: conlist(StrictInt, max_items=4, min_items=4) = Field(..., alias="overColor") - type: StrictStr = Field(...) - under_color: conlist(StrictInt, max_items=4, min_items=4) = Field(..., alias="underColor") - __properties = ["breakpoints", "noDataColor", "overColor", "type", "underColor"] - - @validator('type') + """ # noqa: E501 + breakpoints: List[Breakpoint] + no_data_color: Annotated[List[StrictInt], Field(min_length=4, max_length=4)] = Field(alias="noDataColor") + over_color: Annotated[List[StrictInt], Field(min_length=4, max_length=4)] = Field(alias="overColor") + type: StrictStr + under_color: Annotated[List[StrictInt], Field(min_length=4, max_length=4)] = Field(alias="underColor") + __properties: ClassVar[List[str]] = ["breakpoints", "noDataColor", "overColor", "type", "underColor"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('logarithmicGradient'): + if value not in set(['logarithmicGradient']): raise ValueError("must be one of enum values ('logarithmicGradient')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> LogarithmicGradient: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LogarithmicGradient 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in breakpoints (list) _items = [] if self.breakpoints: - for _item in self.breakpoints: - if _item: - _items.append(_item.to_dict()) + for _item_breakpoints in self.breakpoints: + if _item_breakpoints: + _items.append(_item_breakpoints.to_dict()) _dict['breakpoints'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> LogarithmicGradient: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LogarithmicGradient from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LogarithmicGradient.parse_obj(obj) + return cls.model_validate(obj) - _obj = LogarithmicGradient.parse_obj({ - "breakpoints": [Breakpoint.from_dict(_item) for _item in obj.get("breakpoints")] if obj.get("breakpoints") is not None else None, - "no_data_color": obj.get("noDataColor"), - "over_color": obj.get("overColor"), + _obj = cls.model_validate({ + "breakpoints": [Breakpoint.from_dict(_item) for _item in obj["breakpoints"]] if obj.get("breakpoints") is not None else None, + "noDataColor": obj.get("noDataColor"), + "overColor": obj.get("overColor"), "type": obj.get("type"), - "under_color": obj.get("underColor") + "underColor": obj.get("underColor") }) return _obj diff --git a/python/geoengine_openapi_client/models/measurement.py b/python/geoengine_openapi_client/models/measurement.py index e2dfdbf9..919adba2 100644 --- a/python/geoengine_openapi_client/models/measurement.py +++ b/python/geoengine_openapi_client/models/measurement.py @@ -14,18 +14,16 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.classification_measurement import ClassificationMeasurement from geoengine_openapi_client.models.continuous_measurement import ContinuousMeasurement from geoengine_openapi_client.models.unitless_measurement import UnitlessMeasurement -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self MEASUREMENT_ONE_OF_SCHEMAS = ["ClassificationMeasurement", "ContinuousMeasurement", "UnitlessMeasurement"] @@ -39,16 +37,16 @@ class Measurement(BaseModel): oneof_schema_2_validator: Optional[ContinuousMeasurement] = None # data type: ClassificationMeasurement oneof_schema_3_validator: Optional[ClassificationMeasurement] = None - if TYPE_CHECKING: - actual_instance: Union[ClassificationMeasurement, ContinuousMeasurement, UnitlessMeasurement] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(MEASUREMENT_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[ClassificationMeasurement, ContinuousMeasurement, UnitlessMeasurement]] = None + one_of_schemas: Set[str] = { "ClassificationMeasurement", "ContinuousMeasurement", "UnitlessMeasurement" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -61,9 +59,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = Measurement.construct() + instance = Measurement.model_construct() error_messages = [] match = 0 # validate data type: UnitlessMeasurement @@ -91,13 +89,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> Measurement: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> Measurement: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = Measurement.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -107,32 +105,32 @@ def from_json(cls, json_str: str) -> Measurement: raise ValueError("Failed to lookup data type from the field `type` in the input.") # check if data type is `ClassificationMeasurement` - if _data_type == "ClassificationMeasurement": + if _data_type == "classification": instance.actual_instance = ClassificationMeasurement.from_json(json_str) return instance # check if data type is `ContinuousMeasurement` - if _data_type == "ContinuousMeasurement": + if _data_type == "continuous": instance.actual_instance = ContinuousMeasurement.from_json(json_str) return instance # check if data type is `UnitlessMeasurement` - if _data_type == "UnitlessMeasurement": + if _data_type == "unitless": instance.actual_instance = UnitlessMeasurement.from_json(json_str) return instance # check if data type is `ClassificationMeasurement` - if _data_type == "classification": + if _data_type == "ClassificationMeasurement": instance.actual_instance = ClassificationMeasurement.from_json(json_str) return instance # check if data type is `ContinuousMeasurement` - if _data_type == "continuous": + if _data_type == "ContinuousMeasurement": instance.actual_instance = ContinuousMeasurement.from_json(json_str) return instance # check if data type is `UnitlessMeasurement` - if _data_type == "unitless": + if _data_type == "UnitlessMeasurement": instance.actual_instance = UnitlessMeasurement.from_json(json_str) return instance @@ -169,19 +167,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], ClassificationMeasurement, ContinuousMeasurement, UnitlessMeasurement]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -189,6 +185,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/meta_data_definition.py b/python/geoengine_openapi_client/models/meta_data_definition.py index 46ecccae..0ce7cf5f 100644 --- a/python/geoengine_openapi_client/models/meta_data_definition.py +++ b/python/geoengine_openapi_client/models/meta_data_definition.py @@ -14,21 +14,19 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.gdal_meta_data_list import GdalMetaDataList from geoengine_openapi_client.models.gdal_meta_data_regular import GdalMetaDataRegular from geoengine_openapi_client.models.gdal_meta_data_static import GdalMetaDataStatic from geoengine_openapi_client.models.gdal_metadata_net_cdf_cf import GdalMetadataNetCdfCf from geoengine_openapi_client.models.mock_meta_data import MockMetaData from geoengine_openapi_client.models.ogr_meta_data import OgrMetaData -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self METADATADEFINITION_ONE_OF_SCHEMAS = ["GdalMetaDataList", "GdalMetaDataRegular", "GdalMetaDataStatic", "GdalMetadataNetCdfCf", "MockMetaData", "OgrMetaData"] @@ -48,16 +46,16 @@ class MetaDataDefinition(BaseModel): oneof_schema_5_validator: Optional[GdalMetadataNetCdfCf] = None # data type: GdalMetaDataList oneof_schema_6_validator: Optional[GdalMetaDataList] = None - if TYPE_CHECKING: - actual_instance: Union[GdalMetaDataList, GdalMetaDataRegular, GdalMetaDataStatic, GdalMetadataNetCdfCf, MockMetaData, OgrMetaData] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(METADATADEFINITION_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[GdalMetaDataList, GdalMetaDataRegular, GdalMetaDataStatic, GdalMetadataNetCdfCf, MockMetaData, OgrMetaData]] = None + one_of_schemas: Set[str] = { "GdalMetaDataList", "GdalMetaDataRegular", "GdalMetaDataStatic", "GdalMetadataNetCdfCf", "MockMetaData", "OgrMetaData" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -70,9 +68,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = MetaDataDefinition.construct() + instance = MetaDataDefinition.model_construct() error_messages = [] match = 0 # validate data type: MockMetaData @@ -115,13 +113,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> MetaDataDefinition: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> MetaDataDefinition: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = MetaDataDefinition.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -140,11 +138,6 @@ def from_json(cls, json_str: str) -> MetaDataDefinition: instance.actual_instance = GdalMetaDataRegular.from_json(json_str) return instance - # check if data type is `GdalMetaDataStatic` - if _data_type == "GdalMetaDataStatic": - instance.actual_instance = GdalMetaDataStatic.from_json(json_str) - return instance - # check if data type is `GdalMetadataNetCdfCf` if _data_type == "GdalMetadataNetCdfCf": instance.actual_instance = GdalMetadataNetCdfCf.from_json(json_str) @@ -165,6 +158,11 @@ def from_json(cls, json_str: str) -> MetaDataDefinition: instance.actual_instance = OgrMetaData.from_json(json_str) return instance + # check if data type is `GdalMetaDataStatic` + if _data_type == "GdalMetaDataStatic": + instance.actual_instance = GdalMetaDataStatic.from_json(json_str) + return instance + # deserialize data into MockMetaData try: instance.actual_instance = MockMetaData.from_json(json_str) @@ -216,19 +214,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], GdalMetaDataList, GdalMetaDataRegular, GdalMetaDataStatic, GdalMetadataNetCdfCf, MockMetaData, OgrMetaData]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -236,6 +232,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/meta_data_suggestion.py b/python/geoengine_openapi_client/models/meta_data_suggestion.py index e75453ba..14a5d587 100644 --- a/python/geoengine_openapi_client/models/meta_data_suggestion.py +++ b/python/geoengine_openapi_client/models/meta_data_suggestion.py @@ -18,62 +18,78 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.meta_data_definition import MetaDataDefinition +from typing import Optional, Set +from typing_extensions import Self class MetaDataSuggestion(BaseModel): """ MetaDataSuggestion - """ - layer_name: StrictStr = Field(..., alias="layerName") - main_file: StrictStr = Field(..., alias="mainFile") - meta_data: MetaDataDefinition = Field(..., alias="metaData") - __properties = ["layerName", "mainFile", "metaData"] + """ # noqa: E501 + layer_name: StrictStr = Field(alias="layerName") + main_file: StrictStr = Field(alias="mainFile") + meta_data: MetaDataDefinition = Field(alias="metaData") + __properties: ClassVar[List[str]] = ["layerName", "mainFile", "metaData"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> MetaDataSuggestion: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MetaDataSuggestion 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of meta_data if self.meta_data: _dict['metaData'] = self.meta_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> MetaDataSuggestion: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MetaDataSuggestion from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MetaDataSuggestion.parse_obj(obj) + return cls.model_validate(obj) - _obj = MetaDataSuggestion.parse_obj({ - "layer_name": obj.get("layerName"), - "main_file": obj.get("mainFile"), - "meta_data": MetaDataDefinition.from_dict(obj.get("metaData")) if obj.get("metaData") is not None else None + _obj = cls.model_validate({ + "layerName": obj.get("layerName"), + "mainFile": obj.get("mainFile"), + "metaData": MetaDataDefinition.from_dict(obj["metaData"]) if obj.get("metaData") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/ml_model.py b/python/geoengine_openapi_client/models/ml_model.py index f4b3093d..4e9068fb 100644 --- a/python/geoengine_openapi_client/models/ml_model.py +++ b/python/geoengine_openapi_client/models/ml_model.py @@ -18,64 +18,80 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.ml_model_metadata import MlModelMetadata +from typing import Optional, Set +from typing_extensions import Self class MlModel(BaseModel): """ MlModel - """ - description: StrictStr = Field(...) - display_name: StrictStr = Field(..., alias="displayName") - metadata: MlModelMetadata = Field(...) - name: StrictStr = Field(...) - upload: StrictStr = Field(...) - __properties = ["description", "displayName", "metadata", "name", "upload"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + description: StrictStr + display_name: StrictStr = Field(alias="displayName") + metadata: MlModelMetadata + name: StrictStr + upload: StrictStr + __properties: ClassVar[List[str]] = ["description", "displayName", "metadata", "name", "upload"] + + 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.dict(by_alias=True)) + 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) -> MlModel: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MlModel 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> MlModel: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MlModel from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MlModel.parse_obj(obj) + return cls.model_validate(obj) - _obj = MlModel.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), - "display_name": obj.get("displayName"), - "metadata": MlModelMetadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None, + "displayName": obj.get("displayName"), + "metadata": MlModelMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, "name": obj.get("name"), "upload": obj.get("upload") }) diff --git a/python/geoengine_openapi_client/models/ml_model_metadata.py b/python/geoengine_openapi_client/models/ml_model_metadata.py index 308a5052..7587f379 100644 --- a/python/geoengine_openapi_client/models/ml_model_metadata.py +++ b/python/geoengine_openapi_client/models/ml_model_metadata.py @@ -18,61 +18,78 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, conint +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from geoengine_openapi_client.models.raster_data_type import RasterDataType +from typing import Optional, Set +from typing_extensions import Self class MlModelMetadata(BaseModel): """ MlModelMetadata - """ - file_name: StrictStr = Field(..., alias="fileName") - input_type: RasterDataType = Field(..., alias="inputType") - num_input_bands: conint(strict=True, ge=0) = Field(..., alias="numInputBands") - output_type: RasterDataType = Field(..., alias="outputType") - __properties = ["fileName", "inputType", "numInputBands", "outputType"] + """ # noqa: E501 + file_name: StrictStr = Field(alias="fileName") + input_type: RasterDataType = Field(alias="inputType") + num_input_bands: Annotated[int, Field(strict=True, ge=0)] = Field(alias="numInputBands") + output_type: RasterDataType = Field(alias="outputType") + __properties: ClassVar[List[str]] = ["fileName", "inputType", "numInputBands", "outputType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> MlModelMetadata: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MlModelMetadata 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) + 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: dict) -> MlModelMetadata: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MlModelMetadata from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MlModelMetadata.parse_obj(obj) + return cls.model_validate(obj) - _obj = MlModelMetadata.parse_obj({ - "file_name": obj.get("fileName"), - "input_type": obj.get("inputType"), - "num_input_bands": obj.get("numInputBands"), - "output_type": obj.get("outputType") + _obj = cls.model_validate({ + "fileName": obj.get("fileName"), + "inputType": obj.get("inputType"), + "numInputBands": obj.get("numInputBands"), + "outputType": obj.get("outputType") }) return _obj diff --git a/python/geoengine_openapi_client/models/ml_model_name_response.py b/python/geoengine_openapi_client/models/ml_model_name_response.py index 87b46c69..a9746c50 100644 --- a/python/geoengine_openapi_client/models/ml_model_name_response.py +++ b/python/geoengine_openapi_client/models/ml_model_name_response.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +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 MlModelNameResponse(BaseModel): """ MlModelNameResponse - """ - ml_model_name: StrictStr = Field(..., alias="mlModelName") - __properties = ["mlModelName"] + """ # noqa: E501 + ml_model_name: StrictStr = Field(alias="mlModelName") + __properties: ClassVar[List[str]] = ["mlModelName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> MlModelNameResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MlModelNameResponse 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) + 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: dict) -> MlModelNameResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MlModelNameResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MlModelNameResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = MlModelNameResponse.parse_obj({ - "ml_model_name": obj.get("mlModelName") + _obj = cls.model_validate({ + "mlModelName": obj.get("mlModelName") }) return _obj diff --git a/python/geoengine_openapi_client/models/ml_model_resource.py b/python/geoengine_openapi_client/models/ml_model_resource.py index e5072648..bd6eccfd 100644 --- a/python/geoengine_openapi_client/models/ml_model_resource.py +++ b/python/geoengine_openapi_client/models/ml_model_resource.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class MlModelResource(BaseModel): """ MlModelResource - """ - id: StrictStr = Field(...) - type: StrictStr = Field(...) - __properties = ["id", "type"] + """ # noqa: E501 + id: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["id", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('mlModel'): + if value not in set(['mlModel']): raise ValueError("must be one of enum values ('mlModel')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> MlModelResource: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MlModelResource 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) + 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: dict) -> MlModelResource: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MlModelResource from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MlModelResource.parse_obj(obj) + return cls.model_validate(obj) - _obj = MlModelResource.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/mock_dataset_data_source_loading_info.py b/python/geoengine_openapi_client/models/mock_dataset_data_source_loading_info.py index b6763f75..924098dd 100644 --- a/python/geoengine_openapi_client/models/mock_dataset_data_source_loading_info.py +++ b/python/geoengine_openapi_client/models/mock_dataset_data_source_loading_info.py @@ -18,62 +18,78 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.coordinate2_d import Coordinate2D +from typing import Optional, Set +from typing_extensions import Self class MockDatasetDataSourceLoadingInfo(BaseModel): """ MockDatasetDataSourceLoadingInfo - """ - points: conlist(Coordinate2D) = Field(...) - __properties = ["points"] + """ # noqa: E501 + points: List[Coordinate2D] + __properties: ClassVar[List[str]] = ["points"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> MockDatasetDataSourceLoadingInfo: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MockDatasetDataSourceLoadingInfo 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in points (list) _items = [] if self.points: - for _item in self.points: - if _item: - _items.append(_item.to_dict()) + for _item_points in self.points: + if _item_points: + _items.append(_item_points.to_dict()) _dict['points'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> MockDatasetDataSourceLoadingInfo: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MockDatasetDataSourceLoadingInfo from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MockDatasetDataSourceLoadingInfo.parse_obj(obj) + return cls.model_validate(obj) - _obj = MockDatasetDataSourceLoadingInfo.parse_obj({ - "points": [Coordinate2D.from_dict(_item) for _item in obj.get("points")] if obj.get("points") is not None else None + _obj = cls.model_validate({ + "points": [Coordinate2D.from_dict(_item) for _item in obj["points"]] if obj.get("points") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/mock_meta_data.py b/python/geoengine_openapi_client/models/mock_meta_data.py index 7fdcf25c..706407ff 100644 --- a/python/geoengine_openapi_client/models/mock_meta_data.py +++ b/python/geoengine_openapi_client/models/mock_meta_data.py @@ -18,52 +18,68 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.mock_dataset_data_source_loading_info import MockDatasetDataSourceLoadingInfo from geoengine_openapi_client.models.vector_result_descriptor import VectorResultDescriptor +from typing import Optional, Set +from typing_extensions import Self class MockMetaData(BaseModel): """ MockMetaData - """ - loading_info: MockDatasetDataSourceLoadingInfo = Field(..., alias="loadingInfo") - result_descriptor: VectorResultDescriptor = Field(..., alias="resultDescriptor") - type: StrictStr = Field(...) - __properties = ["loadingInfo", "resultDescriptor", "type"] + """ # noqa: E501 + loading_info: MockDatasetDataSourceLoadingInfo = Field(alias="loadingInfo") + result_descriptor: VectorResultDescriptor = Field(alias="resultDescriptor") + type: StrictStr + __properties: ClassVar[List[str]] = ["loadingInfo", "resultDescriptor", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('MockMetaData', 'OgrMetaData', 'GdalMetaDataRegular', 'GdalStatic', 'GdalMetadataNetCdfCf', 'GdalMetaDataList'): - raise ValueError("must be one of enum values ('MockMetaData', 'OgrMetaData', 'GdalMetaDataRegular', 'GdalStatic', 'GdalMetadataNetCdfCf', 'GdalMetaDataList')") + if value not in set(['MockMetaData']): + raise ValueError("must be one of enum values ('MockMetaData')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> MockMetaData: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MockMetaData 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of loading_info if self.loading_info: _dict['loadingInfo'] = self.loading_info.to_dict() @@ -73,17 +89,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> MockMetaData: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MockMetaData from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MockMetaData.parse_obj(obj) + return cls.model_validate(obj) - _obj = MockMetaData.parse_obj({ - "loading_info": MockDatasetDataSourceLoadingInfo.from_dict(obj.get("loadingInfo")) if obj.get("loadingInfo") is not None else None, - "result_descriptor": VectorResultDescriptor.from_dict(obj.get("resultDescriptor")) if obj.get("resultDescriptor") is not None else None, + _obj = cls.model_validate({ + "loadingInfo": MockDatasetDataSourceLoadingInfo.from_dict(obj["loadingInfo"]) if obj.get("loadingInfo") is not None else None, + "resultDescriptor": VectorResultDescriptor.from_dict(obj["resultDescriptor"]) if obj.get("resultDescriptor") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/multi_band_raster_colorizer.py b/python/geoengine_openapi_client/models/multi_band_raster_colorizer.py index 873c4f3f..cc332b03 100644 --- a/python/geoengine_openapi_client/models/multi_band_raster_colorizer.py +++ b/python/geoengine_openapi_client/models/multi_band_raster_colorizer.py @@ -18,86 +18,103 @@ import re # noqa: F401 import json - -from typing import List, Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conint, conlist, validator +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class MultiBandRasterColorizer(BaseModel): """ MultiBandRasterColorizer - """ - blue_band: conint(strict=True, ge=0) = Field(..., alias="blueBand", description="The band index of the blue channel.") - blue_max: Union[StrictFloat, StrictInt] = Field(..., alias="blueMax", description="The maximum value for the red channel.") - blue_min: Union[StrictFloat, StrictInt] = Field(..., alias="blueMin", description="The minimum value for the red channel.") - blue_scale: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="blueScale", description="A scaling factor for the blue channel between 0 and 1.") - green_band: conint(strict=True, ge=0) = Field(..., alias="greenBand", description="The band index of the green channel.") - green_max: Union[StrictFloat, StrictInt] = Field(..., alias="greenMax", description="The maximum value for the red channel.") - green_min: Union[StrictFloat, StrictInt] = Field(..., alias="greenMin", description="The minimum value for the red channel.") - green_scale: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="greenScale", description="A scaling factor for the green channel between 0 and 1.") - no_data_color: Optional[conlist(StrictInt, max_items=4, min_items=4)] = Field(None, alias="noDataColor") - red_band: conint(strict=True, ge=0) = Field(..., alias="redBand", description="The band index of the red channel.") - red_max: Union[StrictFloat, StrictInt] = Field(..., alias="redMax", description="The maximum value for the red channel.") - red_min: Union[StrictFloat, StrictInt] = Field(..., alias="redMin", description="The minimum value for the red channel.") - red_scale: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="redScale", description="A scaling factor for the red channel between 0 and 1.") - type: StrictStr = Field(...) - __properties = ["blueBand", "blueMax", "blueMin", "blueScale", "greenBand", "greenMax", "greenMin", "greenScale", "noDataColor", "redBand", "redMax", "redMin", "redScale", "type"] - - @validator('type') + """ # noqa: E501 + blue_band: Annotated[int, Field(strict=True, ge=0)] = Field(description="The band index of the blue channel.", alias="blueBand") + blue_max: Union[StrictFloat, StrictInt] = Field(description="The maximum value for the red channel.", alias="blueMax") + blue_min: Union[StrictFloat, StrictInt] = Field(description="The minimum value for the red channel.", alias="blueMin") + blue_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="A scaling factor for the blue channel between 0 and 1.", alias="blueScale") + green_band: Annotated[int, Field(strict=True, ge=0)] = Field(description="The band index of the green channel.", alias="greenBand") + green_max: Union[StrictFloat, StrictInt] = Field(description="The maximum value for the red channel.", alias="greenMax") + green_min: Union[StrictFloat, StrictInt] = Field(description="The minimum value for the red channel.", alias="greenMin") + green_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="A scaling factor for the green channel between 0 and 1.", alias="greenScale") + no_data_color: Optional[Annotated[List[StrictInt], Field(min_length=4, max_length=4)]] = Field(default=None, alias="noDataColor") + red_band: Annotated[int, Field(strict=True, ge=0)] = Field(description="The band index of the red channel.", alias="redBand") + red_max: Union[StrictFloat, StrictInt] = Field(description="The maximum value for the red channel.", alias="redMax") + red_min: Union[StrictFloat, StrictInt] = Field(description="The minimum value for the red channel.", alias="redMin") + red_scale: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="A scaling factor for the red channel between 0 and 1.", alias="redScale") + type: StrictStr + __properties: ClassVar[List[str]] = ["blueBand", "blueMax", "blueMin", "blueScale", "greenBand", "greenMax", "greenMin", "greenScale", "noDataColor", "redBand", "redMax", "redMin", "redScale", "type"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('multiBand'): + if value not in set(['multiBand']): raise ValueError("must be one of enum values ('multiBand')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> MultiBandRasterColorizer: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MultiBandRasterColorizer 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) + 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: dict) -> MultiBandRasterColorizer: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MultiBandRasterColorizer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MultiBandRasterColorizer.parse_obj(obj) - - _obj = MultiBandRasterColorizer.parse_obj({ - "blue_band": obj.get("blueBand"), - "blue_max": obj.get("blueMax"), - "blue_min": obj.get("blueMin"), - "blue_scale": obj.get("blueScale"), - "green_band": obj.get("greenBand"), - "green_max": obj.get("greenMax"), - "green_min": obj.get("greenMin"), - "green_scale": obj.get("greenScale"), - "no_data_color": obj.get("noDataColor"), - "red_band": obj.get("redBand"), - "red_max": obj.get("redMax"), - "red_min": obj.get("redMin"), - "red_scale": obj.get("redScale"), + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "blueBand": obj.get("blueBand"), + "blueMax": obj.get("blueMax"), + "blueMin": obj.get("blueMin"), + "blueScale": obj.get("blueScale"), + "greenBand": obj.get("greenBand"), + "greenMax": obj.get("greenMax"), + "greenMin": obj.get("greenMin"), + "greenScale": obj.get("greenScale"), + "noDataColor": obj.get("noDataColor"), + "redBand": obj.get("redBand"), + "redMax": obj.get("redMax"), + "redMin": obj.get("redMin"), + "redScale": obj.get("redScale"), "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/multi_line_string.py b/python/geoengine_openapi_client/models/multi_line_string.py index 79686dde..d164f2ce 100644 --- a/python/geoengine_openapi_client/models/multi_line_string.py +++ b/python/geoengine_openapi_client/models/multi_line_string.py @@ -18,66 +18,82 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.coordinate2_d import Coordinate2D +from typing import Optional, Set +from typing_extensions import Self class MultiLineString(BaseModel): """ MultiLineString - """ - coordinates: conlist(conlist(Coordinate2D)) = Field(...) - __properties = ["coordinates"] + """ # noqa: E501 + coordinates: List[List[Coordinate2D]] + __properties: ClassVar[List[str]] = ["coordinates"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> MultiLineString: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MultiLineString 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in coordinates (list of list) _items = [] if self.coordinates: - for _item in self.coordinates: - if _item: + for _item_coordinates in self.coordinates: + if _item_coordinates: _items.append( - [_inner_item.to_dict() for _inner_item in _item if _inner_item is not None] + [_inner_item.to_dict() for _inner_item in _item_coordinates if _inner_item is not None] ) _dict['coordinates'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> MultiLineString: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MultiLineString from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MultiLineString.parse_obj(obj) + return cls.model_validate(obj) - _obj = MultiLineString.parse_obj({ + _obj = cls.model_validate({ "coordinates": [ [Coordinate2D.from_dict(_inner_item) for _inner_item in _item] - for _item in obj.get("coordinates") + for _item in obj["coordinates"] ] if obj.get("coordinates") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/multi_point.py b/python/geoengine_openapi_client/models/multi_point.py index d16a104b..4d9c2b81 100644 --- a/python/geoengine_openapi_client/models/multi_point.py +++ b/python/geoengine_openapi_client/models/multi_point.py @@ -18,62 +18,78 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.coordinate2_d import Coordinate2D +from typing import Optional, Set +from typing_extensions import Self class MultiPoint(BaseModel): """ MultiPoint - """ - coordinates: conlist(Coordinate2D) = Field(...) - __properties = ["coordinates"] + """ # noqa: E501 + coordinates: List[Coordinate2D] + __properties: ClassVar[List[str]] = ["coordinates"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> MultiPoint: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MultiPoint 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in coordinates (list) _items = [] if self.coordinates: - for _item in self.coordinates: - if _item: - _items.append(_item.to_dict()) + for _item_coordinates in self.coordinates: + if _item_coordinates: + _items.append(_item_coordinates.to_dict()) _dict['coordinates'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> MultiPoint: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MultiPoint from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MultiPoint.parse_obj(obj) + return cls.model_validate(obj) - _obj = MultiPoint.parse_obj({ - "coordinates": [Coordinate2D.from_dict(_item) for _item in obj.get("coordinates")] if obj.get("coordinates") is not None else None + _obj = cls.model_validate({ + "coordinates": [Coordinate2D.from_dict(_item) for _item in obj["coordinates"]] if obj.get("coordinates") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/multi_polygon.py b/python/geoengine_openapi_client/models/multi_polygon.py index 0d92d176..ce9105ca 100644 --- a/python/geoengine_openapi_client/models/multi_polygon.py +++ b/python/geoengine_openapi_client/models/multi_polygon.py @@ -18,66 +18,82 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.coordinate2_d import Coordinate2D +from typing import Optional, Set +from typing_extensions import Self class MultiPolygon(BaseModel): """ MultiPolygon - """ - polygons: conlist(conlist(conlist(Coordinate2D))) = Field(...) - __properties = ["polygons"] + """ # noqa: E501 + polygons: List[List[List[Coordinate2D]]] + __properties: ClassVar[List[str]] = ["polygons"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> MultiPolygon: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MultiPolygon 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in polygons (list of list) _items = [] if self.polygons: - for _item in self.polygons: - if _item: + for _item_polygons in self.polygons: + if _item_polygons: _items.append( - [_inner_item.to_dict() for _inner_item in _item if _inner_item is not None] + [_inner_item.to_dict() for _inner_item in _item_polygons if _inner_item is not None] ) _dict['polygons'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> MultiPolygon: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MultiPolygon from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MultiPolygon.parse_obj(obj) + return cls.model_validate(obj) - _obj = MultiPolygon.parse_obj({ + _obj = cls.model_validate({ "polygons": [ [List[Coordinate2D].from_dict(_inner_item) for _inner_item in _item] - for _item in obj.get("polygons") + for _item in obj["polygons"] ] if obj.get("polygons") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/number_param.py b/python/geoengine_openapi_client/models/number_param.py index c68b0869..58875910 100644 --- a/python/geoengine_openapi_client/models/number_param.py +++ b/python/geoengine_openapi_client/models/number_param.py @@ -14,17 +14,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.derived_number import DerivedNumber from geoengine_openapi_client.models.static_number_param import StaticNumberParam -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self NUMBERPARAM_ONE_OF_SCHEMAS = ["DerivedNumber", "StaticNumberParam"] @@ -36,16 +34,16 @@ class NumberParam(BaseModel): oneof_schema_1_validator: Optional[StaticNumberParam] = None # data type: DerivedNumber oneof_schema_2_validator: Optional[DerivedNumber] = None - if TYPE_CHECKING: - actual_instance: Union[DerivedNumber, StaticNumberParam] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(NUMBERPARAM_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[DerivedNumber, StaticNumberParam]] = None + one_of_schemas: Set[str] = { "DerivedNumber", "StaticNumberParam" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -58,9 +56,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = NumberParam.construct() + instance = NumberParam.model_construct() error_messages = [] match = 0 # validate data type: StaticNumberParam @@ -83,13 +81,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> NumberParam: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> NumberParam: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = NumberParam.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -99,22 +97,22 @@ def from_json(cls, json_str: str) -> NumberParam: raise ValueError("Failed to lookup data type from the field `type` in the input.") # check if data type is `DerivedNumber` - if _data_type == "DerivedNumber": + if _data_type == "derived": instance.actual_instance = DerivedNumber.from_json(json_str) return instance # check if data type is `StaticNumberParam` - if _data_type == "StaticNumberParam": + if _data_type == "static": instance.actual_instance = StaticNumberParam.from_json(json_str) return instance # check if data type is `DerivedNumber` - if _data_type == "derived": + if _data_type == "DerivedNumber": instance.actual_instance = DerivedNumber.from_json(json_str) return instance # check if data type is `StaticNumberParam` - if _data_type == "static": + if _data_type == "StaticNumberParam": instance.actual_instance = StaticNumberParam.from_json(json_str) return instance @@ -145,19 +143,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], DerivedNumber, StaticNumberParam]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -165,6 +161,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/ogr_meta_data.py b/python/geoengine_openapi_client/models/ogr_meta_data.py index 273f99b5..77824f70 100644 --- a/python/geoengine_openapi_client/models/ogr_meta_data.py +++ b/python/geoengine_openapi_client/models/ogr_meta_data.py @@ -18,52 +18,68 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.ogr_source_dataset import OgrSourceDataset from geoengine_openapi_client.models.vector_result_descriptor import VectorResultDescriptor +from typing import Optional, Set +from typing_extensions import Self class OgrMetaData(BaseModel): """ OgrMetaData - """ - loading_info: OgrSourceDataset = Field(..., alias="loadingInfo") - result_descriptor: VectorResultDescriptor = Field(..., alias="resultDescriptor") - type: StrictStr = Field(...) - __properties = ["loadingInfo", "resultDescriptor", "type"] + """ # noqa: E501 + loading_info: OgrSourceDataset = Field(alias="loadingInfo") + result_descriptor: VectorResultDescriptor = Field(alias="resultDescriptor") + type: StrictStr + __properties: ClassVar[List[str]] = ["loadingInfo", "resultDescriptor", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('OgrMetaData'): + if value not in set(['OgrMetaData']): raise ValueError("must be one of enum values ('OgrMetaData')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> OgrMetaData: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrMetaData 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of loading_info if self.loading_info: _dict['loadingInfo'] = self.loading_info.to_dict() @@ -73,17 +89,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> OgrMetaData: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrMetaData from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrMetaData.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrMetaData.parse_obj({ - "loading_info": OgrSourceDataset.from_dict(obj.get("loadingInfo")) if obj.get("loadingInfo") is not None else None, - "result_descriptor": VectorResultDescriptor.from_dict(obj.get("resultDescriptor")) if obj.get("resultDescriptor") is not None else None, + _obj = cls.model_validate({ + "loadingInfo": OgrSourceDataset.from_dict(obj["loadingInfo"]) if obj.get("loadingInfo") is not None else None, + "resultDescriptor": VectorResultDescriptor.from_dict(obj["resultDescriptor"]) if obj.get("resultDescriptor") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/ogr_source_column_spec.py b/python/geoengine_openapi_client/models/ogr_source_column_spec.py index 6c46d33a..ba5ff4ea 100644 --- a/python/geoengine_openapi_client/models/ogr_source_column_spec.py +++ b/python/geoengine_openapi_client/models/ogr_source_column_spec.py @@ -18,84 +18,100 @@ import re # noqa: F401 import json - -from typing import Dict, List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.format_specifics import FormatSpecifics +from typing import Optional, Set +from typing_extensions import Self class OgrSourceColumnSpec(BaseModel): """ OgrSourceColumnSpec - """ - bool: Optional[conlist(StrictStr)] = None - datetime: Optional[conlist(StrictStr)] = None - float: Optional[conlist(StrictStr)] = None - format_specifics: Optional[FormatSpecifics] = Field(None, alias="formatSpecifics") - int: Optional[conlist(StrictStr)] = None + """ # noqa: E501 + bool: Optional[List[StrictStr]] = None + datetime: Optional[List[StrictStr]] = None + var_float: Optional[List[StrictStr]] = Field(default=None, alias="float") + format_specifics: Optional[FormatSpecifics] = Field(default=None, alias="formatSpecifics") + int: Optional[List[StrictStr]] = None rename: Optional[Dict[str, StrictStr]] = None - text: Optional[conlist(StrictStr)] = None - x: StrictStr = Field(...) + text: Optional[List[StrictStr]] = None + x: StrictStr y: Optional[StrictStr] = None - __properties = ["bool", "datetime", "float", "formatSpecifics", "int", "rename", "text", "x", "y"] + __properties: ClassVar[List[str]] = ["bool", "datetime", "float", "formatSpecifics", "int", "rename", "text", "x", "y"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> OgrSourceColumnSpec: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceColumnSpec 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of format_specifics if self.format_specifics: _dict['formatSpecifics'] = self.format_specifics.to_dict() # set to None if format_specifics (nullable) is None - # and __fields_set__ contains the field - if self.format_specifics is None and "format_specifics" in self.__fields_set__: + # and model_fields_set contains the field + if self.format_specifics is None and "format_specifics" in self.model_fields_set: _dict['formatSpecifics'] = None # set to None if rename (nullable) is None - # and __fields_set__ contains the field - if self.rename is None and "rename" in self.__fields_set__: + # and model_fields_set contains the field + if self.rename is None and "rename" in self.model_fields_set: _dict['rename'] = None # set to None if y (nullable) is None - # and __fields_set__ contains the field - if self.y is None and "y" in self.__fields_set__: + # and model_fields_set contains the field + if self.y is None and "y" in self.model_fields_set: _dict['y'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> OgrSourceColumnSpec: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceColumnSpec from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceColumnSpec.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrSourceColumnSpec.parse_obj({ + _obj = cls.model_validate({ "bool": obj.get("bool"), "datetime": obj.get("datetime"), "float": obj.get("float"), - "format_specifics": FormatSpecifics.from_dict(obj.get("formatSpecifics")) if obj.get("formatSpecifics") is not None else None, + "formatSpecifics": FormatSpecifics.from_dict(obj["formatSpecifics"]) if obj.get("formatSpecifics") is not None else None, "int": obj.get("int"), "rename": obj.get("rename"), "text": obj.get("text"), diff --git a/python/geoengine_openapi_client/models/ogr_source_dataset.py b/python/geoengine_openapi_client/models/ogr_source_dataset.py index a951f582..b54dac6a 100644 --- a/python/geoengine_openapi_client/models/ogr_source_dataset.py +++ b/python/geoengine_openapi_client/models/ogr_source_dataset.py @@ -18,57 +18,74 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conint +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.ogr_source_column_spec import OgrSourceColumnSpec from geoengine_openapi_client.models.ogr_source_dataset_time_type import OgrSourceDatasetTimeType from geoengine_openapi_client.models.ogr_source_error_spec import OgrSourceErrorSpec from geoengine_openapi_client.models.typed_geometry import TypedGeometry from geoengine_openapi_client.models.vector_data_type import VectorDataType +from typing import Optional, Set +from typing_extensions import Self class OgrSourceDataset(BaseModel): """ OgrSourceDataset - """ - attribute_query: Optional[StrictStr] = Field(None, alias="attributeQuery") - cache_ttl: Optional[conint(strict=True, ge=0)] = Field(None, alias="cacheTtl") + """ # noqa: E501 + attribute_query: Optional[StrictStr] = Field(default=None, alias="attributeQuery") + cache_ttl: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, alias="cacheTtl") columns: Optional[OgrSourceColumnSpec] = None - data_type: Optional[VectorDataType] = Field(None, alias="dataType") - default_geometry: Optional[TypedGeometry] = Field(None, alias="defaultGeometry") - file_name: StrictStr = Field(..., alias="fileName") - force_ogr_spatial_filter: Optional[StrictBool] = Field(None, alias="forceOgrSpatialFilter") - force_ogr_time_filter: Optional[StrictBool] = Field(None, alias="forceOgrTimeFilter") - layer_name: StrictStr = Field(..., alias="layerName") - on_error: OgrSourceErrorSpec = Field(..., alias="onError") - sql_query: Optional[StrictStr] = Field(None, alias="sqlQuery") + data_type: Optional[VectorDataType] = Field(default=None, alias="dataType") + default_geometry: Optional[TypedGeometry] = Field(default=None, alias="defaultGeometry") + file_name: StrictStr = Field(alias="fileName") + force_ogr_spatial_filter: Optional[StrictBool] = Field(default=None, alias="forceOgrSpatialFilter") + force_ogr_time_filter: Optional[StrictBool] = Field(default=None, alias="forceOgrTimeFilter") + layer_name: StrictStr = Field(alias="layerName") + on_error: OgrSourceErrorSpec = Field(alias="onError") + sql_query: Optional[StrictStr] = Field(default=None, alias="sqlQuery") time: Optional[OgrSourceDatasetTimeType] = None - __properties = ["attributeQuery", "cacheTtl", "columns", "dataType", "defaultGeometry", "fileName", "forceOgrSpatialFilter", "forceOgrTimeFilter", "layerName", "onError", "sqlQuery", "time"] + __properties: ClassVar[List[str]] = ["attributeQuery", "cacheTtl", "columns", "dataType", "defaultGeometry", "fileName", "forceOgrSpatialFilter", "forceOgrTimeFilter", "layerName", "onError", "sqlQuery", "time"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> OgrSourceDataset: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceDataset 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of columns if self.columns: _dict['columns'] = self.columns.to_dict() @@ -79,54 +96,54 @@ def to_dict(self): if self.time: _dict['time'] = self.time.to_dict() # set to None if attribute_query (nullable) is None - # and __fields_set__ contains the field - if self.attribute_query is None and "attribute_query" in self.__fields_set__: + # and model_fields_set contains the field + if self.attribute_query is None and "attribute_query" in self.model_fields_set: _dict['attributeQuery'] = None # set to None if columns (nullable) is None - # and __fields_set__ contains the field - if self.columns is None and "columns" in self.__fields_set__: + # and model_fields_set contains the field + if self.columns is None and "columns" in self.model_fields_set: _dict['columns'] = None # set to None if data_type (nullable) is None - # and __fields_set__ contains the field - if self.data_type is None and "data_type" in self.__fields_set__: + # and model_fields_set contains the field + if self.data_type is None and "data_type" in self.model_fields_set: _dict['dataType'] = None # set to None if default_geometry (nullable) is None - # and __fields_set__ contains the field - if self.default_geometry is None and "default_geometry" in self.__fields_set__: + # and model_fields_set contains the field + if self.default_geometry is None and "default_geometry" in self.model_fields_set: _dict['defaultGeometry'] = None # set to None if sql_query (nullable) is None - # and __fields_set__ contains the field - if self.sql_query is None and "sql_query" in self.__fields_set__: + # and model_fields_set contains the field + if self.sql_query is None and "sql_query" in self.model_fields_set: _dict['sqlQuery'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> OgrSourceDataset: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceDataset from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceDataset.parse_obj(obj) - - _obj = OgrSourceDataset.parse_obj({ - "attribute_query": obj.get("attributeQuery"), - "cache_ttl": obj.get("cacheTtl"), - "columns": OgrSourceColumnSpec.from_dict(obj.get("columns")) if obj.get("columns") is not None else None, - "data_type": obj.get("dataType"), - "default_geometry": TypedGeometry.from_dict(obj.get("defaultGeometry")) if obj.get("defaultGeometry") is not None else None, - "file_name": obj.get("fileName"), - "force_ogr_spatial_filter": obj.get("forceOgrSpatialFilter"), - "force_ogr_time_filter": obj.get("forceOgrTimeFilter"), - "layer_name": obj.get("layerName"), - "on_error": obj.get("onError"), - "sql_query": obj.get("sqlQuery"), - "time": OgrSourceDatasetTimeType.from_dict(obj.get("time")) if obj.get("time") is not None else None + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attributeQuery": obj.get("attributeQuery"), + "cacheTtl": obj.get("cacheTtl"), + "columns": OgrSourceColumnSpec.from_dict(obj["columns"]) if obj.get("columns") is not None else None, + "dataType": obj.get("dataType"), + "defaultGeometry": TypedGeometry.from_dict(obj["defaultGeometry"]) if obj.get("defaultGeometry") is not None else None, + "fileName": obj.get("fileName"), + "forceOgrSpatialFilter": obj.get("forceOgrSpatialFilter"), + "forceOgrTimeFilter": obj.get("forceOgrTimeFilter"), + "layerName": obj.get("layerName"), + "onError": obj.get("onError"), + "sqlQuery": obj.get("sqlQuery"), + "time": OgrSourceDatasetTimeType.from_dict(obj["time"]) if obj.get("time") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/ogr_source_dataset_time_type.py b/python/geoengine_openapi_client/models/ogr_source_dataset_time_type.py index 6521cce2..84f85813 100644 --- a/python/geoengine_openapi_client/models/ogr_source_dataset_time_type.py +++ b/python/geoengine_openapi_client/models/ogr_source_dataset_time_type.py @@ -14,19 +14,17 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.ogr_source_dataset_time_type_none import OgrSourceDatasetTimeTypeNone from geoengine_openapi_client.models.ogr_source_dataset_time_type_start import OgrSourceDatasetTimeTypeStart from geoengine_openapi_client.models.ogr_source_dataset_time_type_start_duration import OgrSourceDatasetTimeTypeStartDuration from geoengine_openapi_client.models.ogr_source_dataset_time_type_start_end import OgrSourceDatasetTimeTypeStartEnd -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self OGRSOURCEDATASETTIMETYPE_ONE_OF_SCHEMAS = ["OgrSourceDatasetTimeTypeNone", "OgrSourceDatasetTimeTypeStart", "OgrSourceDatasetTimeTypeStartDuration", "OgrSourceDatasetTimeTypeStartEnd"] @@ -42,16 +40,16 @@ class OgrSourceDatasetTimeType(BaseModel): oneof_schema_3_validator: Optional[OgrSourceDatasetTimeTypeStartEnd] = None # data type: OgrSourceDatasetTimeTypeStartDuration oneof_schema_4_validator: Optional[OgrSourceDatasetTimeTypeStartDuration] = None - if TYPE_CHECKING: - actual_instance: Union[OgrSourceDatasetTimeTypeNone, OgrSourceDatasetTimeTypeStart, OgrSourceDatasetTimeTypeStartDuration, OgrSourceDatasetTimeTypeStartEnd] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(OGRSOURCEDATASETTIMETYPE_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[OgrSourceDatasetTimeTypeNone, OgrSourceDatasetTimeTypeStart, OgrSourceDatasetTimeTypeStartDuration, OgrSourceDatasetTimeTypeStartEnd]] = None + one_of_schemas: Set[str] = { "OgrSourceDatasetTimeTypeNone", "OgrSourceDatasetTimeTypeStart", "OgrSourceDatasetTimeTypeStartDuration", "OgrSourceDatasetTimeTypeStartEnd" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -64,9 +62,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = OgrSourceDatasetTimeType.construct() + instance = OgrSourceDatasetTimeType.model_construct() error_messages = [] match = 0 # validate data type: OgrSourceDatasetTimeTypeNone @@ -99,13 +97,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> OgrSourceDatasetTimeType: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> OgrSourceDatasetTimeType: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = OgrSourceDatasetTimeType.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -115,42 +113,42 @@ def from_json(cls, json_str: str) -> OgrSourceDatasetTimeType: raise ValueError("Failed to lookup data type from the field `type` in the input.") # check if data type is `OgrSourceDatasetTimeTypeNone` - if _data_type == "OgrSourceDatasetTimeTypeNone": + if _data_type == "none": instance.actual_instance = OgrSourceDatasetTimeTypeNone.from_json(json_str) return instance # check if data type is `OgrSourceDatasetTimeTypeStart` - if _data_type == "OgrSourceDatasetTimeTypeStart": + if _data_type == "start": instance.actual_instance = OgrSourceDatasetTimeTypeStart.from_json(json_str) return instance # check if data type is `OgrSourceDatasetTimeTypeStartDuration` - if _data_type == "OgrSourceDatasetTimeTypeStartDuration": + if _data_type == "start+duration": instance.actual_instance = OgrSourceDatasetTimeTypeStartDuration.from_json(json_str) return instance # check if data type is `OgrSourceDatasetTimeTypeStartEnd` - if _data_type == "OgrSourceDatasetTimeTypeStartEnd": + if _data_type == "start+end": instance.actual_instance = OgrSourceDatasetTimeTypeStartEnd.from_json(json_str) return instance # check if data type is `OgrSourceDatasetTimeTypeNone` - if _data_type == "none": + if _data_type == "OgrSourceDatasetTimeTypeNone": instance.actual_instance = OgrSourceDatasetTimeTypeNone.from_json(json_str) return instance # check if data type is `OgrSourceDatasetTimeTypeStart` - if _data_type == "start": + if _data_type == "OgrSourceDatasetTimeTypeStart": instance.actual_instance = OgrSourceDatasetTimeTypeStart.from_json(json_str) return instance # check if data type is `OgrSourceDatasetTimeTypeStartDuration` - if _data_type == "start+duration": + if _data_type == "OgrSourceDatasetTimeTypeStartDuration": instance.actual_instance = OgrSourceDatasetTimeTypeStartDuration.from_json(json_str) return instance # check if data type is `OgrSourceDatasetTimeTypeStartEnd` - if _data_type == "start+end": + if _data_type == "OgrSourceDatasetTimeTypeStartEnd": instance.actual_instance = OgrSourceDatasetTimeTypeStartEnd.from_json(json_str) return instance @@ -193,19 +191,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], OgrSourceDatasetTimeTypeNone, OgrSourceDatasetTimeTypeStart, OgrSourceDatasetTimeTypeStartDuration, OgrSourceDatasetTimeTypeStartEnd]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -213,6 +209,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_none.py b/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_none.py index 776ed4ce..f03974c6 100644 --- a/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_none.py +++ b/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_none.py @@ -18,60 +18,76 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class OgrSourceDatasetTimeTypeNone(BaseModel): """ OgrSourceDatasetTimeTypeNone - """ - type: StrictStr = Field(...) - __properties = ["type"] + """ # noqa: E501 + type: StrictStr + __properties: ClassVar[List[str]] = ["type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('none', 'start', 'start+end', 'start+duration'): - raise ValueError("must be one of enum values ('none', 'start', 'start+end', 'start+duration')") + if value not in set(['none']): + raise ValueError("must be one of enum values ('none')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> OgrSourceDatasetTimeTypeNone: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceDatasetTimeTypeNone 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) + 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: dict) -> OgrSourceDatasetTimeTypeNone: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceDatasetTimeTypeNone from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceDatasetTimeTypeNone.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrSourceDatasetTimeTypeNone.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start.py b/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start.py index bd1ad3fa..7107255e 100644 --- a/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start.py +++ b/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.ogr_source_duration_spec import OgrSourceDurationSpec from geoengine_openapi_client.models.ogr_source_time_format import OgrSourceTimeFormat +from typing import Optional, Set +from typing_extensions import Self class OgrSourceDatasetTimeTypeStart(BaseModel): """ OgrSourceDatasetTimeTypeStart - """ - duration: OgrSourceDurationSpec = Field(...) - start_field: StrictStr = Field(..., alias="startField") - start_format: OgrSourceTimeFormat = Field(..., alias="startFormat") - type: StrictStr = Field(...) - __properties = ["duration", "startField", "startFormat", "type"] - - @validator('type') + """ # noqa: E501 + duration: OgrSourceDurationSpec + start_field: StrictStr = Field(alias="startField") + start_format: OgrSourceTimeFormat = Field(alias="startFormat") + type: StrictStr + __properties: ClassVar[List[str]] = ["duration", "startField", "startFormat", "type"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('start'): + if value not in set(['start']): raise ValueError("must be one of enum values ('start')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> OgrSourceDatasetTimeTypeStart: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceDatasetTimeTypeStart 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of duration if self.duration: _dict['duration'] = self.duration.to_dict() @@ -74,18 +90,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> OgrSourceDatasetTimeTypeStart: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceDatasetTimeTypeStart from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceDatasetTimeTypeStart.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrSourceDatasetTimeTypeStart.parse_obj({ - "duration": OgrSourceDurationSpec.from_dict(obj.get("duration")) if obj.get("duration") is not None else None, - "start_field": obj.get("startField"), - "start_format": OgrSourceTimeFormat.from_dict(obj.get("startFormat")) if obj.get("startFormat") is not None else None, + _obj = cls.model_validate({ + "duration": OgrSourceDurationSpec.from_dict(obj["duration"]) if obj.get("duration") is not None else None, + "startField": obj.get("startField"), + "startFormat": OgrSourceTimeFormat.from_dict(obj["startFormat"]) if obj.get("startFormat") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start_duration.py b/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start_duration.py index 687ffcd9..1add572a 100644 --- a/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start_duration.py +++ b/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start_duration.py @@ -18,70 +18,86 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.ogr_source_time_format import OgrSourceTimeFormat +from typing import Optional, Set +from typing_extensions import Self class OgrSourceDatasetTimeTypeStartDuration(BaseModel): """ OgrSourceDatasetTimeTypeStartDuration - """ - duration_field: StrictStr = Field(..., alias="durationField") - start_field: StrictStr = Field(..., alias="startField") - start_format: OgrSourceTimeFormat = Field(..., alias="startFormat") - type: StrictStr = Field(...) - __properties = ["durationField", "startField", "startFormat", "type"] - - @validator('type') + """ # noqa: E501 + duration_field: StrictStr = Field(alias="durationField") + start_field: StrictStr = Field(alias="startField") + start_format: OgrSourceTimeFormat = Field(alias="startFormat") + type: StrictStr + __properties: ClassVar[List[str]] = ["durationField", "startField", "startFormat", "type"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('start+duration'): + if value not in set(['start+duration']): raise ValueError("must be one of enum values ('start+duration')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> OgrSourceDatasetTimeTypeStartDuration: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceDatasetTimeTypeStartDuration 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of start_format if self.start_format: _dict['startFormat'] = self.start_format.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> OgrSourceDatasetTimeTypeStartDuration: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceDatasetTimeTypeStartDuration from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceDatasetTimeTypeStartDuration.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrSourceDatasetTimeTypeStartDuration.parse_obj({ - "duration_field": obj.get("durationField"), - "start_field": obj.get("startField"), - "start_format": OgrSourceTimeFormat.from_dict(obj.get("startFormat")) if obj.get("startFormat") is not None else None, + _obj = cls.model_validate({ + "durationField": obj.get("durationField"), + "startField": obj.get("startField"), + "startFormat": OgrSourceTimeFormat.from_dict(obj["startFormat"]) if obj.get("startFormat") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start_end.py b/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start_end.py index 3e803586..85dfa151 100644 --- a/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start_end.py +++ b/python/geoengine_openapi_client/models/ogr_source_dataset_time_type_start_end.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.ogr_source_time_format import OgrSourceTimeFormat +from typing import Optional, Set +from typing_extensions import Self class OgrSourceDatasetTimeTypeStartEnd(BaseModel): """ OgrSourceDatasetTimeTypeStartEnd - """ - end_field: StrictStr = Field(..., alias="endField") - end_format: OgrSourceTimeFormat = Field(..., alias="endFormat") - start_field: StrictStr = Field(..., alias="startField") - start_format: OgrSourceTimeFormat = Field(..., alias="startFormat") - type: StrictStr = Field(...) - __properties = ["endField", "endFormat", "startField", "startFormat", "type"] - - @validator('type') + """ # noqa: E501 + end_field: StrictStr = Field(alias="endField") + end_format: OgrSourceTimeFormat = Field(alias="endFormat") + start_field: StrictStr = Field(alias="startField") + start_format: OgrSourceTimeFormat = Field(alias="startFormat") + type: StrictStr + __properties: ClassVar[List[str]] = ["endField", "endFormat", "startField", "startFormat", "type"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('start+end'): + if value not in set(['start+end']): raise ValueError("must be one of enum values ('start+end')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> OgrSourceDatasetTimeTypeStartEnd: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceDatasetTimeTypeStartEnd 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of end_format if self.end_format: _dict['endFormat'] = self.end_format.to_dict() @@ -74,19 +90,19 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> OgrSourceDatasetTimeTypeStartEnd: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceDatasetTimeTypeStartEnd from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceDatasetTimeTypeStartEnd.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrSourceDatasetTimeTypeStartEnd.parse_obj({ - "end_field": obj.get("endField"), - "end_format": OgrSourceTimeFormat.from_dict(obj.get("endFormat")) if obj.get("endFormat") is not None else None, - "start_field": obj.get("startField"), - "start_format": OgrSourceTimeFormat.from_dict(obj.get("startFormat")) if obj.get("startFormat") is not None else None, + _obj = cls.model_validate({ + "endField": obj.get("endField"), + "endFormat": OgrSourceTimeFormat.from_dict(obj["endFormat"]) if obj.get("endFormat") is not None else None, + "startField": obj.get("startField"), + "startFormat": OgrSourceTimeFormat.from_dict(obj["startFormat"]) if obj.get("startFormat") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/ogr_source_duration_spec.py b/python/geoengine_openapi_client/models/ogr_source_duration_spec.py index 782ba3f5..d101ac2e 100644 --- a/python/geoengine_openapi_client/models/ogr_source_duration_spec.py +++ b/python/geoengine_openapi_client/models/ogr_source_duration_spec.py @@ -14,18 +14,16 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.ogr_source_duration_spec_infinite import OgrSourceDurationSpecInfinite from geoengine_openapi_client.models.ogr_source_duration_spec_value import OgrSourceDurationSpecValue from geoengine_openapi_client.models.ogr_source_duration_spec_zero import OgrSourceDurationSpecZero -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self OGRSOURCEDURATIONSPEC_ONE_OF_SCHEMAS = ["OgrSourceDurationSpecInfinite", "OgrSourceDurationSpecValue", "OgrSourceDurationSpecZero"] @@ -39,16 +37,16 @@ class OgrSourceDurationSpec(BaseModel): oneof_schema_2_validator: Optional[OgrSourceDurationSpecZero] = None # data type: OgrSourceDurationSpecValue oneof_schema_3_validator: Optional[OgrSourceDurationSpecValue] = None - if TYPE_CHECKING: - actual_instance: Union[OgrSourceDurationSpecInfinite, OgrSourceDurationSpecValue, OgrSourceDurationSpecZero] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(OGRSOURCEDURATIONSPEC_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[OgrSourceDurationSpecInfinite, OgrSourceDurationSpecValue, OgrSourceDurationSpecZero]] = None + one_of_schemas: Set[str] = { "OgrSourceDurationSpecInfinite", "OgrSourceDurationSpecValue", "OgrSourceDurationSpecZero" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -61,9 +59,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = OgrSourceDurationSpec.construct() + instance = OgrSourceDurationSpec.model_construct() error_messages = [] match = 0 # validate data type: OgrSourceDurationSpecInfinite @@ -91,13 +89,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> OgrSourceDurationSpec: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> OgrSourceDurationSpec: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = OgrSourceDurationSpec.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -107,32 +105,32 @@ def from_json(cls, json_str: str) -> OgrSourceDurationSpec: raise ValueError("Failed to lookup data type from the field `type` in the input.") # check if data type is `OgrSourceDurationSpecInfinite` - if _data_type == "OgrSourceDurationSpecInfinite": + if _data_type == "infinite": instance.actual_instance = OgrSourceDurationSpecInfinite.from_json(json_str) return instance # check if data type is `OgrSourceDurationSpecValue` - if _data_type == "OgrSourceDurationSpecValue": + if _data_type == "value": instance.actual_instance = OgrSourceDurationSpecValue.from_json(json_str) return instance # check if data type is `OgrSourceDurationSpecZero` - if _data_type == "OgrSourceDurationSpecZero": + if _data_type == "zero": instance.actual_instance = OgrSourceDurationSpecZero.from_json(json_str) return instance # check if data type is `OgrSourceDurationSpecInfinite` - if _data_type == "infinite": + if _data_type == "OgrSourceDurationSpecInfinite": instance.actual_instance = OgrSourceDurationSpecInfinite.from_json(json_str) return instance # check if data type is `OgrSourceDurationSpecValue` - if _data_type == "value": + if _data_type == "OgrSourceDurationSpecValue": instance.actual_instance = OgrSourceDurationSpecValue.from_json(json_str) return instance # check if data type is `OgrSourceDurationSpecZero` - if _data_type == "zero": + if _data_type == "OgrSourceDurationSpecZero": instance.actual_instance = OgrSourceDurationSpecZero.from_json(json_str) return instance @@ -169,19 +167,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], OgrSourceDurationSpecInfinite, OgrSourceDurationSpecValue, OgrSourceDurationSpecZero]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -189,6 +185,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/ogr_source_duration_spec_infinite.py b/python/geoengine_openapi_client/models/ogr_source_duration_spec_infinite.py index 26edaa40..2531a215 100644 --- a/python/geoengine_openapi_client/models/ogr_source_duration_spec_infinite.py +++ b/python/geoengine_openapi_client/models/ogr_source_duration_spec_infinite.py @@ -18,60 +18,76 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class OgrSourceDurationSpecInfinite(BaseModel): """ OgrSourceDurationSpecInfinite - """ - type: StrictStr = Field(...) - __properties = ["type"] + """ # noqa: E501 + type: StrictStr + __properties: ClassVar[List[str]] = ["type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('infinite', 'zero', 'value'): - raise ValueError("must be one of enum values ('infinite', 'zero', 'value')") + if value not in set(['infinite']): + raise ValueError("must be one of enum values ('infinite')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> OgrSourceDurationSpecInfinite: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceDurationSpecInfinite 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) + 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: dict) -> OgrSourceDurationSpecInfinite: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceDurationSpecInfinite from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceDurationSpecInfinite.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrSourceDurationSpecInfinite.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/ogr_source_duration_spec_value.py b/python/geoengine_openapi_client/models/ogr_source_duration_spec_value.py index 2644322c..b3a2652f 100644 --- a/python/geoengine_openapi_client/models/ogr_source_duration_spec_value.py +++ b/python/geoengine_openapi_client/models/ogr_source_duration_spec_value.py @@ -18,63 +18,80 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, conint, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from geoengine_openapi_client.models.time_granularity import TimeGranularity +from typing import Optional, Set +from typing_extensions import Self class OgrSourceDurationSpecValue(BaseModel): """ OgrSourceDurationSpecValue - """ - granularity: TimeGranularity = Field(...) - step: conint(strict=True, ge=0) = Field(...) - type: StrictStr = Field(...) - __properties = ["granularity", "step", "type"] + """ # noqa: E501 + granularity: TimeGranularity + step: Annotated[int, Field(strict=True, ge=0)] + type: StrictStr + __properties: ClassVar[List[str]] = ["granularity", "step", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('value'): + if value not in set(['value']): raise ValueError("must be one of enum values ('value')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> OgrSourceDurationSpecValue: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceDurationSpecValue 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) + 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: dict) -> OgrSourceDurationSpecValue: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceDurationSpecValue from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceDurationSpecValue.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrSourceDurationSpecValue.parse_obj({ + _obj = cls.model_validate({ "granularity": obj.get("granularity"), "step": obj.get("step"), "type": obj.get("type") diff --git a/python/geoengine_openapi_client/models/ogr_source_duration_spec_zero.py b/python/geoengine_openapi_client/models/ogr_source_duration_spec_zero.py index dde6d994..fac14ab0 100644 --- a/python/geoengine_openapi_client/models/ogr_source_duration_spec_zero.py +++ b/python/geoengine_openapi_client/models/ogr_source_duration_spec_zero.py @@ -18,60 +18,76 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class OgrSourceDurationSpecZero(BaseModel): """ OgrSourceDurationSpecZero - """ - type: StrictStr = Field(...) - __properties = ["type"] + """ # noqa: E501 + type: StrictStr + __properties: ClassVar[List[str]] = ["type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('zero'): + if value not in set(['zero']): raise ValueError("must be one of enum values ('zero')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> OgrSourceDurationSpecZero: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceDurationSpecZero 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) + 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: dict) -> OgrSourceDurationSpecZero: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceDurationSpecZero from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceDurationSpecZero.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrSourceDurationSpecZero.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/ogr_source_error_spec.py b/python/geoengine_openapi_client/models/ogr_source_error_spec.py index 41fa1680..8a4b23a2 100644 --- a/python/geoengine_openapi_client/models/ogr_source_error_spec.py +++ b/python/geoengine_openapi_client/models/ogr_source_error_spec.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class OgrSourceErrorSpec(str, Enum): @@ -34,8 +31,8 @@ class OgrSourceErrorSpec(str, Enum): ABORT = 'abort' @classmethod - def from_json(cls, json_str: str) -> OgrSourceErrorSpec: + def from_json(cls, json_str: str) -> Self: """Create an instance of OgrSourceErrorSpec from a JSON string""" - return OgrSourceErrorSpec(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/ogr_source_time_format.py b/python/geoengine_openapi_client/models/ogr_source_time_format.py index d4cd6672..1964cad5 100644 --- a/python/geoengine_openapi_client/models/ogr_source_time_format.py +++ b/python/geoengine_openapi_client/models/ogr_source_time_format.py @@ -14,18 +14,16 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.ogr_source_time_format_auto import OgrSourceTimeFormatAuto from geoengine_openapi_client.models.ogr_source_time_format_custom import OgrSourceTimeFormatCustom from geoengine_openapi_client.models.ogr_source_time_format_unix_time_stamp import OgrSourceTimeFormatUnixTimeStamp -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self OGRSOURCETIMEFORMAT_ONE_OF_SCHEMAS = ["OgrSourceTimeFormatAuto", "OgrSourceTimeFormatCustom", "OgrSourceTimeFormatUnixTimeStamp"] @@ -39,16 +37,16 @@ class OgrSourceTimeFormat(BaseModel): oneof_schema_2_validator: Optional[OgrSourceTimeFormatUnixTimeStamp] = None # data type: OgrSourceTimeFormatAuto oneof_schema_3_validator: Optional[OgrSourceTimeFormatAuto] = None - if TYPE_CHECKING: - actual_instance: Union[OgrSourceTimeFormatAuto, OgrSourceTimeFormatCustom, OgrSourceTimeFormatUnixTimeStamp] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(OGRSOURCETIMEFORMAT_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[OgrSourceTimeFormatAuto, OgrSourceTimeFormatCustom, OgrSourceTimeFormatUnixTimeStamp]] = None + one_of_schemas: Set[str] = { "OgrSourceTimeFormatAuto", "OgrSourceTimeFormatCustom", "OgrSourceTimeFormatUnixTimeStamp" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -61,9 +59,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = OgrSourceTimeFormat.construct() + instance = OgrSourceTimeFormat.model_construct() error_messages = [] match = 0 # validate data type: OgrSourceTimeFormatCustom @@ -91,13 +89,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> OgrSourceTimeFormat: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> OgrSourceTimeFormat: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = OgrSourceTimeFormat.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -107,32 +105,32 @@ def from_json(cls, json_str: str) -> OgrSourceTimeFormat: raise ValueError("Failed to lookup data type from the field `format` in the input.") # check if data type is `OgrSourceTimeFormatAuto` - if _data_type == "OgrSourceTimeFormatAuto": + if _data_type == "auto": instance.actual_instance = OgrSourceTimeFormatAuto.from_json(json_str) return instance # check if data type is `OgrSourceTimeFormatCustom` - if _data_type == "OgrSourceTimeFormatCustom": + if _data_type == "custom": instance.actual_instance = OgrSourceTimeFormatCustom.from_json(json_str) return instance # check if data type is `OgrSourceTimeFormatUnixTimeStamp` - if _data_type == "OgrSourceTimeFormatUnixTimeStamp": + if _data_type == "unixTimeStamp": instance.actual_instance = OgrSourceTimeFormatUnixTimeStamp.from_json(json_str) return instance # check if data type is `OgrSourceTimeFormatAuto` - if _data_type == "auto": + if _data_type == "OgrSourceTimeFormatAuto": instance.actual_instance = OgrSourceTimeFormatAuto.from_json(json_str) return instance # check if data type is `OgrSourceTimeFormatCustom` - if _data_type == "custom": + if _data_type == "OgrSourceTimeFormatCustom": instance.actual_instance = OgrSourceTimeFormatCustom.from_json(json_str) return instance # check if data type is `OgrSourceTimeFormatUnixTimeStamp` - if _data_type == "unixTimeStamp": + if _data_type == "OgrSourceTimeFormatUnixTimeStamp": instance.actual_instance = OgrSourceTimeFormatUnixTimeStamp.from_json(json_str) return instance @@ -169,19 +167,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], OgrSourceTimeFormatAuto, OgrSourceTimeFormatCustom, OgrSourceTimeFormatUnixTimeStamp]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -189,6 +185,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/ogr_source_time_format_auto.py b/python/geoengine_openapi_client/models/ogr_source_time_format_auto.py index 3695cdff..71863600 100644 --- a/python/geoengine_openapi_client/models/ogr_source_time_format_auto.py +++ b/python/geoengine_openapi_client/models/ogr_source_time_format_auto.py @@ -18,60 +18,76 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class OgrSourceTimeFormatAuto(BaseModel): """ OgrSourceTimeFormatAuto - """ - format: StrictStr = Field(...) - __properties = ["format"] + """ # noqa: E501 + format: StrictStr + __properties: ClassVar[List[str]] = ["format"] - @validator('format') + @field_validator('format') def format_validate_enum(cls, value): """Validates the enum""" - if value not in ('auto'): + if value not in set(['auto']): raise ValueError("must be one of enum values ('auto')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> OgrSourceTimeFormatAuto: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceTimeFormatAuto 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) + 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: dict) -> OgrSourceTimeFormatAuto: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceTimeFormatAuto from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceTimeFormatAuto.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrSourceTimeFormatAuto.parse_obj({ + _obj = cls.model_validate({ "format": obj.get("format") }) return _obj diff --git a/python/geoengine_openapi_client/models/ogr_source_time_format_custom.py b/python/geoengine_openapi_client/models/ogr_source_time_format_custom.py index dfb9b771..fac45fbb 100644 --- a/python/geoengine_openapi_client/models/ogr_source_time_format_custom.py +++ b/python/geoengine_openapi_client/models/ogr_source_time_format_custom.py @@ -18,62 +18,78 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class OgrSourceTimeFormatCustom(BaseModel): """ OgrSourceTimeFormatCustom - """ - custom_format: StrictStr = Field(..., alias="customFormat") - format: StrictStr = Field(...) - __properties = ["customFormat", "format"] + """ # noqa: E501 + custom_format: StrictStr = Field(alias="customFormat") + format: StrictStr + __properties: ClassVar[List[str]] = ["customFormat", "format"] - @validator('format') + @field_validator('format') def format_validate_enum(cls, value): """Validates the enum""" - if value not in ('custom'): + if value not in set(['custom']): raise ValueError("must be one of enum values ('custom')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> OgrSourceTimeFormatCustom: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceTimeFormatCustom 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) + 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: dict) -> OgrSourceTimeFormatCustom: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceTimeFormatCustom from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceTimeFormatCustom.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrSourceTimeFormatCustom.parse_obj({ - "custom_format": obj.get("customFormat"), + _obj = cls.model_validate({ + "customFormat": obj.get("customFormat"), "format": obj.get("format") }) return _obj diff --git a/python/geoengine_openapi_client/models/ogr_source_time_format_unix_time_stamp.py b/python/geoengine_openapi_client/models/ogr_source_time_format_unix_time_stamp.py index 8adf76fa..723e5552 100644 --- a/python/geoengine_openapi_client/models/ogr_source_time_format_unix_time_stamp.py +++ b/python/geoengine_openapi_client/models/ogr_source_time_format_unix_time_stamp.py @@ -18,64 +18,80 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.unix_time_stamp_type import UnixTimeStampType +from typing import Optional, Set +from typing_extensions import Self class OgrSourceTimeFormatUnixTimeStamp(BaseModel): """ OgrSourceTimeFormatUnixTimeStamp - """ - format: StrictStr = Field(...) - timestamp_type: UnixTimeStampType = Field(..., alias="timestampType") - __properties = ["format", "timestampType"] + """ # noqa: E501 + format: StrictStr + timestamp_type: UnixTimeStampType = Field(alias="timestampType") + __properties: ClassVar[List[str]] = ["format", "timestampType"] - @validator('format') + @field_validator('format') def format_validate_enum(cls, value): """Validates the enum""" - if value not in ('unixTimeStamp'): + if value not in set(['unixTimeStamp']): raise ValueError("must be one of enum values ('unixTimeStamp')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> OgrSourceTimeFormatUnixTimeStamp: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OgrSourceTimeFormatUnixTimeStamp 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) + 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: dict) -> OgrSourceTimeFormatUnixTimeStamp: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OgrSourceTimeFormatUnixTimeStamp from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OgrSourceTimeFormatUnixTimeStamp.parse_obj(obj) + return cls.model_validate(obj) - _obj = OgrSourceTimeFormatUnixTimeStamp.parse_obj({ + _obj = cls.model_validate({ "format": obj.get("format"), - "timestamp_type": obj.get("timestampType") + "timestampType": obj.get("timestampType") }) return _obj diff --git a/python/geoengine_openapi_client/models/operator_quota.py b/python/geoengine_openapi_client/models/operator_quota.py index 47f62608..435fd6db 100644 --- a/python/geoengine_openapi_client/models/operator_quota.py +++ b/python/geoengine_openapi_client/models/operator_quota.py @@ -18,58 +18,75 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, conint +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class OperatorQuota(BaseModel): """ OperatorQuota - """ - count: conint(strict=True, ge=0) = Field(...) - operator_name: StrictStr = Field(..., alias="operatorName") - operator_path: StrictStr = Field(..., alias="operatorPath") - __properties = ["count", "operatorName", "operatorPath"] + """ # noqa: E501 + count: Annotated[int, Field(strict=True, ge=0)] + operator_name: StrictStr = Field(alias="operatorName") + operator_path: StrictStr = Field(alias="operatorPath") + __properties: ClassVar[List[str]] = ["count", "operatorName", "operatorPath"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> OperatorQuota: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of OperatorQuota 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) + 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: dict) -> OperatorQuota: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of OperatorQuota from a dict""" if obj is None: return None if not isinstance(obj, dict): - return OperatorQuota.parse_obj(obj) + return cls.model_validate(obj) - _obj = OperatorQuota.parse_obj({ + _obj = cls.model_validate({ "count": obj.get("count"), - "operator_name": obj.get("operatorName"), - "operator_path": obj.get("operatorPath") + "operatorName": obj.get("operatorName"), + "operatorPath": obj.get("operatorPath") }) return _obj diff --git a/python/geoengine_openapi_client/models/order_by.py b/python/geoengine_openapi_client/models/order_by.py index e6ce7f14..6c648d76 100644 --- a/python/geoengine_openapi_client/models/order_by.py +++ b/python/geoengine_openapi_client/models/order_by.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class OrderBy(str, Enum): @@ -34,8 +31,8 @@ class OrderBy(str, Enum): NAMEDESC = 'NameDesc' @classmethod - def from_json(cls, json_str: str) -> OrderBy: + def from_json(cls, json_str: str) -> Self: """Create an instance of OrderBy from a JSON string""" - return OrderBy(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/palette_colorizer.py b/python/geoengine_openapi_client/models/palette_colorizer.py index 081b5da7..3523ff47 100644 --- a/python/geoengine_openapi_client/models/palette_colorizer.py +++ b/python/geoengine_openapi_client/models/palette_colorizer.py @@ -18,78 +18,83 @@ import re # noqa: F401 import json - -from typing import Dict, List -from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PaletteColorizer(BaseModel): """ PaletteColorizer - """ - colors: Dict[str, conlist(StrictInt, max_items=4, min_items=4)] = Field(..., description="A map from value to color It is assumed that is has at least one and at most 256 entries.") - default_color: conlist(StrictInt, max_items=4, min_items=4) = Field(..., alias="defaultColor") - no_data_color: conlist(StrictInt, max_items=4, min_items=4) = Field(..., alias="noDataColor") - type: StrictStr = Field(...) - __properties = ["colors", "defaultColor", "noDataColor", "type"] - - @validator('type') + """ # noqa: E501 + colors: Dict[str, Annotated[List[StrictInt], Field(min_length=4, max_length=4)]] = Field(description="A map from value to color It is assumed that is has at least one and at most 256 entries.") + default_color: Annotated[List[StrictInt], Field(min_length=4, max_length=4)] = Field(alias="defaultColor") + no_data_color: Annotated[List[StrictInt], Field(min_length=4, max_length=4)] = Field(alias="noDataColor") + type: StrictStr + __properties: ClassVar[List[str]] = ["colors", "defaultColor", "noDataColor", "type"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('palette'): + if value not in set(['palette']): raise ValueError("must be one of enum values ('palette')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> PaletteColorizer: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaletteColorizer 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) - # Note: fixed wrong handling of colors field - return _dict + 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([ + ]) - # override the default output from pydantic by calling `to_dict()` of each value in colors (dict of array) - _field_dict_of_array = {} - if self.colors: - for _key in self.colors: - if self.colors[_key]: - _field_dict_of_array[_key] = [ - _item.to_dict() for _item in self.colors[_key] - ] - _dict['colors'] = _field_dict_of_array + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PaletteColorizer: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaletteColorizer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaletteColorizer.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaletteColorizer.parse_obj({ + _obj = cls.model_validate({ "colors": obj.get("colors"), - "default_color": obj.get("defaultColor"), - "no_data_color": obj.get("noDataColor"), + "defaultColor": obj.get("defaultColor"), + "noDataColor": obj.get("noDataColor"), "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/permission.py b/python/geoengine_openapi_client/models/permission.py index 9f444bd4..6b317edb 100644 --- a/python/geoengine_openapi_client/models/permission.py +++ b/python/geoengine_openapi_client/models/permission.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class Permission(str, Enum): @@ -34,8 +31,8 @@ class Permission(str, Enum): OWNER = 'Owner' @classmethod - def from_json(cls, json_str: str) -> Permission: + def from_json(cls, json_str: str) -> Self: """Create an instance of Permission from a JSON string""" - return Permission(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/permission_list_options.py b/python/geoengine_openapi_client/models/permission_list_options.py index 59431ad4..270b9ea9 100644 --- a/python/geoengine_openapi_client/models/permission_list_options.py +++ b/python/geoengine_openapi_client/models/permission_list_options.py @@ -18,54 +18,71 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, conint +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PermissionListOptions(BaseModel): """ PermissionListOptions - """ - limit: conint(strict=True, ge=0) = Field(...) - offset: conint(strict=True, ge=0) = Field(...) - __properties = ["limit", "offset"] + """ # noqa: E501 + limit: Annotated[int, Field(strict=True, ge=0)] + offset: Annotated[int, Field(strict=True, ge=0)] + __properties: ClassVar[List[str]] = ["limit", "offset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> PermissionListOptions: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PermissionListOptions 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) + 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: dict) -> PermissionListOptions: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PermissionListOptions from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PermissionListOptions.parse_obj(obj) + return cls.model_validate(obj) - _obj = PermissionListOptions.parse_obj({ + _obj = cls.model_validate({ "limit": obj.get("limit"), "offset": obj.get("offset") }) diff --git a/python/geoengine_openapi_client/models/permission_listing.py b/python/geoengine_openapi_client/models/permission_listing.py index 45410c14..3817b4e2 100644 --- a/python/geoengine_openapi_client/models/permission_listing.py +++ b/python/geoengine_openapi_client/models/permission_listing.py @@ -18,46 +18,62 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.permission import Permission from geoengine_openapi_client.models.resource import Resource from geoengine_openapi_client.models.role import Role +from typing import Optional, Set +from typing_extensions import Self class PermissionListing(BaseModel): """ PermissionListing - """ - permission: Permission = Field(...) - resource: Resource = Field(...) - role: Role = Field(...) - __properties = ["permission", "resource", "role"] + """ # noqa: E501 + permission: Permission + resource: Resource + role: Role + __properties: ClassVar[List[str]] = ["permission", "resource", "role"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> PermissionListing: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PermissionListing 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of resource if self.resource: _dict['resource'] = self.resource.to_dict() @@ -67,18 +83,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> PermissionListing: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PermissionListing from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PermissionListing.parse_obj(obj) + return cls.model_validate(obj) - _obj = PermissionListing.parse_obj({ + _obj = cls.model_validate({ "permission": obj.get("permission"), - "resource": Resource.from_dict(obj.get("resource")) if obj.get("resource") is not None else None, - "role": Role.from_dict(obj.get("role")) if obj.get("role") is not None else None + "resource": Resource.from_dict(obj["resource"]) if obj.get("resource") is not None else None, + "role": Role.from_dict(obj["role"]) if obj.get("role") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/permission_request.py b/python/geoengine_openapi_client/models/permission_request.py index 9051ee73..4b517349 100644 --- a/python/geoengine_openapi_client/models/permission_request.py +++ b/python/geoengine_openapi_client/models/permission_request.py @@ -18,63 +18,79 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.permission import Permission from geoengine_openapi_client.models.resource import Resource +from typing import Optional, Set +from typing_extensions import Self class PermissionRequest(BaseModel): """ - Request for adding a new permission to the given role on the given resource # noqa: E501 - """ - permission: Permission = Field(...) - resource: Resource = Field(...) - role_id: StrictStr = Field(..., alias="roleId") - __properties = ["permission", "resource", "roleId"] + Request for adding a new permission to the given role on the given resource + """ # noqa: E501 + permission: Permission + resource: Resource + role_id: StrictStr = Field(alias="roleId") + __properties: ClassVar[List[str]] = ["permission", "resource", "roleId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> PermissionRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PermissionRequest 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of resource if self.resource: _dict['resource'] = self.resource.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> PermissionRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PermissionRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PermissionRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PermissionRequest.parse_obj({ + _obj = cls.model_validate({ "permission": obj.get("permission"), - "resource": Resource.from_dict(obj.get("resource")) if obj.get("resource") is not None else None, - "role_id": obj.get("roleId") + "resource": Resource.from_dict(obj["resource"]) if obj.get("resource") is not None else None, + "roleId": obj.get("roleId") }) return _obj diff --git a/python/geoengine_openapi_client/models/plot.py b/python/geoengine_openapi_client/models/plot.py index 063aeaf4..47d9f23b 100644 --- a/python/geoengine_openapi_client/models/plot.py +++ b/python/geoengine_openapi_client/models/plot.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class Plot(BaseModel): """ Plot - """ - name: StrictStr = Field(...) - workflow: StrictStr = Field(...) - __properties = ["name", "workflow"] + """ # noqa: E501 + name: StrictStr + workflow: StrictStr + __properties: ClassVar[List[str]] = ["name", "workflow"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> Plot: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Plot 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) + 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: dict) -> Plot: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Plot from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Plot.parse_obj(obj) + return cls.model_validate(obj) - _obj = Plot.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "workflow": obj.get("workflow") }) diff --git a/python/geoengine_openapi_client/models/plot_output_format.py b/python/geoengine_openapi_client/models/plot_output_format.py index 74d1cc0f..10612d29 100644 --- a/python/geoengine_openapi_client/models/plot_output_format.py +++ b/python/geoengine_openapi_client/models/plot_output_format.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class PlotOutputFormat(str, Enum): @@ -35,8 +32,8 @@ class PlotOutputFormat(str, Enum): IMAGEPNG = 'ImagePng' @classmethod - def from_json(cls, json_str: str) -> PlotOutputFormat: + def from_json(cls, json_str: str) -> Self: """Create an instance of PlotOutputFormat from a JSON string""" - return PlotOutputFormat(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/plot_query_rectangle.py b/python/geoengine_openapi_client/models/plot_query_rectangle.py index e56235fd..ff6626cd 100644 --- a/python/geoengine_openapi_client/models/plot_query_rectangle.py +++ b/python/geoengine_openapi_client/models/plot_query_rectangle.py @@ -18,46 +18,62 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.bounding_box2_d import BoundingBox2D from geoengine_openapi_client.models.spatial_resolution import SpatialResolution from geoengine_openapi_client.models.time_interval import TimeInterval +from typing import Optional, Set +from typing_extensions import Self class PlotQueryRectangle(BaseModel): """ - A spatio-temporal rectangle with a specified resolution # noqa: E501 - """ - spatial_bounds: BoundingBox2D = Field(..., alias="spatialBounds") - spatial_resolution: SpatialResolution = Field(..., alias="spatialResolution") - time_interval: TimeInterval = Field(..., alias="timeInterval") - __properties = ["spatialBounds", "spatialResolution", "timeInterval"] + A spatio-temporal rectangle with a specified resolution + """ # noqa: E501 + spatial_bounds: BoundingBox2D = Field(alias="spatialBounds") + spatial_resolution: SpatialResolution = Field(alias="spatialResolution") + time_interval: TimeInterval = Field(alias="timeInterval") + __properties: ClassVar[List[str]] = ["spatialBounds", "spatialResolution", "timeInterval"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> PlotQueryRectangle: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PlotQueryRectangle 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of spatial_bounds if self.spatial_bounds: _dict['spatialBounds'] = self.spatial_bounds.to_dict() @@ -70,18 +86,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> PlotQueryRectangle: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PlotQueryRectangle from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PlotQueryRectangle.parse_obj(obj) + return cls.model_validate(obj) - _obj = PlotQueryRectangle.parse_obj({ - "spatial_bounds": BoundingBox2D.from_dict(obj.get("spatialBounds")) if obj.get("spatialBounds") is not None else None, - "spatial_resolution": SpatialResolution.from_dict(obj.get("spatialResolution")) if obj.get("spatialResolution") is not None else None, - "time_interval": TimeInterval.from_dict(obj.get("timeInterval")) if obj.get("timeInterval") is not None else None + _obj = cls.model_validate({ + "spatialBounds": BoundingBox2D.from_dict(obj["spatialBounds"]) if obj.get("spatialBounds") is not None else None, + "spatialResolution": SpatialResolution.from_dict(obj["spatialResolution"]) if obj.get("spatialResolution") is not None else None, + "timeInterval": TimeInterval.from_dict(obj["timeInterval"]) if obj.get("timeInterval") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/plot_result_descriptor.py b/python/geoengine_openapi_client/models/plot_result_descriptor.py index 602055a5..0202e6a0 100644 --- a/python/geoengine_openapi_client/models/plot_result_descriptor.py +++ b/python/geoengine_openapi_client/models/plot_result_descriptor.py @@ -18,45 +18,61 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.bounding_box2_d import BoundingBox2D from geoengine_openapi_client.models.time_interval import TimeInterval +from typing import Optional, Set +from typing_extensions import Self class PlotResultDescriptor(BaseModel): """ - A `ResultDescriptor` for plot queries # noqa: E501 - """ + A `ResultDescriptor` for plot queries + """ # noqa: E501 bbox: Optional[BoundingBox2D] = None - spatial_reference: StrictStr = Field(..., alias="spatialReference") + spatial_reference: StrictStr = Field(alias="spatialReference") time: Optional[TimeInterval] = None - __properties = ["bbox", "spatialReference", "time"] + __properties: ClassVar[List[str]] = ["bbox", "spatialReference", "time"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> PlotResultDescriptor: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PlotResultDescriptor 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of bbox if self.bbox: _dict['bbox'] = self.bbox.to_dict() @@ -64,30 +80,30 @@ def to_dict(self): if self.time: _dict['time'] = self.time.to_dict() # set to None if bbox (nullable) is None - # and __fields_set__ contains the field - if self.bbox is None and "bbox" in self.__fields_set__: + # and model_fields_set contains the field + if self.bbox is None and "bbox" in self.model_fields_set: _dict['bbox'] = None # set to None if time (nullable) is None - # and __fields_set__ contains the field - if self.time is None and "time" in self.__fields_set__: + # and model_fields_set contains the field + if self.time is None and "time" in self.model_fields_set: _dict['time'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PlotResultDescriptor: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PlotResultDescriptor from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PlotResultDescriptor.parse_obj(obj) + return cls.model_validate(obj) - _obj = PlotResultDescriptor.parse_obj({ - "bbox": BoundingBox2D.from_dict(obj.get("bbox")) if obj.get("bbox") is not None else None, - "spatial_reference": obj.get("spatialReference"), - "time": TimeInterval.from_dict(obj.get("time")) if obj.get("time") is not None else None + _obj = cls.model_validate({ + "bbox": BoundingBox2D.from_dict(obj["bbox"]) if obj.get("bbox") is not None else None, + "spatialReference": obj.get("spatialReference"), + "time": TimeInterval.from_dict(obj["time"]) if obj.get("time") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/plot_update.py b/python/geoengine_openapi_client/models/plot_update.py index 58097584..de486314 100644 --- a/python/geoengine_openapi_client/models/plot_update.py +++ b/python/geoengine_openapi_client/models/plot_update.py @@ -14,17 +14,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.plot import Plot from geoengine_openapi_client.models.project_update_token import ProjectUpdateToken -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self PLOTUPDATE_ONE_OF_SCHEMAS = ["Plot", "ProjectUpdateToken"] @@ -36,14 +34,14 @@ class PlotUpdate(BaseModel): oneof_schema_1_validator: Optional[ProjectUpdateToken] = None # data type: Plot oneof_schema_2_validator: Optional[Plot] = None - if TYPE_CHECKING: - actual_instance: Union[Plot, ProjectUpdateToken] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(PLOTUPDATE_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[Plot, ProjectUpdateToken]] = None + one_of_schemas: Set[str] = { "Plot", "ProjectUpdateToken" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True def __init__(self, *args, **kwargs) -> None: if args: @@ -55,9 +53,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = PlotUpdate.construct() + instance = PlotUpdate.model_construct() error_messages = [] match = 0 # validate data type: ProjectUpdateToken @@ -80,13 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> PlotUpdate: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> PlotUpdate: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = PlotUpdate.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -117,19 +115,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], Plot, ProjectUpdateToken]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -137,6 +133,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/point_symbology.py b/python/geoengine_openapi_client/models/point_symbology.py index 87ac8dd7..ccfacbf9 100644 --- a/python/geoengine_openapi_client/models/point_symbology.py +++ b/python/geoengine_openapi_client/models/point_symbology.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.color_param import ColorParam from geoengine_openapi_client.models.number_param import NumberParam from geoengine_openapi_client.models.stroke_param import StrokeParam from geoengine_openapi_client.models.text_symbology import TextSymbology +from typing import Optional, Set +from typing_extensions import Self class PointSymbology(BaseModel): """ PointSymbology - """ - fill_color: ColorParam = Field(..., alias="fillColor") - radius: NumberParam = Field(...) - stroke: StrokeParam = Field(...) + """ # noqa: E501 + fill_color: ColorParam = Field(alias="fillColor") + radius: NumberParam + stroke: StrokeParam text: Optional[TextSymbology] = None - type: StrictStr = Field(...) - __properties = ["fillColor", "radius", "stroke", "text", "type"] + type: StrictStr + __properties: ClassVar[List[str]] = ["fillColor", "radius", "stroke", "text", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('point'): + if value not in set(['point']): raise ValueError("must be one of enum values ('point')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> PointSymbology: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PointSymbology 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of fill_color if self.fill_color: _dict['fillColor'] = self.fill_color.to_dict() @@ -81,26 +97,26 @@ def to_dict(self): if self.text: _dict['text'] = self.text.to_dict() # set to None if text (nullable) is None - # and __fields_set__ contains the field - if self.text is None and "text" in self.__fields_set__: + # and model_fields_set contains the field + if self.text is None and "text" in self.model_fields_set: _dict['text'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PointSymbology: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PointSymbology from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PointSymbology.parse_obj(obj) + return cls.model_validate(obj) - _obj = PointSymbology.parse_obj({ - "fill_color": ColorParam.from_dict(obj.get("fillColor")) if obj.get("fillColor") is not None else None, - "radius": NumberParam.from_dict(obj.get("radius")) if obj.get("radius") is not None else None, - "stroke": StrokeParam.from_dict(obj.get("stroke")) if obj.get("stroke") is not None else None, - "text": TextSymbology.from_dict(obj.get("text")) if obj.get("text") is not None else None, + _obj = cls.model_validate({ + "fillColor": ColorParam.from_dict(obj["fillColor"]) if obj.get("fillColor") is not None else None, + "radius": NumberParam.from_dict(obj["radius"]) if obj.get("radius") is not None else None, + "stroke": StrokeParam.from_dict(obj["stroke"]) if obj.get("stroke") is not None else None, + "text": TextSymbology.from_dict(obj["text"]) if obj.get("text") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/polygon_symbology.py b/python/geoengine_openapi_client/models/polygon_symbology.py index 4ddc9bcf..5ce7d23e 100644 --- a/python/geoengine_openapi_client/models/polygon_symbology.py +++ b/python/geoengine_openapi_client/models/polygon_symbology.py @@ -18,55 +18,71 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.color_param import ColorParam from geoengine_openapi_client.models.stroke_param import StrokeParam from geoengine_openapi_client.models.text_symbology import TextSymbology +from typing import Optional, Set +from typing_extensions import Self class PolygonSymbology(BaseModel): """ PolygonSymbology - """ - auto_simplified: StrictBool = Field(..., alias="autoSimplified") - fill_color: ColorParam = Field(..., alias="fillColor") - stroke: StrokeParam = Field(...) + """ # noqa: E501 + auto_simplified: StrictBool = Field(alias="autoSimplified") + fill_color: ColorParam = Field(alias="fillColor") + stroke: StrokeParam text: Optional[TextSymbology] = None - type: StrictStr = Field(...) - __properties = ["autoSimplified", "fillColor", "stroke", "text", "type"] + type: StrictStr + __properties: ClassVar[List[str]] = ["autoSimplified", "fillColor", "stroke", "text", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('polygon'): + if value not in set(['polygon']): raise ValueError("must be one of enum values ('polygon')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> PolygonSymbology: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PolygonSymbology 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of fill_color if self.fill_color: _dict['fillColor'] = self.fill_color.to_dict() @@ -77,26 +93,26 @@ def to_dict(self): if self.text: _dict['text'] = self.text.to_dict() # set to None if text (nullable) is None - # and __fields_set__ contains the field - if self.text is None and "text" in self.__fields_set__: + # and model_fields_set contains the field + if self.text is None and "text" in self.model_fields_set: _dict['text'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PolygonSymbology: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PolygonSymbology from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PolygonSymbology.parse_obj(obj) + return cls.model_validate(obj) - _obj = PolygonSymbology.parse_obj({ - "auto_simplified": obj.get("autoSimplified"), - "fill_color": ColorParam.from_dict(obj.get("fillColor")) if obj.get("fillColor") is not None else None, - "stroke": StrokeParam.from_dict(obj.get("stroke")) if obj.get("stroke") is not None else None, - "text": TextSymbology.from_dict(obj.get("text")) if obj.get("text") is not None else None, + _obj = cls.model_validate({ + "autoSimplified": obj.get("autoSimplified"), + "fillColor": ColorParam.from_dict(obj["fillColor"]) if obj.get("fillColor") is not None else None, + "stroke": StrokeParam.from_dict(obj["stroke"]) if obj.get("stroke") is not None else None, + "text": TextSymbology.from_dict(obj["text"]) if obj.get("text") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/project.py b/python/geoengine_openapi_client/models/project.py index 3bbc26e2..e8230d89 100644 --- a/python/geoengine_openapi_client/models/project.py +++ b/python/geoengine_openapi_client/models/project.py @@ -18,69 +18,85 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.plot import Plot from geoengine_openapi_client.models.project_layer import ProjectLayer from geoengine_openapi_client.models.project_version import ProjectVersion from geoengine_openapi_client.models.st_rectangle import STRectangle from geoengine_openapi_client.models.time_step import TimeStep +from typing import Optional, Set +from typing_extensions import Self class Project(BaseModel): """ Project - """ - bounds: STRectangle = Field(...) - description: StrictStr = Field(...) - id: StrictStr = Field(...) - layers: conlist(ProjectLayer) = Field(...) - name: StrictStr = Field(...) - plots: conlist(Plot) = Field(...) - time_step: TimeStep = Field(..., alias="timeStep") - version: ProjectVersion = Field(...) - __properties = ["bounds", "description", "id", "layers", "name", "plots", "timeStep", "version"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + bounds: STRectangle + description: StrictStr + id: StrictStr + layers: List[ProjectLayer] + name: StrictStr + plots: List[Plot] + time_step: TimeStep = Field(alias="timeStep") + version: ProjectVersion + __properties: ClassVar[List[str]] = ["bounds", "description", "id", "layers", "name", "plots", "timeStep", "version"] + + 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.dict(by_alias=True)) + 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) -> Project: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Project 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of bounds if self.bounds: _dict['bounds'] = self.bounds.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in layers (list) _items = [] if self.layers: - for _item in self.layers: - if _item: - _items.append(_item.to_dict()) + for _item_layers in self.layers: + if _item_layers: + _items.append(_item_layers.to_dict()) _dict['layers'] = _items # override the default output from pydantic by calling `to_dict()` of each item in plots (list) _items = [] if self.plots: - for _item in self.plots: - if _item: - _items.append(_item.to_dict()) + for _item_plots in self.plots: + if _item_plots: + _items.append(_item_plots.to_dict()) _dict['plots'] = _items # override the default output from pydantic by calling `to_dict()` of time_step if self.time_step: @@ -91,23 +107,23 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> Project: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Project from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Project.parse_obj(obj) + return cls.model_validate(obj) - _obj = Project.parse_obj({ - "bounds": STRectangle.from_dict(obj.get("bounds")) if obj.get("bounds") is not None else None, + _obj = cls.model_validate({ + "bounds": STRectangle.from_dict(obj["bounds"]) if obj.get("bounds") is not None else None, "description": obj.get("description"), "id": obj.get("id"), - "layers": [ProjectLayer.from_dict(_item) for _item in obj.get("layers")] if obj.get("layers") is not None else None, + "layers": [ProjectLayer.from_dict(_item) for _item in obj["layers"]] if obj.get("layers") is not None else None, "name": obj.get("name"), - "plots": [Plot.from_dict(_item) for _item in obj.get("plots")] if obj.get("plots") is not None else None, - "time_step": TimeStep.from_dict(obj.get("timeStep")) if obj.get("timeStep") is not None else None, - "version": ProjectVersion.from_dict(obj.get("version")) if obj.get("version") is not None else None + "plots": [Plot.from_dict(_item) for _item in obj["plots"]] if obj.get("plots") is not None else None, + "timeStep": TimeStep.from_dict(obj["timeStep"]) if obj.get("timeStep") is not None else None, + "version": ProjectVersion.from_dict(obj["version"]) if obj.get("version") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/project_layer.py b/python/geoengine_openapi_client/models/project_layer.py index 0fbc1374..94565988 100644 --- a/python/geoengine_openapi_client/models/project_layer.py +++ b/python/geoengine_openapi_client/models/project_layer.py @@ -18,46 +18,62 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.layer_visibility import LayerVisibility from geoengine_openapi_client.models.symbology import Symbology +from typing import Optional, Set +from typing_extensions import Self class ProjectLayer(BaseModel): """ ProjectLayer - """ - name: StrictStr = Field(...) - symbology: Symbology = Field(...) - visibility: LayerVisibility = Field(...) - workflow: StrictStr = Field(...) - __properties = ["name", "symbology", "visibility", "workflow"] + """ # noqa: E501 + name: StrictStr + symbology: Symbology + visibility: LayerVisibility + workflow: StrictStr + __properties: ClassVar[List[str]] = ["name", "symbology", "visibility", "workflow"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> ProjectLayer: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProjectLayer 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of symbology if self.symbology: _dict['symbology'] = self.symbology.to_dict() @@ -67,18 +83,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> ProjectLayer: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProjectLayer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProjectLayer.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProjectLayer.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), - "symbology": Symbology.from_dict(obj.get("symbology")) if obj.get("symbology") is not None else None, - "visibility": LayerVisibility.from_dict(obj.get("visibility")) if obj.get("visibility") is not None else None, + "symbology": Symbology.from_dict(obj["symbology"]) if obj.get("symbology") is not None else None, + "visibility": LayerVisibility.from_dict(obj["visibility"]) if obj.get("visibility") is not None else None, "workflow": obj.get("workflow") }) return _obj diff --git a/python/geoengine_openapi_client/models/project_listing.py b/python/geoengine_openapi_client/models/project_listing.py index 7fd65772..23607e75 100644 --- a/python/geoengine_openapi_client/models/project_listing.py +++ b/python/geoengine_openapi_client/models/project_listing.py @@ -19,63 +19,80 @@ import json from datetime import datetime -from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +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 ProjectListing(BaseModel): """ ProjectListing - """ - changed: datetime = Field(...) - description: StrictStr = Field(...) - id: StrictStr = Field(...) - layer_names: conlist(StrictStr) = Field(..., alias="layerNames") - name: StrictStr = Field(...) - plot_names: conlist(StrictStr) = Field(..., alias="plotNames") - __properties = ["changed", "description", "id", "layerNames", "name", "plotNames"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + changed: datetime + description: StrictStr + id: StrictStr + layer_names: List[StrictStr] = Field(alias="layerNames") + name: StrictStr + plot_names: List[StrictStr] = Field(alias="plotNames") + __properties: ClassVar[List[str]] = ["changed", "description", "id", "layerNames", "name", "plotNames"] + + 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.dict(by_alias=True)) + 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) -> ProjectListing: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProjectListing 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) + 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: dict) -> ProjectListing: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProjectListing from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProjectListing.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProjectListing.parse_obj({ + _obj = cls.model_validate({ "changed": obj.get("changed"), "description": obj.get("description"), "id": obj.get("id"), - "layer_names": obj.get("layerNames"), + "layerNames": obj.get("layerNames"), "name": obj.get("name"), - "plot_names": obj.get("plotNames") + "plotNames": obj.get("plotNames") }) return _obj diff --git a/python/geoengine_openapi_client/models/project_resource.py b/python/geoengine_openapi_client/models/project_resource.py index b5503164..8a1a2020 100644 --- a/python/geoengine_openapi_client/models/project_resource.py +++ b/python/geoengine_openapi_client/models/project_resource.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ProjectResource(BaseModel): """ ProjectResource - """ - id: StrictStr = Field(...) - type: StrictStr = Field(...) - __properties = ["id", "type"] + """ # noqa: E501 + id: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["id", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('project'): + if value not in set(['project']): raise ValueError("must be one of enum values ('project')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> ProjectResource: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProjectResource 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) + 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: dict) -> ProjectResource: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProjectResource from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProjectResource.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProjectResource.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/project_update_token.py b/python/geoengine_openapi_client/models/project_update_token.py index d5c8ec2d..6dd63f3d 100644 --- a/python/geoengine_openapi_client/models/project_update_token.py +++ b/python/geoengine_openapi_client/models/project_update_token.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class ProjectUpdateToken(str, Enum): @@ -34,8 +31,8 @@ class ProjectUpdateToken(str, Enum): DELETE = 'delete' @classmethod - def from_json(cls, json_str: str) -> ProjectUpdateToken: + def from_json(cls, json_str: str) -> Self: """Create an instance of ProjectUpdateToken from a JSON string""" - return ProjectUpdateToken(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/project_version.py b/python/geoengine_openapi_client/models/project_version.py index 4c9126f8..6f8004df 100644 --- a/python/geoengine_openapi_client/models/project_version.py +++ b/python/geoengine_openapi_client/models/project_version.py @@ -19,53 +19,70 @@ import json from datetime import datetime - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ProjectVersion(BaseModel): """ ProjectVersion - """ - changed: datetime = Field(...) - id: StrictStr = Field(...) - __properties = ["changed", "id"] + """ # noqa: E501 + changed: datetime + id: StrictStr + __properties: ClassVar[List[str]] = ["changed", "id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> ProjectVersion: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProjectVersion 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) + 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: dict) -> ProjectVersion: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProjectVersion from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProjectVersion.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProjectVersion.parse_obj({ + _obj = cls.model_validate({ "changed": obj.get("changed"), "id": obj.get("id") }) diff --git a/python/geoengine_openapi_client/models/provenance.py b/python/geoengine_openapi_client/models/provenance.py index 955225ee..b402680d 100644 --- a/python/geoengine_openapi_client/models/provenance.py +++ b/python/geoengine_openapi_client/models/provenance.py @@ -18,55 +18,71 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class Provenance(BaseModel): """ Provenance - """ - citation: StrictStr = Field(...) - license: StrictStr = Field(...) - uri: StrictStr = Field(...) - __properties = ["citation", "license", "uri"] + """ # noqa: E501 + citation: StrictStr + license: StrictStr + uri: StrictStr + __properties: ClassVar[List[str]] = ["citation", "license", "uri"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> Provenance: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Provenance 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) + 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: dict) -> Provenance: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Provenance from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Provenance.parse_obj(obj) + return cls.model_validate(obj) - _obj = Provenance.parse_obj({ + _obj = cls.model_validate({ "citation": obj.get("citation"), "license": obj.get("license"), "uri": obj.get("uri") diff --git a/python/geoengine_openapi_client/models/provenance_entry.py b/python/geoengine_openapi_client/models/provenance_entry.py index 9dc18f34..d57acd80 100644 --- a/python/geoengine_openapi_client/models/provenance_entry.py +++ b/python/geoengine_openapi_client/models/provenance_entry.py @@ -18,50 +18,66 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.data_id import DataId from geoengine_openapi_client.models.provenance import Provenance +from typing import Optional, Set +from typing_extensions import Self class ProvenanceEntry(BaseModel): """ ProvenanceEntry - """ - data: conlist(DataId) = Field(...) - provenance: Provenance = Field(...) - __properties = ["data", "provenance"] + """ # noqa: E501 + data: List[DataId] + provenance: Provenance + __properties: ClassVar[List[str]] = ["data", "provenance"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> ProvenanceEntry: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProvenanceEntry 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in data (list) _items = [] if self.data: - for _item in self.data: - if _item: - _items.append(_item.to_dict()) + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) _dict['data'] = _items # override the default output from pydantic by calling `to_dict()` of provenance if self.provenance: @@ -69,17 +85,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> ProvenanceEntry: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProvenanceEntry from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProvenanceEntry.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProvenanceEntry.parse_obj({ - "data": [DataId.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None, - "provenance": Provenance.from_dict(obj.get("provenance")) if obj.get("provenance") is not None else None + _obj = cls.model_validate({ + "data": [DataId.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "provenance": Provenance.from_dict(obj["provenance"]) if obj.get("provenance") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/provenance_output.py b/python/geoengine_openapi_client/models/provenance_output.py index a2853146..f8eb6cdc 100644 --- a/python/geoengine_openapi_client/models/provenance_output.py +++ b/python/geoengine_openapi_client/models/provenance_output.py @@ -18,73 +18,89 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.data_id import DataId from geoengine_openapi_client.models.provenance import Provenance +from typing import Optional, Set +from typing_extensions import Self class ProvenanceOutput(BaseModel): """ ProvenanceOutput - """ - data: DataId = Field(...) - provenance: Optional[conlist(Provenance)] = None - __properties = ["data", "provenance"] + """ # noqa: E501 + data: DataId + provenance: Optional[List[Provenance]] = None + __properties: ClassVar[List[str]] = ["data", "provenance"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> ProvenanceOutput: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProvenanceOutput 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of data if self.data: _dict['data'] = self.data.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in provenance (list) _items = [] if self.provenance: - for _item in self.provenance: - if _item: - _items.append(_item.to_dict()) + for _item_provenance in self.provenance: + if _item_provenance: + _items.append(_item_provenance.to_dict()) _dict['provenance'] = _items # set to None if provenance (nullable) is None - # and __fields_set__ contains the field - if self.provenance is None and "provenance" in self.__fields_set__: + # and model_fields_set contains the field + if self.provenance is None and "provenance" in self.model_fields_set: _dict['provenance'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ProvenanceOutput: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProvenanceOutput from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProvenanceOutput.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProvenanceOutput.parse_obj({ - "data": DataId.from_dict(obj.get("data")) if obj.get("data") is not None else None, - "provenance": [Provenance.from_dict(_item) for _item in obj.get("provenance")] if obj.get("provenance") is not None else None + _obj = cls.model_validate({ + "data": DataId.from_dict(obj["data"]) if obj.get("data") is not None else None, + "provenance": [Provenance.from_dict(_item) for _item in obj["provenance"]] if obj.get("provenance") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/provenances.py b/python/geoengine_openapi_client/models/provenances.py index 16ef2a3f..c41a9e94 100644 --- a/python/geoengine_openapi_client/models/provenances.py +++ b/python/geoengine_openapi_client/models/provenances.py @@ -18,62 +18,78 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.provenance import Provenance +from typing import Optional, Set +from typing_extensions import Self class Provenances(BaseModel): """ Provenances - """ - provenances: conlist(Provenance) = Field(...) - __properties = ["provenances"] + """ # noqa: E501 + provenances: List[Provenance] + __properties: ClassVar[List[str]] = ["provenances"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> Provenances: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Provenances 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in provenances (list) _items = [] if self.provenances: - for _item in self.provenances: - if _item: - _items.append(_item.to_dict()) + for _item_provenances in self.provenances: + if _item_provenances: + _items.append(_item_provenances.to_dict()) _dict['provenances'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> Provenances: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Provenances from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Provenances.parse_obj(obj) + return cls.model_validate(obj) - _obj = Provenances.parse_obj({ - "provenances": [Provenance.from_dict(_item) for _item in obj.get("provenances")] if obj.get("provenances") is not None else None + _obj = cls.model_validate({ + "provenances": [Provenance.from_dict(_item) for _item in obj["provenances"]] if obj.get("provenances") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/provider_capabilities.py b/python/geoengine_openapi_client/models/provider_capabilities.py index d4a3836a..6a81ba8d 100644 --- a/python/geoengine_openapi_client/models/provider_capabilities.py +++ b/python/geoengine_openapi_client/models/provider_capabilities.py @@ -18,60 +18,76 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictBool +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.search_capabilities import SearchCapabilities +from typing import Optional, Set +from typing_extensions import Self class ProviderCapabilities(BaseModel): """ ProviderCapabilities - """ - listing: StrictBool = Field(...) - search: SearchCapabilities = Field(...) - __properties = ["listing", "search"] + """ # noqa: E501 + listing: StrictBool + search: SearchCapabilities + __properties: ClassVar[List[str]] = ["listing", "search"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> ProviderCapabilities: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProviderCapabilities 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of search if self.search: _dict['search'] = self.search.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> ProviderCapabilities: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProviderCapabilities from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProviderCapabilities.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProviderCapabilities.parse_obj({ + _obj = cls.model_validate({ "listing": obj.get("listing"), - "search": SearchCapabilities.from_dict(obj.get("search")) if obj.get("search") is not None else None + "search": SearchCapabilities.from_dict(obj["search"]) if obj.get("search") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/provider_layer_collection_id.py b/python/geoengine_openapi_client/models/provider_layer_collection_id.py index 12f0fad6..3db6bf81 100644 --- a/python/geoengine_openapi_client/models/provider_layer_collection_id.py +++ b/python/geoengine_openapi_client/models/provider_layer_collection_id.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +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 ProviderLayerCollectionId(BaseModel): """ ProviderLayerCollectionId - """ - collection_id: StrictStr = Field(..., alias="collectionId") - provider_id: StrictStr = Field(..., alias="providerId") - __properties = ["collectionId", "providerId"] + """ # noqa: E501 + collection_id: StrictStr = Field(alias="collectionId") + provider_id: StrictStr = Field(alias="providerId") + __properties: ClassVar[List[str]] = ["collectionId", "providerId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> ProviderLayerCollectionId: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProviderLayerCollectionId 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) + 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: dict) -> ProviderLayerCollectionId: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProviderLayerCollectionId from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProviderLayerCollectionId.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProviderLayerCollectionId.parse_obj({ - "collection_id": obj.get("collectionId"), - "provider_id": obj.get("providerId") + _obj = cls.model_validate({ + "collectionId": obj.get("collectionId"), + "providerId": obj.get("providerId") }) return _obj diff --git a/python/geoengine_openapi_client/models/provider_layer_id.py b/python/geoengine_openapi_client/models/provider_layer_id.py index 54a3afe6..0c2f1b35 100644 --- a/python/geoengine_openapi_client/models/provider_layer_id.py +++ b/python/geoengine_openapi_client/models/provider_layer_id.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +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 ProviderLayerId(BaseModel): """ ProviderLayerId - """ - layer_id: StrictStr = Field(..., alias="layerId") - provider_id: StrictStr = Field(..., alias="providerId") - __properties = ["layerId", "providerId"] + """ # noqa: E501 + layer_id: StrictStr = Field(alias="layerId") + provider_id: StrictStr = Field(alias="providerId") + __properties: ClassVar[List[str]] = ["layerId", "providerId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> ProviderLayerId: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProviderLayerId 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) + 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: dict) -> ProviderLayerId: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProviderLayerId from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProviderLayerId.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProviderLayerId.parse_obj({ - "layer_id": obj.get("layerId"), - "provider_id": obj.get("providerId") + _obj = cls.model_validate({ + "layerId": obj.get("layerId"), + "providerId": obj.get("providerId") }) return _obj diff --git a/python/geoengine_openapi_client/models/quota.py b/python/geoengine_openapi_client/models/quota.py index b3e6880c..0894165a 100644 --- a/python/geoengine_openapi_client/models/quota.py +++ b/python/geoengine_openapi_client/models/quota.py @@ -18,54 +18,71 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictInt, conint +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Quota(BaseModel): """ Quota - """ - available: StrictInt = Field(...) - used: conint(strict=True, ge=0) = Field(...) - __properties = ["available", "used"] + """ # noqa: E501 + available: StrictInt + used: Annotated[int, Field(strict=True, ge=0)] + __properties: ClassVar[List[str]] = ["available", "used"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> Quota: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Quota 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) + 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: dict) -> Quota: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Quota from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Quota.parse_obj(obj) + return cls.model_validate(obj) - _obj = Quota.parse_obj({ + _obj = cls.model_validate({ "available": obj.get("available"), "used": obj.get("used") }) diff --git a/python/geoengine_openapi_client/models/raster_band_descriptor.py b/python/geoengine_openapi_client/models/raster_band_descriptor.py index 2b02ccc9..7210ada6 100644 --- a/python/geoengine_openapi_client/models/raster_band_descriptor.py +++ b/python/geoengine_openapi_client/models/raster_band_descriptor.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.measurement import Measurement +from typing import Optional, Set +from typing_extensions import Self class RasterBandDescriptor(BaseModel): """ RasterBandDescriptor - """ - measurement: Measurement = Field(...) - name: StrictStr = Field(...) - __properties = ["measurement", "name"] + """ # noqa: E501 + measurement: Measurement + name: StrictStr + __properties: ClassVar[List[str]] = ["measurement", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> RasterBandDescriptor: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RasterBandDescriptor 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of measurement if self.measurement: _dict['measurement'] = self.measurement.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> RasterBandDescriptor: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RasterBandDescriptor from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RasterBandDescriptor.parse_obj(obj) + return cls.model_validate(obj) - _obj = RasterBandDescriptor.parse_obj({ - "measurement": Measurement.from_dict(obj.get("measurement")) if obj.get("measurement") is not None else None, + _obj = cls.model_validate({ + "measurement": Measurement.from_dict(obj["measurement"]) if obj.get("measurement") is not None else None, "name": obj.get("name") }) return _obj diff --git a/python/geoengine_openapi_client/models/raster_colorizer.py b/python/geoengine_openapi_client/models/raster_colorizer.py index e506a151..d9f061d2 100644 --- a/python/geoengine_openapi_client/models/raster_colorizer.py +++ b/python/geoengine_openapi_client/models/raster_colorizer.py @@ -14,17 +14,15 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.multi_band_raster_colorizer import MultiBandRasterColorizer from geoengine_openapi_client.models.single_band_raster_colorizer import SingleBandRasterColorizer -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self RASTERCOLORIZER_ONE_OF_SCHEMAS = ["MultiBandRasterColorizer", "SingleBandRasterColorizer"] @@ -36,16 +34,16 @@ class RasterColorizer(BaseModel): oneof_schema_1_validator: Optional[SingleBandRasterColorizer] = None # data type: MultiBandRasterColorizer oneof_schema_2_validator: Optional[MultiBandRasterColorizer] = None - if TYPE_CHECKING: - actual_instance: Union[MultiBandRasterColorizer, SingleBandRasterColorizer] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(RASTERCOLORIZER_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[MultiBandRasterColorizer, SingleBandRasterColorizer]] = None + one_of_schemas: Set[str] = { "MultiBandRasterColorizer", "SingleBandRasterColorizer" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -58,9 +56,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = RasterColorizer.construct() + instance = RasterColorizer.model_construct() error_messages = [] match = 0 # validate data type: SingleBandRasterColorizer @@ -83,13 +81,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> RasterColorizer: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> RasterColorizer: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = RasterColorizer.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -99,22 +97,22 @@ def from_json(cls, json_str: str) -> RasterColorizer: raise ValueError("Failed to lookup data type from the field `type` in the input.") # check if data type is `MultiBandRasterColorizer` - if _data_type == "MultiBandRasterColorizer": + if _data_type == "multiBand": instance.actual_instance = MultiBandRasterColorizer.from_json(json_str) return instance # check if data type is `SingleBandRasterColorizer` - if _data_type == "SingleBandRasterColorizer": + if _data_type == "singleBand": instance.actual_instance = SingleBandRasterColorizer.from_json(json_str) return instance # check if data type is `MultiBandRasterColorizer` - if _data_type == "multiBand": + if _data_type == "MultiBandRasterColorizer": instance.actual_instance = MultiBandRasterColorizer.from_json(json_str) return instance # check if data type is `SingleBandRasterColorizer` - if _data_type == "singleBand": + if _data_type == "SingleBandRasterColorizer": instance.actual_instance = SingleBandRasterColorizer.from_json(json_str) return instance @@ -145,19 +143,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], MultiBandRasterColorizer, SingleBandRasterColorizer]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -165,6 +161,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/raster_data_type.py b/python/geoengine_openapi_client/models/raster_data_type.py index f3ec3610..b6d0d198 100644 --- a/python/geoengine_openapi_client/models/raster_data_type.py +++ b/python/geoengine_openapi_client/models/raster_data_type.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class RasterDataType(str, Enum): @@ -42,8 +39,8 @@ class RasterDataType(str, Enum): F64 = 'F64' @classmethod - def from_json(cls, json_str: str) -> RasterDataType: + def from_json(cls, json_str: str) -> Self: """Create an instance of RasterDataType from a JSON string""" - return RasterDataType(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/raster_dataset_from_workflow.py b/python/geoengine_openapi_client/models/raster_dataset_from_workflow.py index d65b57ce..658002c1 100644 --- a/python/geoengine_openapi_client/models/raster_dataset_from_workflow.py +++ b/python/geoengine_openapi_client/models/raster_dataset_from_workflow.py @@ -18,78 +18,92 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.raster_query_rectangle import RasterQueryRectangle +from typing import Optional, Set +from typing_extensions import Self class RasterDatasetFromWorkflow(BaseModel): """ - parameter for the dataset from workflow handler (body) # noqa: E501 - """ - as_cog: Optional[StrictBool] = Field(True, alias="asCog") + parameter for the dataset from workflow handler (body) + """ # noqa: E501 + as_cog: Optional[StrictBool] = Field(default=True, alias="asCog") description: Optional[StrictStr] = None - display_name: StrictStr = Field(..., alias="displayName") + display_name: StrictStr = Field(alias="displayName") name: Optional[StrictStr] = None - query: RasterQueryRectangle = Field(...) - __properties = ["asCog", "description", "displayName", "name", "query"] + query: RasterQueryRectangle + __properties: ClassVar[List[str]] = ["asCog", "description", "displayName", "name", "query"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> RasterDatasetFromWorkflow: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RasterDatasetFromWorkflow 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, - # Note: remove as_cog when set to default - exclude_defaults=True) + 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, + ) # override the default output from pydantic by calling `to_dict()` of query if self.query: _dict['query'] = self.query.to_dict() # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> RasterDatasetFromWorkflow: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RasterDatasetFromWorkflow from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RasterDatasetFromWorkflow.parse_obj(obj) + return cls.model_validate(obj) - _obj = RasterDatasetFromWorkflow.parse_obj({ - "as_cog": obj.get("asCog") if obj.get("asCog") is not None else True, + _obj = cls.model_validate({ + "asCog": obj.get("asCog") if obj.get("asCog") is not None else True, "description": obj.get("description"), - "display_name": obj.get("displayName"), + "displayName": obj.get("displayName"), "name": obj.get("name"), - "query": RasterQueryRectangle.from_dict(obj.get("query")) if obj.get("query") is not None else None + "query": RasterQueryRectangle.from_dict(obj["query"]) if obj.get("query") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/raster_dataset_from_workflow_result.py b/python/geoengine_openapi_client/models/raster_dataset_from_workflow_result.py index cc3f962c..418199a8 100644 --- a/python/geoengine_openapi_client/models/raster_dataset_from_workflow_result.py +++ b/python/geoengine_openapi_client/models/raster_dataset_from_workflow_result.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class RasterDatasetFromWorkflowResult(BaseModel): """ - response of the dataset from workflow handler # noqa: E501 - """ - dataset: StrictStr = Field(...) - upload: StrictStr = Field(...) - __properties = ["dataset", "upload"] + response of the dataset from workflow handler + """ # noqa: E501 + dataset: StrictStr + upload: StrictStr + __properties: ClassVar[List[str]] = ["dataset", "upload"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> RasterDatasetFromWorkflowResult: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RasterDatasetFromWorkflowResult 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) + 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: dict) -> RasterDatasetFromWorkflowResult: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RasterDatasetFromWorkflowResult from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RasterDatasetFromWorkflowResult.parse_obj(obj) + return cls.model_validate(obj) - _obj = RasterDatasetFromWorkflowResult.parse_obj({ + _obj = cls.model_validate({ "dataset": obj.get("dataset"), "upload": obj.get("upload") }) diff --git a/python/geoengine_openapi_client/models/raster_properties_entry_type.py b/python/geoengine_openapi_client/models/raster_properties_entry_type.py index 44a49ab9..ffe87d2f 100644 --- a/python/geoengine_openapi_client/models/raster_properties_entry_type.py +++ b/python/geoengine_openapi_client/models/raster_properties_entry_type.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class RasterPropertiesEntryType(str, Enum): @@ -34,8 +31,8 @@ class RasterPropertiesEntryType(str, Enum): STRING = 'String' @classmethod - def from_json(cls, json_str: str) -> RasterPropertiesEntryType: + def from_json(cls, json_str: str) -> Self: """Create an instance of RasterPropertiesEntryType from a JSON string""" - return RasterPropertiesEntryType(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/raster_properties_key.py b/python/geoengine_openapi_client/models/raster_properties_key.py index 5d8c235b..772994e1 100644 --- a/python/geoengine_openapi_client/models/raster_properties_key.py +++ b/python/geoengine_openapi_client/models/raster_properties_key.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class RasterPropertiesKey(BaseModel): """ RasterPropertiesKey - """ + """ # noqa: E501 domain: Optional[StrictStr] = None - key: StrictStr = Field(...) - __properties = ["domain", "key"] + key: StrictStr + __properties: ClassVar[List[str]] = ["domain", "key"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> RasterPropertiesKey: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RasterPropertiesKey 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) + 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 domain (nullable) is None - # and __fields_set__ contains the field - if self.domain is None and "domain" in self.__fields_set__: + # and model_fields_set contains the field + if self.domain is None and "domain" in self.model_fields_set: _dict['domain'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> RasterPropertiesKey: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RasterPropertiesKey from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RasterPropertiesKey.parse_obj(obj) + return cls.model_validate(obj) - _obj = RasterPropertiesKey.parse_obj({ + _obj = cls.model_validate({ "domain": obj.get("domain"), "key": obj.get("key") }) diff --git a/python/geoengine_openapi_client/models/raster_query_rectangle.py b/python/geoengine_openapi_client/models/raster_query_rectangle.py index 8a72e94c..54b23f83 100644 --- a/python/geoengine_openapi_client/models/raster_query_rectangle.py +++ b/python/geoengine_openapi_client/models/raster_query_rectangle.py @@ -18,46 +18,62 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.spatial_partition2_d import SpatialPartition2D from geoengine_openapi_client.models.spatial_resolution import SpatialResolution from geoengine_openapi_client.models.time_interval import TimeInterval +from typing import Optional, Set +from typing_extensions import Self class RasterQueryRectangle(BaseModel): """ - A spatio-temporal rectangle with a specified resolution # noqa: E501 - """ - spatial_bounds: SpatialPartition2D = Field(..., alias="spatialBounds") - spatial_resolution: SpatialResolution = Field(..., alias="spatialResolution") - time_interval: TimeInterval = Field(..., alias="timeInterval") - __properties = ["spatialBounds", "spatialResolution", "timeInterval"] + A spatio-temporal rectangle with a specified resolution + """ # noqa: E501 + spatial_bounds: SpatialPartition2D = Field(alias="spatialBounds") + spatial_resolution: SpatialResolution = Field(alias="spatialResolution") + time_interval: TimeInterval = Field(alias="timeInterval") + __properties: ClassVar[List[str]] = ["spatialBounds", "spatialResolution", "timeInterval"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> RasterQueryRectangle: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RasterQueryRectangle 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of spatial_bounds if self.spatial_bounds: _dict['spatialBounds'] = self.spatial_bounds.to_dict() @@ -70,18 +86,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> RasterQueryRectangle: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RasterQueryRectangle from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RasterQueryRectangle.parse_obj(obj) + return cls.model_validate(obj) - _obj = RasterQueryRectangle.parse_obj({ - "spatial_bounds": SpatialPartition2D.from_dict(obj.get("spatialBounds")) if obj.get("spatialBounds") is not None else None, - "spatial_resolution": SpatialResolution.from_dict(obj.get("spatialResolution")) if obj.get("spatialResolution") is not None else None, - "time_interval": TimeInterval.from_dict(obj.get("timeInterval")) if obj.get("timeInterval") is not None else None + _obj = cls.model_validate({ + "spatialBounds": SpatialPartition2D.from_dict(obj["spatialBounds"]) if obj.get("spatialBounds") is not None else None, + "spatialResolution": SpatialResolution.from_dict(obj["spatialResolution"]) if obj.get("spatialResolution") is not None else None, + "timeInterval": TimeInterval.from_dict(obj["timeInterval"]) if obj.get("timeInterval") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/raster_result_descriptor.py b/python/geoengine_openapi_client/models/raster_result_descriptor.py index 3947a16c..ebd3a694 100644 --- a/python/geoengine_openapi_client/models/raster_result_descriptor.py +++ b/python/geoengine_openapi_client/models/raster_result_descriptor.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.raster_band_descriptor import RasterBandDescriptor from geoengine_openapi_client.models.raster_data_type import RasterDataType from geoengine_openapi_client.models.spatial_partition2_d import SpatialPartition2D from geoengine_openapi_client.models.spatial_resolution import SpatialResolution from geoengine_openapi_client.models.time_interval import TimeInterval +from typing import Optional, Set +from typing_extensions import Self class RasterResultDescriptor(BaseModel): """ - A `ResultDescriptor` for raster queries # noqa: E501 - """ - bands: conlist(RasterBandDescriptor) = Field(...) + A `ResultDescriptor` for raster queries + """ # noqa: E501 + bands: List[RasterBandDescriptor] bbox: Optional[SpatialPartition2D] = None - data_type: RasterDataType = Field(..., alias="dataType") + data_type: RasterDataType = Field(alias="dataType") resolution: Optional[SpatialResolution] = None - spatial_reference: StrictStr = Field(..., alias="spatialReference") + spatial_reference: StrictStr = Field(alias="spatialReference") time: Optional[TimeInterval] = None - __properties = ["bands", "bbox", "dataType", "resolution", "spatialReference", "time"] + __properties: ClassVar[List[str]] = ["bands", "bbox", "dataType", "resolution", "spatialReference", "time"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> RasterResultDescriptor: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RasterResultDescriptor 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in bands (list) _items = [] if self.bands: - for _item in self.bands: - if _item: - _items.append(_item.to_dict()) + for _item_bands in self.bands: + if _item_bands: + _items.append(_item_bands.to_dict()) _dict['bands'] = _items # override the default output from pydantic by calling `to_dict()` of bbox if self.bbox: @@ -80,38 +96,38 @@ def to_dict(self): if self.time: _dict['time'] = self.time.to_dict() # set to None if bbox (nullable) is None - # and __fields_set__ contains the field - if self.bbox is None and "bbox" in self.__fields_set__: + # and model_fields_set contains the field + if self.bbox is None and "bbox" in self.model_fields_set: _dict['bbox'] = None # set to None if resolution (nullable) is None - # and __fields_set__ contains the field - if self.resolution is None and "resolution" in self.__fields_set__: + # and model_fields_set contains the field + if self.resolution is None and "resolution" in self.model_fields_set: _dict['resolution'] = None # set to None if time (nullable) is None - # and __fields_set__ contains the field - if self.time is None and "time" in self.__fields_set__: + # and model_fields_set contains the field + if self.time is None and "time" in self.model_fields_set: _dict['time'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> RasterResultDescriptor: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RasterResultDescriptor from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RasterResultDescriptor.parse_obj(obj) - - _obj = RasterResultDescriptor.parse_obj({ - "bands": [RasterBandDescriptor.from_dict(_item) for _item in obj.get("bands")] if obj.get("bands") is not None else None, - "bbox": SpatialPartition2D.from_dict(obj.get("bbox")) if obj.get("bbox") is not None else None, - "data_type": obj.get("dataType"), - "resolution": SpatialResolution.from_dict(obj.get("resolution")) if obj.get("resolution") is not None else None, - "spatial_reference": obj.get("spatialReference"), - "time": TimeInterval.from_dict(obj.get("time")) if obj.get("time") is not None else None + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bands": [RasterBandDescriptor.from_dict(_item) for _item in obj["bands"]] if obj.get("bands") is not None else None, + "bbox": SpatialPartition2D.from_dict(obj["bbox"]) if obj.get("bbox") is not None else None, + "dataType": obj.get("dataType"), + "resolution": SpatialResolution.from_dict(obj["resolution"]) if obj.get("resolution") is not None else None, + "spatialReference": obj.get("spatialReference"), + "time": TimeInterval.from_dict(obj["time"]) if obj.get("time") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/raster_stream_websocket_result_type.py b/python/geoengine_openapi_client/models/raster_stream_websocket_result_type.py index de617a26..27e9af1f 100644 --- a/python/geoengine_openapi_client/models/raster_stream_websocket_result_type.py +++ b/python/geoengine_openapi_client/models/raster_stream_websocket_result_type.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class RasterStreamWebsocketResultType(str, Enum): @@ -33,8 +30,8 @@ class RasterStreamWebsocketResultType(str, Enum): ARROW = 'arrow' @classmethod - def from_json(cls, json_str: str) -> RasterStreamWebsocketResultType: + def from_json(cls, json_str: str) -> Self: """Create an instance of RasterStreamWebsocketResultType from a JSON string""" - return RasterStreamWebsocketResultType(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/raster_symbology.py b/python/geoengine_openapi_client/models/raster_symbology.py index d3b83553..5cb39404 100644 --- a/python/geoengine_openapi_client/models/raster_symbology.py +++ b/python/geoengine_openapi_client/models/raster_symbology.py @@ -18,68 +18,84 @@ import re # noqa: F401 import json - -from typing import Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union from geoengine_openapi_client.models.raster_colorizer import RasterColorizer +from typing import Optional, Set +from typing_extensions import Self class RasterSymbology(BaseModel): """ RasterSymbology - """ - opacity: Union[StrictFloat, StrictInt] = Field(...) - raster_colorizer: RasterColorizer = Field(..., alias="rasterColorizer") - type: StrictStr = Field(...) - __properties = ["opacity", "rasterColorizer", "type"] + """ # noqa: E501 + opacity: Union[StrictFloat, StrictInt] + raster_colorizer: RasterColorizer = Field(alias="rasterColorizer") + type: StrictStr + __properties: ClassVar[List[str]] = ["opacity", "rasterColorizer", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('raster', 'point', 'line', 'polygon'): - raise ValueError("must be one of enum values ('raster', 'point', 'line', 'polygon')") + if value not in set(['raster']): + raise ValueError("must be one of enum values ('raster')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> RasterSymbology: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RasterSymbology 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of raster_colorizer if self.raster_colorizer: _dict['rasterColorizer'] = self.raster_colorizer.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> RasterSymbology: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RasterSymbology from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RasterSymbology.parse_obj(obj) + return cls.model_validate(obj) - _obj = RasterSymbology.parse_obj({ + _obj = cls.model_validate({ "opacity": obj.get("opacity"), - "raster_colorizer": RasterColorizer.from_dict(obj.get("rasterColorizer")) if obj.get("rasterColorizer") is not None else None, + "rasterColorizer": RasterColorizer.from_dict(obj["rasterColorizer"]) if obj.get("rasterColorizer") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/resource.py b/python/geoengine_openapi_client/models/resource.py index 85c8a0f5..945c16a1 100644 --- a/python/geoengine_openapi_client/models/resource.py +++ b/python/geoengine_openapi_client/models/resource.py @@ -14,20 +14,18 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.dataset_resource import DatasetResource from geoengine_openapi_client.models.layer_collection_resource import LayerCollectionResource from geoengine_openapi_client.models.layer_resource import LayerResource from geoengine_openapi_client.models.ml_model_resource import MlModelResource from geoengine_openapi_client.models.project_resource import ProjectResource -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self RESOURCE_ONE_OF_SCHEMAS = ["DatasetResource", "LayerCollectionResource", "LayerResource", "MlModelResource", "ProjectResource"] @@ -45,16 +43,16 @@ class Resource(BaseModel): oneof_schema_4_validator: Optional[DatasetResource] = None # data type: MlModelResource oneof_schema_5_validator: Optional[MlModelResource] = None - if TYPE_CHECKING: - actual_instance: Union[DatasetResource, LayerCollectionResource, LayerResource, MlModelResource, ProjectResource] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(RESOURCE_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[DatasetResource, LayerCollectionResource, LayerResource, MlModelResource, ProjectResource]] = None + one_of_schemas: Set[str] = { "DatasetResource", "LayerCollectionResource", "LayerResource", "MlModelResource", "ProjectResource" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -67,9 +65,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = Resource.construct() + instance = Resource.model_construct() error_messages = [] match = 0 # validate data type: LayerResource @@ -107,13 +105,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> Resource: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> Resource: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = Resource.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -123,52 +121,52 @@ def from_json(cls, json_str: str) -> Resource: raise ValueError("Failed to lookup data type from the field `type` in the input.") # check if data type is `DatasetResource` - if _data_type == "DatasetResource": + if _data_type == "dataset": instance.actual_instance = DatasetResource.from_json(json_str) return instance - # check if data type is `LayerCollectionResource` - if _data_type == "LayerCollectionResource": - instance.actual_instance = LayerCollectionResource.from_json(json_str) - return instance - # check if data type is `LayerResource` - if _data_type == "LayerResource": + if _data_type == "layer": instance.actual_instance = LayerResource.from_json(json_str) return instance + # check if data type is `LayerCollectionResource` + if _data_type == "layerCollection": + instance.actual_instance = LayerCollectionResource.from_json(json_str) + return instance + # check if data type is `MlModelResource` - if _data_type == "MlModelResource": + if _data_type == "mlModel": instance.actual_instance = MlModelResource.from_json(json_str) return instance # check if data type is `ProjectResource` - if _data_type == "ProjectResource": + if _data_type == "project": instance.actual_instance = ProjectResource.from_json(json_str) return instance # check if data type is `DatasetResource` - if _data_type == "dataset": + if _data_type == "DatasetResource": instance.actual_instance = DatasetResource.from_json(json_str) return instance - # check if data type is `LayerResource` - if _data_type == "layer": - instance.actual_instance = LayerResource.from_json(json_str) - return instance - # check if data type is `LayerCollectionResource` - if _data_type == "layerCollection": + if _data_type == "LayerCollectionResource": instance.actual_instance = LayerCollectionResource.from_json(json_str) return instance + # check if data type is `LayerResource` + if _data_type == "LayerResource": + instance.actual_instance = LayerResource.from_json(json_str) + return instance + # check if data type is `MlModelResource` - if _data_type == "mlModel": + if _data_type == "MlModelResource": instance.actual_instance = MlModelResource.from_json(json_str) return instance # check if data type is `ProjectResource` - if _data_type == "project": + if _data_type == "ProjectResource": instance.actual_instance = ProjectResource.from_json(json_str) return instance @@ -217,19 +215,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], DatasetResource, LayerCollectionResource, LayerResource, MlModelResource, ProjectResource]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -237,6 +233,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/resource_id.py b/python/geoengine_openapi_client/models/resource_id.py index 4ecdc1d6..d3c65100 100644 --- a/python/geoengine_openapi_client/models/resource_id.py +++ b/python/geoengine_openapi_client/models/resource_id.py @@ -14,20 +14,18 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.resource_id_dataset_id import ResourceIdDatasetId from geoengine_openapi_client.models.resource_id_layer import ResourceIdLayer from geoengine_openapi_client.models.resource_id_layer_collection import ResourceIdLayerCollection from geoengine_openapi_client.models.resource_id_ml_model import ResourceIdMlModel from geoengine_openapi_client.models.resource_id_project import ResourceIdProject -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self RESOURCEID_ONE_OF_SCHEMAS = ["ResourceIdDatasetId", "ResourceIdLayer", "ResourceIdLayerCollection", "ResourceIdMlModel", "ResourceIdProject"] @@ -45,16 +43,16 @@ class ResourceId(BaseModel): oneof_schema_4_validator: Optional[ResourceIdDatasetId] = None # data type: ResourceIdMlModel oneof_schema_5_validator: Optional[ResourceIdMlModel] = None - if TYPE_CHECKING: - actual_instance: Union[ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdMlModel, ResourceIdProject] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(RESOURCEID_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdMlModel, ResourceIdProject]] = None + one_of_schemas: Set[str] = { "ResourceIdDatasetId", "ResourceIdLayer", "ResourceIdLayerCollection", "ResourceIdMlModel", "ResourceIdProject" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -67,9 +65,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = ResourceId.construct() + instance = ResourceId.model_construct() error_messages = [] match = 0 # validate data type: ResourceIdLayer @@ -107,13 +105,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> ResourceId: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> ResourceId: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = ResourceId.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -217,19 +215,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdMlModel, ResourceIdProject]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -237,6 +233,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/resource_id_dataset_id.py b/python/geoengine_openapi_client/models/resource_id_dataset_id.py index e877e979..a7569284 100644 --- a/python/geoengine_openapi_client/models/resource_id_dataset_id.py +++ b/python/geoengine_openapi_client/models/resource_id_dataset_id.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ResourceIdDatasetId(BaseModel): """ ResourceIdDatasetId - """ - id: StrictStr = Field(...) - type: StrictStr = Field(...) - __properties = ["id", "type"] + """ # noqa: E501 + id: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["id", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('DatasetId'): + if value not in set(['DatasetId']): raise ValueError("must be one of enum values ('DatasetId')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> ResourceIdDatasetId: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ResourceIdDatasetId 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) + 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: dict) -> ResourceIdDatasetId: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ResourceIdDatasetId from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ResourceIdDatasetId.parse_obj(obj) + return cls.model_validate(obj) - _obj = ResourceIdDatasetId.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/resource_id_layer.py b/python/geoengine_openapi_client/models/resource_id_layer.py index e2f90be2..8522d767 100644 --- a/python/geoengine_openapi_client/models/resource_id_layer.py +++ b/python/geoengine_openapi_client/models/resource_id_layer.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ResourceIdLayer(BaseModel): """ ResourceIdLayer - """ - id: StrictStr = Field(...) - type: StrictStr = Field(...) - __properties = ["id", "type"] + """ # noqa: E501 + id: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["id", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('Layer', 'LayerCollection', 'Project', 'DatasetId', 'MlModel'): - raise ValueError("must be one of enum values ('Layer', 'LayerCollection', 'Project', 'DatasetId', 'MlModel')") + if value not in set(['Layer']): + raise ValueError("must be one of enum values ('Layer')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> ResourceIdLayer: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ResourceIdLayer 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) + 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: dict) -> ResourceIdLayer: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ResourceIdLayer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ResourceIdLayer.parse_obj(obj) + return cls.model_validate(obj) - _obj = ResourceIdLayer.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/resource_id_layer_collection.py b/python/geoengine_openapi_client/models/resource_id_layer_collection.py index e0097de3..045fcb6d 100644 --- a/python/geoengine_openapi_client/models/resource_id_layer_collection.py +++ b/python/geoengine_openapi_client/models/resource_id_layer_collection.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ResourceIdLayerCollection(BaseModel): """ ResourceIdLayerCollection - """ - id: StrictStr = Field(...) - type: StrictStr = Field(...) - __properties = ["id", "type"] + """ # noqa: E501 + id: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["id", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('LayerCollection'): + if value not in set(['LayerCollection']): raise ValueError("must be one of enum values ('LayerCollection')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> ResourceIdLayerCollection: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ResourceIdLayerCollection 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) + 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: dict) -> ResourceIdLayerCollection: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ResourceIdLayerCollection from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ResourceIdLayerCollection.parse_obj(obj) + return cls.model_validate(obj) - _obj = ResourceIdLayerCollection.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/resource_id_ml_model.py b/python/geoengine_openapi_client/models/resource_id_ml_model.py index 065318dc..425a99b4 100644 --- a/python/geoengine_openapi_client/models/resource_id_ml_model.py +++ b/python/geoengine_openapi_client/models/resource_id_ml_model.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ResourceIdMlModel(BaseModel): """ ResourceIdMlModel - """ - id: StrictStr = Field(...) - type: StrictStr = Field(...) - __properties = ["id", "type"] + """ # noqa: E501 + id: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["id", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('MlModel'): + if value not in set(['MlModel']): raise ValueError("must be one of enum values ('MlModel')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> ResourceIdMlModel: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ResourceIdMlModel 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) + 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: dict) -> ResourceIdMlModel: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ResourceIdMlModel from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ResourceIdMlModel.parse_obj(obj) + return cls.model_validate(obj) - _obj = ResourceIdMlModel.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/resource_id_project.py b/python/geoengine_openapi_client/models/resource_id_project.py index 76a5a19c..f295382e 100644 --- a/python/geoengine_openapi_client/models/resource_id_project.py +++ b/python/geoengine_openapi_client/models/resource_id_project.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ResourceIdProject(BaseModel): """ ResourceIdProject - """ - id: StrictStr = Field(...) - type: StrictStr = Field(...) - __properties = ["id", "type"] + """ # noqa: E501 + id: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["id", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('Project'): + if value not in set(['Project']): raise ValueError("must be one of enum values ('Project')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> ResourceIdProject: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ResourceIdProject 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) + 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: dict) -> ResourceIdProject: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ResourceIdProject from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ResourceIdProject.parse_obj(obj) + return cls.model_validate(obj) - _obj = ResourceIdProject.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type") }) diff --git a/python/geoengine_openapi_client/models/role.py b/python/geoengine_openapi_client/models/role.py index d6723964..ea00a20b 100644 --- a/python/geoengine_openapi_client/models/role.py +++ b/python/geoengine_openapi_client/models/role.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class Role(BaseModel): """ Role - """ - id: StrictStr = Field(...) - name: StrictStr = Field(...) - __properties = ["id", "name"] + """ # noqa: E501 + id: StrictStr + name: StrictStr + __properties: ClassVar[List[str]] = ["id", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> Role: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Role 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) + 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: dict) -> Role: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Role from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Role.parse_obj(obj) + return cls.model_validate(obj) - _obj = Role.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name") }) diff --git a/python/geoengine_openapi_client/models/role_description.py b/python/geoengine_openapi_client/models/role_description.py index 8e9d8b35..2836111f 100644 --- a/python/geoengine_openapi_client/models/role_description.py +++ b/python/geoengine_openapi_client/models/role_description.py @@ -18,60 +18,76 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictBool +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.role import Role +from typing import Optional, Set +from typing_extensions import Self class RoleDescription(BaseModel): """ RoleDescription - """ - individual: StrictBool = Field(...) - role: Role = Field(...) - __properties = ["individual", "role"] + """ # noqa: E501 + individual: StrictBool + role: Role + __properties: ClassVar[List[str]] = ["individual", "role"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> RoleDescription: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RoleDescription 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of role if self.role: _dict['role'] = self.role.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> RoleDescription: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RoleDescription from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RoleDescription.parse_obj(obj) + return cls.model_validate(obj) - _obj = RoleDescription.parse_obj({ + _obj = cls.model_validate({ "individual": obj.get("individual"), - "role": Role.from_dict(obj.get("role")) if obj.get("role") is not None else None + "role": Role.from_dict(obj["role"]) if obj.get("role") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/search_capabilities.py b/python/geoengine_openapi_client/models/search_capabilities.py index e4b6ba5a..e2d80aaa 100644 --- a/python/geoengine_openapi_client/models/search_capabilities.py +++ b/python/geoengine_openapi_client/models/search_capabilities.py @@ -18,67 +18,83 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.search_types import SearchTypes +from typing import Optional, Set +from typing_extensions import Self class SearchCapabilities(BaseModel): """ SearchCapabilities - """ - autocomplete: StrictBool = Field(...) - filters: Optional[conlist(StrictStr)] = None - search_types: SearchTypes = Field(..., alias="searchTypes") - __properties = ["autocomplete", "filters", "searchTypes"] + """ # noqa: E501 + autocomplete: StrictBool + filters: Optional[List[StrictStr]] = None + search_types: SearchTypes = Field(alias="searchTypes") + __properties: ClassVar[List[str]] = ["autocomplete", "filters", "searchTypes"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> SearchCapabilities: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SearchCapabilities 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of search_types if self.search_types: _dict['searchTypes'] = self.search_types.to_dict() # set to None if filters (nullable) is None - # and __fields_set__ contains the field - if self.filters is None and "filters" in self.__fields_set__: + # and model_fields_set contains the field + if self.filters is None and "filters" in self.model_fields_set: _dict['filters'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> SearchCapabilities: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SearchCapabilities from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SearchCapabilities.parse_obj(obj) + return cls.model_validate(obj) - _obj = SearchCapabilities.parse_obj({ + _obj = cls.model_validate({ "autocomplete": obj.get("autocomplete"), "filters": obj.get("filters"), - "search_types": SearchTypes.from_dict(obj.get("searchTypes")) if obj.get("searchTypes") is not None else None + "searchTypes": SearchTypes.from_dict(obj["searchTypes"]) if obj.get("searchTypes") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/search_type.py b/python/geoengine_openapi_client/models/search_type.py index c4b7683d..3a608b52 100644 --- a/python/geoengine_openapi_client/models/search_type.py +++ b/python/geoengine_openapi_client/models/search_type.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class SearchType(str, Enum): @@ -34,8 +31,8 @@ class SearchType(str, Enum): PREFIX = 'prefix' @classmethod - def from_json(cls, json_str: str) -> SearchType: + def from_json(cls, json_str: str) -> Self: """Create an instance of SearchType from a JSON string""" - return SearchType(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/search_types.py b/python/geoengine_openapi_client/models/search_types.py index e5d8e9a6..1571ad05 100644 --- a/python/geoengine_openapi_client/models/search_types.py +++ b/python/geoengine_openapi_client/models/search_types.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictBool +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class SearchTypes(BaseModel): """ SearchTypes - """ - fulltext: StrictBool = Field(...) - prefix: StrictBool = Field(...) - __properties = ["fulltext", "prefix"] + """ # noqa: E501 + fulltext: StrictBool + prefix: StrictBool + __properties: ClassVar[List[str]] = ["fulltext", "prefix"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> SearchTypes: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SearchTypes 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) + 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: dict) -> SearchTypes: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SearchTypes from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SearchTypes.parse_obj(obj) + return cls.model_validate(obj) - _obj = SearchTypes.parse_obj({ + _obj = cls.model_validate({ "fulltext": obj.get("fulltext"), "prefix": obj.get("prefix") }) diff --git a/python/geoengine_openapi_client/models/server_info.py b/python/geoengine_openapi_client/models/server_info.py index 7c706fca..98818a9d 100644 --- a/python/geoengine_openapi_client/models/server_info.py +++ b/python/geoengine_openapi_client/models/server_info.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +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 ServerInfo(BaseModel): """ ServerInfo - """ - build_date: StrictStr = Field(..., alias="buildDate") - commit_hash: StrictStr = Field(..., alias="commitHash") - features: StrictStr = Field(...) - version: StrictStr = Field(...) - __properties = ["buildDate", "commitHash", "features", "version"] + """ # noqa: E501 + build_date: StrictStr = Field(alias="buildDate") + commit_hash: StrictStr = Field(alias="commitHash") + features: StrictStr + version: StrictStr + __properties: ClassVar[List[str]] = ["buildDate", "commitHash", "features", "version"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> ServerInfo: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ServerInfo 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) + 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: dict) -> ServerInfo: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ServerInfo from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ServerInfo.parse_obj(obj) + return cls.model_validate(obj) - _obj = ServerInfo.parse_obj({ - "build_date": obj.get("buildDate"), - "commit_hash": obj.get("commitHash"), + _obj = cls.model_validate({ + "buildDate": obj.get("buildDate"), + "commitHash": obj.get("commitHash"), "features": obj.get("features"), "version": obj.get("version") }) diff --git a/python/geoengine_openapi_client/models/single_band_raster_colorizer.py b/python/geoengine_openapi_client/models/single_band_raster_colorizer.py index 69054635..98a6e928 100644 --- a/python/geoengine_openapi_client/models/single_band_raster_colorizer.py +++ b/python/geoengine_openapi_client/models/single_band_raster_colorizer.py @@ -18,68 +18,85 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, conint, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from geoengine_openapi_client.models.colorizer import Colorizer +from typing import Optional, Set +from typing_extensions import Self class SingleBandRasterColorizer(BaseModel): """ SingleBandRasterColorizer - """ - band: conint(strict=True, ge=0) = Field(...) - band_colorizer: Colorizer = Field(..., alias="bandColorizer") - type: StrictStr = Field(...) - __properties = ["band", "bandColorizer", "type"] + """ # noqa: E501 + band: Annotated[int, Field(strict=True, ge=0)] + band_colorizer: Colorizer = Field(alias="bandColorizer") + type: StrictStr + __properties: ClassVar[List[str]] = ["band", "bandColorizer", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('singleBand', 'multiBand'): - raise ValueError("must be one of enum values ('singleBand', 'multiBand')") + if value not in set(['singleBand']): + raise ValueError("must be one of enum values ('singleBand')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> SingleBandRasterColorizer: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SingleBandRasterColorizer 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of band_colorizer if self.band_colorizer: _dict['bandColorizer'] = self.band_colorizer.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> SingleBandRasterColorizer: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SingleBandRasterColorizer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SingleBandRasterColorizer.parse_obj(obj) + return cls.model_validate(obj) - _obj = SingleBandRasterColorizer.parse_obj({ + _obj = cls.model_validate({ "band": obj.get("band"), - "band_colorizer": Colorizer.from_dict(obj.get("bandColorizer")) if obj.get("bandColorizer") is not None else None, + "bandColorizer": Colorizer.from_dict(obj["bandColorizer"]) if obj.get("bandColorizer") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/spatial_partition2_d.py b/python/geoengine_openapi_client/models/spatial_partition2_d.py index aa6518fc..d853e7f8 100644 --- a/python/geoengine_openapi_client/models/spatial_partition2_d.py +++ b/python/geoengine_openapi_client/models/spatial_partition2_d.py @@ -18,43 +18,59 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.coordinate2_d import Coordinate2D +from typing import Optional, Set +from typing_extensions import Self class SpatialPartition2D(BaseModel): """ - A partition of space that include the upper left but excludes the lower right coordinate # noqa: E501 - """ - lower_right_coordinate: Coordinate2D = Field(..., alias="lowerRightCoordinate") - upper_left_coordinate: Coordinate2D = Field(..., alias="upperLeftCoordinate") - __properties = ["lowerRightCoordinate", "upperLeftCoordinate"] + A partition of space that include the upper left but excludes the lower right coordinate + """ # noqa: E501 + lower_right_coordinate: Coordinate2D = Field(alias="lowerRightCoordinate") + upper_left_coordinate: Coordinate2D = Field(alias="upperLeftCoordinate") + __properties: ClassVar[List[str]] = ["lowerRightCoordinate", "upperLeftCoordinate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> SpatialPartition2D: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SpatialPartition2D 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of lower_right_coordinate if self.lower_right_coordinate: _dict['lowerRightCoordinate'] = self.lower_right_coordinate.to_dict() @@ -64,17 +80,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> SpatialPartition2D: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SpatialPartition2D from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SpatialPartition2D.parse_obj(obj) + return cls.model_validate(obj) - _obj = SpatialPartition2D.parse_obj({ - "lower_right_coordinate": Coordinate2D.from_dict(obj.get("lowerRightCoordinate")) if obj.get("lowerRightCoordinate") is not None else None, - "upper_left_coordinate": Coordinate2D.from_dict(obj.get("upperLeftCoordinate")) if obj.get("upperLeftCoordinate") is not None else None + _obj = cls.model_validate({ + "lowerRightCoordinate": Coordinate2D.from_dict(obj["lowerRightCoordinate"]) if obj.get("lowerRightCoordinate") is not None else None, + "upperLeftCoordinate": Coordinate2D.from_dict(obj["upperLeftCoordinate"]) if obj.get("upperLeftCoordinate") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/spatial_reference_authority.py b/python/geoengine_openapi_client/models/spatial_reference_authority.py index f0445a59..a5719f31 100644 --- a/python/geoengine_openapi_client/models/spatial_reference_authority.py +++ b/python/geoengine_openapi_client/models/spatial_reference_authority.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class SpatialReferenceAuthority(str, Enum): @@ -36,8 +33,8 @@ class SpatialReferenceAuthority(str, Enum): ESRI = 'ESRI' @classmethod - def from_json(cls, json_str: str) -> SpatialReferenceAuthority: + def from_json(cls, json_str: str) -> Self: """Create an instance of SpatialReferenceAuthority from a JSON string""" - return SpatialReferenceAuthority(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/spatial_reference_specification.py b/python/geoengine_openapi_client/models/spatial_reference_specification.py index 29195af5..c56f6d0f 100644 --- a/python/geoengine_openapi_client/models/spatial_reference_specification.py +++ b/python/geoengine_openapi_client/models/spatial_reference_specification.py @@ -18,79 +18,96 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.axis_order import AxisOrder from geoengine_openapi_client.models.bounding_box2_d import BoundingBox2D +from typing import Optional, Set +from typing_extensions import Self class SpatialReferenceSpecification(BaseModel): """ - The specification of a spatial reference, where extent and axis labels are given in natural order (x, y) = (east, north) # noqa: E501 - """ - axis_labels: Optional[conlist(StrictStr, max_items=2, min_items=2)] = Field(None, alias="axisLabels") - axis_order: Optional[AxisOrder] = Field(None, alias="axisOrder") - extent: BoundingBox2D = Field(...) - name: StrictStr = Field(...) - proj_string: StrictStr = Field(..., alias="projString") - spatial_reference: StrictStr = Field(..., alias="spatialReference") - __properties = ["axisLabels", "axisOrder", "extent", "name", "projString", "spatialReference"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + The specification of a spatial reference, where extent and axis labels are given in natural order (x, y) = (east, north) + """ # noqa: E501 + axis_labels: Optional[Annotated[List[StrictStr], Field(min_length=2, max_length=2)]] = Field(default=None, alias="axisLabels") + axis_order: Optional[AxisOrder] = Field(default=None, alias="axisOrder") + extent: BoundingBox2D + name: StrictStr + proj_string: StrictStr = Field(alias="projString") + spatial_reference: StrictStr = Field(alias="spatialReference") + __properties: ClassVar[List[str]] = ["axisLabels", "axisOrder", "extent", "name", "projString", "spatialReference"] + + 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.dict(by_alias=True)) + 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) -> SpatialReferenceSpecification: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SpatialReferenceSpecification 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of extent if self.extent: _dict['extent'] = self.extent.to_dict() # set to None if axis_labels (nullable) is None - # and __fields_set__ contains the field - if self.axis_labels is None and "axis_labels" in self.__fields_set__: + # and model_fields_set contains the field + if self.axis_labels is None and "axis_labels" in self.model_fields_set: _dict['axisLabels'] = None # set to None if axis_order (nullable) is None - # and __fields_set__ contains the field - if self.axis_order is None and "axis_order" in self.__fields_set__: + # and model_fields_set contains the field + if self.axis_order is None and "axis_order" in self.model_fields_set: _dict['axisOrder'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> SpatialReferenceSpecification: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SpatialReferenceSpecification from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SpatialReferenceSpecification.parse_obj(obj) + return cls.model_validate(obj) - _obj = SpatialReferenceSpecification.parse_obj({ - "axis_labels": obj.get("axisLabels"), - "axis_order": obj.get("axisOrder"), - "extent": BoundingBox2D.from_dict(obj.get("extent")) if obj.get("extent") is not None else None, + _obj = cls.model_validate({ + "axisLabels": obj.get("axisLabels"), + "axisOrder": obj.get("axisOrder"), + "extent": BoundingBox2D.from_dict(obj["extent"]) if obj.get("extent") is not None else None, "name": obj.get("name"), - "proj_string": obj.get("projString"), - "spatial_reference": obj.get("spatialReference") + "projString": obj.get("projString"), + "spatialReference": obj.get("spatialReference") }) return _obj diff --git a/python/geoengine_openapi_client/models/spatial_resolution.py b/python/geoengine_openapi_client/models/spatial_resolution.py index 56f83660..3287be67 100644 --- a/python/geoengine_openapi_client/models/spatial_resolution.py +++ b/python/geoengine_openapi_client/models/spatial_resolution.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - -from typing import Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self class SpatialResolution(BaseModel): """ - The spatial resolution in SRS units # noqa: E501 - """ - x: Union[StrictFloat, StrictInt] = Field(...) - y: Union[StrictFloat, StrictInt] = Field(...) - __properties = ["x", "y"] + The spatial resolution in SRS units + """ # noqa: E501 + x: Union[StrictFloat, StrictInt] + y: Union[StrictFloat, StrictInt] + __properties: ClassVar[List[str]] = ["x", "y"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> SpatialResolution: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SpatialResolution 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) + 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: dict) -> SpatialResolution: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SpatialResolution from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SpatialResolution.parse_obj(obj) + return cls.model_validate(obj) - _obj = SpatialResolution.parse_obj({ + _obj = cls.model_validate({ "x": obj.get("x"), "y": obj.get("y") }) diff --git a/python/geoengine_openapi_client/models/st_rectangle.py b/python/geoengine_openapi_client/models/st_rectangle.py index 54ed6e3e..9f76d559 100644 --- a/python/geoengine_openapi_client/models/st_rectangle.py +++ b/python/geoengine_openapi_client/models/st_rectangle.py @@ -18,45 +18,61 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.bounding_box2_d import BoundingBox2D from geoengine_openapi_client.models.time_interval import TimeInterval +from typing import Optional, Set +from typing_extensions import Self class STRectangle(BaseModel): """ STRectangle - """ - bounding_box: BoundingBox2D = Field(..., alias="boundingBox") - spatial_reference: StrictStr = Field(..., alias="spatialReference") - time_interval: TimeInterval = Field(..., alias="timeInterval") - __properties = ["boundingBox", "spatialReference", "timeInterval"] + """ # noqa: E501 + bounding_box: BoundingBox2D = Field(alias="boundingBox") + spatial_reference: StrictStr = Field(alias="spatialReference") + time_interval: TimeInterval = Field(alias="timeInterval") + __properties: ClassVar[List[str]] = ["boundingBox", "spatialReference", "timeInterval"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> STRectangle: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of STRectangle 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of bounding_box if self.bounding_box: _dict['boundingBox'] = self.bounding_box.to_dict() @@ -66,18 +82,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> STRectangle: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of STRectangle from a dict""" if obj is None: return None if not isinstance(obj, dict): - return STRectangle.parse_obj(obj) + return cls.model_validate(obj) - _obj = STRectangle.parse_obj({ - "bounding_box": BoundingBox2D.from_dict(obj.get("boundingBox")) if obj.get("boundingBox") is not None else None, - "spatial_reference": obj.get("spatialReference"), - "time_interval": TimeInterval.from_dict(obj.get("timeInterval")) if obj.get("timeInterval") is not None else None + _obj = cls.model_validate({ + "boundingBox": BoundingBox2D.from_dict(obj["boundingBox"]) if obj.get("boundingBox") is not None else None, + "spatialReference": obj.get("spatialReference"), + "timeInterval": TimeInterval.from_dict(obj["timeInterval"]) if obj.get("timeInterval") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/static_number_param.py b/python/geoengine_openapi_client/models/static_number_param.py index ad096c79..d7eb4358 100644 --- a/python/geoengine_openapi_client/models/static_number_param.py +++ b/python/geoengine_openapi_client/models/static_number_param.py @@ -18,61 +18,78 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, conint, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class StaticNumberParam(BaseModel): """ StaticNumberParam - """ - type: StrictStr = Field(...) - value: conint(strict=True, ge=0) = Field(...) - __properties = ["type", "value"] + """ # noqa: E501 + type: StrictStr + value: Annotated[int, Field(strict=True, ge=0)] + __properties: ClassVar[List[str]] = ["type", "value"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('static', 'derived'): - raise ValueError("must be one of enum values ('static', 'derived')") + if value not in set(['static']): + raise ValueError("must be one of enum values ('static')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> StaticNumberParam: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StaticNumberParam 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) + 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: dict) -> StaticNumberParam: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StaticNumberParam from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StaticNumberParam.parse_obj(obj) + return cls.model_validate(obj) - _obj = StaticNumberParam.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type"), "value": obj.get("value") }) diff --git a/python/geoengine_openapi_client/models/stroke_param.py b/python/geoengine_openapi_client/models/stroke_param.py index 208624fd..d5e167a1 100644 --- a/python/geoengine_openapi_client/models/stroke_param.py +++ b/python/geoengine_openapi_client/models/stroke_param.py @@ -18,44 +18,60 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.color_param import ColorParam from geoengine_openapi_client.models.number_param import NumberParam +from typing import Optional, Set +from typing_extensions import Self class StrokeParam(BaseModel): """ StrokeParam - """ - color: ColorParam = Field(...) - width: NumberParam = Field(...) - __properties = ["color", "width"] + """ # noqa: E501 + color: ColorParam + width: NumberParam + __properties: ClassVar[List[str]] = ["color", "width"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> StrokeParam: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StrokeParam 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of color if self.color: _dict['color'] = self.color.to_dict() @@ -65,17 +81,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> StrokeParam: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StrokeParam from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StrokeParam.parse_obj(obj) + return cls.model_validate(obj) - _obj = StrokeParam.parse_obj({ - "color": ColorParam.from_dict(obj.get("color")) if obj.get("color") is not None else None, - "width": NumberParam.from_dict(obj.get("width")) if obj.get("width") is not None else None + _obj = cls.model_validate({ + "color": ColorParam.from_dict(obj["color"]) if obj.get("color") is not None else None, + "width": NumberParam.from_dict(obj["width"]) if obj.get("width") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/suggest_meta_data.py b/python/geoengine_openapi_client/models/suggest_meta_data.py index 330d7b3b..e5075b7c 100644 --- a/python/geoengine_openapi_client/models/suggest_meta_data.py +++ b/python/geoengine_openapi_client/models/suggest_meta_data.py @@ -18,72 +18,88 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.data_path import DataPath +from typing import Optional, Set +from typing_extensions import Self class SuggestMetaData(BaseModel): """ SuggestMetaData - """ - data_path: DataPath = Field(..., alias="dataPath") - layer_name: Optional[StrictStr] = Field(None, alias="layerName") - main_file: Optional[StrictStr] = Field(None, alias="mainFile") - __properties = ["dataPath", "layerName", "mainFile"] + """ # noqa: E501 + data_path: DataPath = Field(alias="dataPath") + layer_name: Optional[StrictStr] = Field(default=None, alias="layerName") + main_file: Optional[StrictStr] = Field(default=None, alias="mainFile") + __properties: ClassVar[List[str]] = ["dataPath", "layerName", "mainFile"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> SuggestMetaData: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SuggestMetaData 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of data_path if self.data_path: _dict['dataPath'] = self.data_path.to_dict() # set to None if layer_name (nullable) is None - # and __fields_set__ contains the field - if self.layer_name is None and "layer_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.layer_name is None and "layer_name" in self.model_fields_set: _dict['layerName'] = None # set to None if main_file (nullable) is None - # and __fields_set__ contains the field - if self.main_file is None and "main_file" in self.__fields_set__: + # and model_fields_set contains the field + if self.main_file is None and "main_file" in self.model_fields_set: _dict['mainFile'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> SuggestMetaData: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SuggestMetaData from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SuggestMetaData.parse_obj(obj) + return cls.model_validate(obj) - _obj = SuggestMetaData.parse_obj({ - "data_path": DataPath.from_dict(obj.get("dataPath")) if obj.get("dataPath") is not None else None, - "layer_name": obj.get("layerName"), - "main_file": obj.get("mainFile") + _obj = cls.model_validate({ + "dataPath": DataPath.from_dict(obj["dataPath"]) if obj.get("dataPath") is not None else None, + "layerName": obj.get("layerName"), + "mainFile": obj.get("mainFile") }) return _obj diff --git a/python/geoengine_openapi_client/models/symbology.py b/python/geoengine_openapi_client/models/symbology.py index 3aa9cda5..2099ae20 100644 --- a/python/geoengine_openapi_client/models/symbology.py +++ b/python/geoengine_openapi_client/models/symbology.py @@ -14,19 +14,17 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.line_symbology import LineSymbology from geoengine_openapi_client.models.point_symbology import PointSymbology from geoengine_openapi_client.models.polygon_symbology import PolygonSymbology from geoengine_openapi_client.models.raster_symbology import RasterSymbology -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self SYMBOLOGY_ONE_OF_SCHEMAS = ["LineSymbology", "PointSymbology", "PolygonSymbology", "RasterSymbology"] @@ -42,16 +40,16 @@ class Symbology(BaseModel): oneof_schema_3_validator: Optional[LineSymbology] = None # data type: PolygonSymbology oneof_schema_4_validator: Optional[PolygonSymbology] = None - if TYPE_CHECKING: - actual_instance: Union[LineSymbology, PointSymbology, PolygonSymbology, RasterSymbology] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(SYMBOLOGY_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[LineSymbology, PointSymbology, PolygonSymbology, RasterSymbology]] = None + one_of_schemas: Set[str] = { "LineSymbology", "PointSymbology", "PolygonSymbology", "RasterSymbology" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -64,9 +62,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = Symbology.construct() + instance = Symbology.model_construct() error_messages = [] match = 0 # validate data type: RasterSymbology @@ -99,13 +97,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> Symbology: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> Symbology: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = Symbology.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -115,42 +113,42 @@ def from_json(cls, json_str: str) -> Symbology: raise ValueError("Failed to lookup data type from the field `type` in the input.") # check if data type is `LineSymbology` - if _data_type == "LineSymbology": + if _data_type == "line": instance.actual_instance = LineSymbology.from_json(json_str) return instance # check if data type is `PointSymbology` - if _data_type == "PointSymbology": + if _data_type == "point": instance.actual_instance = PointSymbology.from_json(json_str) return instance # check if data type is `PolygonSymbology` - if _data_type == "PolygonSymbology": + if _data_type == "polygon": instance.actual_instance = PolygonSymbology.from_json(json_str) return instance # check if data type is `RasterSymbology` - if _data_type == "RasterSymbology": + if _data_type == "raster": instance.actual_instance = RasterSymbology.from_json(json_str) return instance # check if data type is `LineSymbology` - if _data_type == "line": + if _data_type == "LineSymbology": instance.actual_instance = LineSymbology.from_json(json_str) return instance # check if data type is `PointSymbology` - if _data_type == "point": + if _data_type == "PointSymbology": instance.actual_instance = PointSymbology.from_json(json_str) return instance # check if data type is `PolygonSymbology` - if _data_type == "polygon": + if _data_type == "PolygonSymbology": instance.actual_instance = PolygonSymbology.from_json(json_str) return instance # check if data type is `RasterSymbology` - if _data_type == "raster": + if _data_type == "RasterSymbology": instance.actual_instance = RasterSymbology.from_json(json_str) return instance @@ -193,19 +191,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], LineSymbology, PointSymbology, PolygonSymbology, RasterSymbology]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -213,6 +209,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/task_abort_options.py b/python/geoengine_openapi_client/models/task_abort_options.py index 63a37e04..894f2e32 100644 --- a/python/geoengine_openapi_client/models/task_abort_options.py +++ b/python/geoengine_openapi_client/models/task_abort_options.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictBool +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class TaskAbortOptions(BaseModel): """ TaskAbortOptions - """ + """ # noqa: E501 force: Optional[StrictBool] = None - __properties = ["force"] + __properties: ClassVar[List[str]] = ["force"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TaskAbortOptions: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TaskAbortOptions 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) + 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: dict) -> TaskAbortOptions: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TaskAbortOptions from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TaskAbortOptions.parse_obj(obj) + return cls.model_validate(obj) - _obj = TaskAbortOptions.parse_obj({ + _obj = cls.model_validate({ "force": obj.get("force") }) return _obj diff --git a/python/geoengine_openapi_client/models/task_filter.py b/python/geoengine_openapi_client/models/task_filter.py index 37793161..0f43c3a5 100644 --- a/python/geoengine_openapi_client/models/task_filter.py +++ b/python/geoengine_openapi_client/models/task_filter.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class TaskFilter(str, Enum): @@ -36,8 +33,8 @@ class TaskFilter(str, Enum): COMPLETED = 'completed' @classmethod - def from_json(cls, json_str: str) -> TaskFilter: + def from_json(cls, json_str: str) -> Self: """Create an instance of TaskFilter from a JSON string""" - return TaskFilter(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/task_list_options.py b/python/geoengine_openapi_client/models/task_list_options.py index d78b15be..050ba8c4 100644 --- a/python/geoengine_openapi_client/models/task_list_options.py +++ b/python/geoengine_openapi_client/models/task_list_options.py @@ -18,61 +18,78 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, conint +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.task_filter import TaskFilter +from typing import Optional, Set +from typing_extensions import Self class TaskListOptions(BaseModel): """ TaskListOptions - """ + """ # noqa: E501 filter: Optional[TaskFilter] = None - limit: Optional[conint(strict=True, ge=0)] = None - offset: Optional[conint(strict=True, ge=0)] = None - __properties = ["filter", "limit", "offset"] + limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None + __properties: ClassVar[List[str]] = ["filter", "limit", "offset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TaskListOptions: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TaskListOptions 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) + 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 filter (nullable) is None - # and __fields_set__ contains the field - if self.filter is None and "filter" in self.__fields_set__: + # and model_fields_set contains the field + if self.filter is None and "filter" in self.model_fields_set: _dict['filter'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> TaskListOptions: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TaskListOptions from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TaskListOptions.parse_obj(obj) + return cls.model_validate(obj) - _obj = TaskListOptions.parse_obj({ + _obj = cls.model_validate({ "filter": obj.get("filter"), "limit": obj.get("limit"), "offset": obj.get("offset") diff --git a/python/geoengine_openapi_client/models/task_response.py b/python/geoengine_openapi_client/models/task_response.py index ecae47a5..ed116e54 100644 --- a/python/geoengine_openapi_client/models/task_response.py +++ b/python/geoengine_openapi_client/models/task_response.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +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 TaskResponse(BaseModel): """ - Create a task somewhere and respond with a task id to query the task status. # noqa: E501 - """ - task_id: StrictStr = Field(..., alias="taskId") - __properties = ["taskId"] + Create a task somewhere and respond with a task id to query the task status. + """ # noqa: E501 + task_id: StrictStr = Field(alias="taskId") + __properties: ClassVar[List[str]] = ["taskId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TaskResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TaskResponse 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) + 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: dict) -> TaskResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TaskResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TaskResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = TaskResponse.parse_obj({ - "task_id": obj.get("taskId") + _obj = cls.model_validate({ + "taskId": obj.get("taskId") }) return _obj diff --git a/python/geoengine_openapi_client/models/task_status.py b/python/geoengine_openapi_client/models/task_status.py index 9103730f..3f6dddbc 100644 --- a/python/geoengine_openapi_client/models/task_status.py +++ b/python/geoengine_openapi_client/models/task_status.py @@ -14,19 +14,17 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.task_status_aborted import TaskStatusAborted from geoengine_openapi_client.models.task_status_completed import TaskStatusCompleted from geoengine_openapi_client.models.task_status_failed import TaskStatusFailed from geoengine_openapi_client.models.task_status_running import TaskStatusRunning -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self TASKSTATUS_ONE_OF_SCHEMAS = ["TaskStatusAborted", "TaskStatusCompleted", "TaskStatusFailed", "TaskStatusRunning"] @@ -42,16 +40,16 @@ class TaskStatus(BaseModel): oneof_schema_3_validator: Optional[TaskStatusAborted] = None # data type: TaskStatusFailed oneof_schema_4_validator: Optional[TaskStatusFailed] = None - if TYPE_CHECKING: - actual_instance: Union[TaskStatusAborted, TaskStatusCompleted, TaskStatusFailed, TaskStatusRunning] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(TASKSTATUS_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[TaskStatusAborted, TaskStatusCompleted, TaskStatusFailed, TaskStatusRunning]] = None + one_of_schemas: Set[str] = { "TaskStatusAborted", "TaskStatusCompleted", "TaskStatusFailed", "TaskStatusRunning" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { 'TaskStatusWithId': 'TaskStatusWithId' } @@ -65,9 +63,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = TaskStatus.construct() + instance = TaskStatus.model_construct() error_messages = [] match = 0 # validate data type: TaskStatusRunning @@ -100,13 +98,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> TaskStatus: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> TaskStatus: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = TaskStatus.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -116,50 +114,50 @@ def from_json(cls, json_str: str) -> TaskStatus: raise ValueError("Failed to lookup data type from the field `status` in the input.") # check if data type is `TaskStatusAborted` - if _data_type == "TaskStatusAborted": + if _data_type == "aborted": instance.actual_instance = TaskStatusAborted.from_json(json_str) return instance # check if data type is `TaskStatusCompleted` - if _data_type == "TaskStatusCompleted": + if _data_type == "completed": instance.actual_instance = TaskStatusCompleted.from_json(json_str) return instance # check if data type is `TaskStatusFailed` - if _data_type == "TaskStatusFailed": + if _data_type == "failed": instance.actual_instance = TaskStatusFailed.from_json(json_str) return instance # check if data type is `TaskStatusRunning` - if _data_type == "TaskStatusRunning": + if _data_type == "running": instance.actual_instance = TaskStatusRunning.from_json(json_str) return instance - # check if data type is `TaskStatusWithId` - if _data_type == "TaskStatusWithId": - instance.actual_instance = TaskStatusWithId.from_json(json_str) - return instance - # check if data type is `TaskStatusAborted` - if _data_type == "aborted": + if _data_type == "TaskStatusAborted": instance.actual_instance = TaskStatusAborted.from_json(json_str) return instance # check if data type is `TaskStatusCompleted` - if _data_type == "completed": + if _data_type == "TaskStatusCompleted": instance.actual_instance = TaskStatusCompleted.from_json(json_str) return instance # check if data type is `TaskStatusFailed` - if _data_type == "failed": + if _data_type == "TaskStatusFailed": instance.actual_instance = TaskStatusFailed.from_json(json_str) return instance # check if data type is `TaskStatusRunning` - if _data_type == "running": + if _data_type == "TaskStatusRunning": instance.actual_instance = TaskStatusRunning.from_json(json_str) return instance + # check if data type is `TaskStatusWithId` + if _data_type == "TaskStatusWithId": + instance.actual_instance = TaskStatusWithId.from_json(json_str) + return instance + # deserialize data into TaskStatusRunning try: instance.actual_instance = TaskStatusRunning.from_json(json_str) @@ -199,19 +197,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], TaskStatusAborted, TaskStatusCompleted, TaskStatusFailed, TaskStatusRunning]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -219,6 +215,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/task_status_aborted.py b/python/geoengine_openapi_client/models/task_status_aborted.py index 0e9d29ee..956c6ef2 100644 --- a/python/geoengine_openapi_client/models/task_status_aborted.py +++ b/python/geoengine_openapi_client/models/task_status_aborted.py @@ -18,67 +18,83 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class TaskStatusAborted(BaseModel): """ TaskStatusAborted - """ - clean_up: Optional[Any] = Field(..., alias="cleanUp") - status: StrictStr = Field(...) - __properties = ["cleanUp", "status"] + """ # noqa: E501 + clean_up: Optional[Any] = Field(alias="cleanUp") + status: StrictStr + __properties: ClassVar[List[str]] = ["cleanUp", "status"] - @validator('status') + @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in ('aborted'): + if value not in set(['aborted']): raise ValueError("must be one of enum values ('aborted')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> TaskStatusAborted: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TaskStatusAborted 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) + 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 clean_up (nullable) is None - # and __fields_set__ contains the field - if self.clean_up is None and "clean_up" in self.__fields_set__: + # and model_fields_set contains the field + if self.clean_up is None and "clean_up" in self.model_fields_set: _dict['cleanUp'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> TaskStatusAborted: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TaskStatusAborted from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TaskStatusAborted.parse_obj(obj) + return cls.model_validate(obj) - _obj = TaskStatusAborted.parse_obj({ - "clean_up": obj.get("cleanUp"), + _obj = cls.model_validate({ + "cleanUp": obj.get("cleanUp"), "status": obj.get("status") }) return _obj diff --git a/python/geoengine_openapi_client/models/task_status_completed.py b/python/geoengine_openapi_client/models/task_status_completed.py index a859dab7..3283b8cd 100644 --- a/python/geoengine_openapi_client/models/task_status_completed.py +++ b/python/geoengine_openapi_client/models/task_status_completed.py @@ -18,76 +18,92 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class TaskStatusCompleted(BaseModel): """ TaskStatusCompleted - """ + """ # noqa: E501 description: Optional[StrictStr] = None info: Optional[Any] = None - status: StrictStr = Field(...) - task_type: StrictStr = Field(..., alias="taskType") - time_started: StrictStr = Field(..., alias="timeStarted") - time_total: StrictStr = Field(..., alias="timeTotal") - __properties = ["description", "info", "status", "taskType", "timeStarted", "timeTotal"] + status: StrictStr + task_type: StrictStr = Field(alias="taskType") + time_started: StrictStr = Field(alias="timeStarted") + time_total: StrictStr = Field(alias="timeTotal") + __properties: ClassVar[List[str]] = ["description", "info", "status", "taskType", "timeStarted", "timeTotal"] - @validator('status') + @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in ('completed'): + if value not in set(['completed']): raise ValueError("must be one of enum values ('completed')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> TaskStatusCompleted: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TaskStatusCompleted 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) + 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 info (nullable) is None - # and __fields_set__ contains the field - if self.info is None and "info" in self.__fields_set__: + # and model_fields_set contains the field + if self.info is None and "info" in self.model_fields_set: _dict['info'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> TaskStatusCompleted: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TaskStatusCompleted from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TaskStatusCompleted.parse_obj(obj) + return cls.model_validate(obj) - _obj = TaskStatusCompleted.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), "info": obj.get("info"), "status": obj.get("status"), - "task_type": obj.get("taskType"), - "time_started": obj.get("timeStarted"), - "time_total": obj.get("timeTotal") + "taskType": obj.get("taskType"), + "timeStarted": obj.get("timeStarted"), + "timeTotal": obj.get("timeTotal") }) return _obj diff --git a/python/geoengine_openapi_client/models/task_status_failed.py b/python/geoengine_openapi_client/models/task_status_failed.py index 6c664cc7..13cc7470 100644 --- a/python/geoengine_openapi_client/models/task_status_failed.py +++ b/python/geoengine_openapi_client/models/task_status_failed.py @@ -18,73 +18,89 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class TaskStatusFailed(BaseModel): """ TaskStatusFailed - """ - clean_up: Optional[Any] = Field(..., alias="cleanUp") - error: Optional[Any] = Field(...) - status: StrictStr = Field(...) - __properties = ["cleanUp", "error", "status"] + """ # noqa: E501 + clean_up: Optional[Any] = Field(alias="cleanUp") + error: Optional[Any] + status: StrictStr + __properties: ClassVar[List[str]] = ["cleanUp", "error", "status"] - @validator('status') + @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in ('failed'): + if value not in set(['failed']): raise ValueError("must be one of enum values ('failed')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> TaskStatusFailed: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TaskStatusFailed 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) + 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 clean_up (nullable) is None - # and __fields_set__ contains the field - if self.clean_up is None and "clean_up" in self.__fields_set__: + # and model_fields_set contains the field + if self.clean_up is None and "clean_up" in self.model_fields_set: _dict['cleanUp'] = None # set to None if error (nullable) is None - # and __fields_set__ contains the field - if self.error is None and "error" in self.__fields_set__: + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: _dict['error'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> TaskStatusFailed: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TaskStatusFailed from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TaskStatusFailed.parse_obj(obj) + return cls.model_validate(obj) - _obj = TaskStatusFailed.parse_obj({ - "clean_up": obj.get("cleanUp"), + _obj = cls.model_validate({ + "cleanUp": obj.get("cleanUp"), "error": obj.get("error"), "status": obj.get("status") }) diff --git a/python/geoengine_openapi_client/models/task_status_running.py b/python/geoengine_openapi_client/models/task_status_running.py index c3474069..98cdf6c0 100644 --- a/python/geoengine_openapi_client/models/task_status_running.py +++ b/python/geoengine_openapi_client/models/task_status_running.py @@ -18,78 +18,94 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class TaskStatusRunning(BaseModel): """ TaskStatusRunning - """ + """ # noqa: E501 description: Optional[StrictStr] = None - estimated_time_remaining: StrictStr = Field(..., alias="estimatedTimeRemaining") + estimated_time_remaining: StrictStr = Field(alias="estimatedTimeRemaining") info: Optional[Any] = None - pct_complete: StrictStr = Field(..., alias="pctComplete") - status: StrictStr = Field(...) - task_type: StrictStr = Field(..., alias="taskType") - time_started: StrictStr = Field(..., alias="timeStarted") - __properties = ["description", "estimatedTimeRemaining", "info", "pctComplete", "status", "taskType", "timeStarted"] + pct_complete: StrictStr = Field(alias="pctComplete") + status: StrictStr + task_type: StrictStr = Field(alias="taskType") + time_started: StrictStr = Field(alias="timeStarted") + __properties: ClassVar[List[str]] = ["description", "estimatedTimeRemaining", "info", "pctComplete", "status", "taskType", "timeStarted"] - @validator('status') + @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in ('running'): + if value not in set(['running']): raise ValueError("must be one of enum values ('running')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> TaskStatusRunning: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TaskStatusRunning 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) + 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 info (nullable) is None - # and __fields_set__ contains the field - if self.info is None and "info" in self.__fields_set__: + # and model_fields_set contains the field + if self.info is None and "info" in self.model_fields_set: _dict['info'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> TaskStatusRunning: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TaskStatusRunning from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TaskStatusRunning.parse_obj(obj) + return cls.model_validate(obj) - _obj = TaskStatusRunning.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), - "estimated_time_remaining": obj.get("estimatedTimeRemaining"), + "estimatedTimeRemaining": obj.get("estimatedTimeRemaining"), "info": obj.get("info"), - "pct_complete": obj.get("pctComplete"), + "pctComplete": obj.get("pctComplete"), "status": obj.get("status"), - "task_type": obj.get("taskType"), - "time_started": obj.get("timeStarted") + "taskType": obj.get("taskType"), + "timeStarted": obj.get("timeStarted") }) return _obj diff --git a/python/geoengine_openapi_client/models/task_status_with_id.py b/python/geoengine_openapi_client/models/task_status_with_id.py index 2ec27f20..edf00e63 100644 --- a/python/geoengine_openapi_client/models/task_status_with_id.py +++ b/python/geoengine_openapi_client/models/task_status_with_id.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - -from pydantic import Field, StrictStr +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.task_status import TaskStatus +from typing import Optional, Set +from typing_extensions import Self class TaskStatusWithId(TaskStatus): """ TaskStatusWithId - """ - task_id: StrictStr = Field(..., alias="taskId") - __properties = ["description", "estimatedTimeRemaining", "info", "pctComplete", "status", "taskType", "timeStarted", "timeTotal", "cleanUp", "error", "taskId"] + """ # noqa: E501 + task_id: StrictStr = Field(alias="taskId") + __properties: ClassVar[List[str]] = ["description", "estimatedTimeRemaining", "info", "pctComplete", "status", "taskType", "timeStarted", "timeTotal", "cleanUp", "error", "taskId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TaskStatusWithId: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TaskStatusWithId 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) + 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 info (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field # Note: fixed handling of actual_instance if getattr(self.actual_instance, "info", None) is None and "info" in self.actual_instance.__fields_set__: _dict['info'] = None # set to None if clean_up (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field # Note: fixed handling of actual_instance if getattr(self.actual_instance, "clean_up", None) is None and "clean_up" in self.actual_instance.__fields_set__: _dict['cleanUp'] = None # set to None if error (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field # Note: fixed handling of actual_instance if getattr(self.actual_instance, "error", None) is None and "error" in self.actual_instance.__fields_set__: _dict['error'] = None @@ -75,33 +91,33 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> TaskStatusWithId: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TaskStatusWithId from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TaskStatusWithId.parse_obj(obj) + return cls.model_validate(obj) # Note: fixed handling of actual_instance - _obj = TaskStatusWithId.parse_obj({ + _obj = cls.model_validate({ "actual_instance": TaskStatus.from_dict(obj).actual_instance, "task_id": obj.get("taskId") }) return _obj - _obj = TaskStatusWithId.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), - "estimated_time_remaining": obj.get("estimatedTimeRemaining"), + "estimatedTimeRemaining": obj.get("estimatedTimeRemaining"), "info": obj.get("info"), - "pct_complete": obj.get("pctComplete"), + "pctComplete": obj.get("pctComplete"), "status": obj.get("status"), - "task_type": obj.get("taskType"), - "time_started": obj.get("timeStarted"), - "time_total": obj.get("timeTotal"), - "clean_up": obj.get("cleanUp"), + "taskType": obj.get("taskType"), + "timeStarted": obj.get("timeStarted"), + "timeTotal": obj.get("timeTotal"), + "cleanUp": obj.get("cleanUp"), "error": obj.get("error"), - "task_id": obj.get("taskId") + "taskId": obj.get("taskId") }) return _obj diff --git a/python/geoengine_openapi_client/models/text_symbology.py b/python/geoengine_openapi_client/models/text_symbology.py index 3d452148..191f54d6 100644 --- a/python/geoengine_openapi_client/models/text_symbology.py +++ b/python/geoengine_openapi_client/models/text_symbology.py @@ -18,45 +18,61 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.color_param import ColorParam from geoengine_openapi_client.models.stroke_param import StrokeParam +from typing import Optional, Set +from typing_extensions import Self class TextSymbology(BaseModel): """ TextSymbology - """ - attribute: StrictStr = Field(...) - fill_color: ColorParam = Field(..., alias="fillColor") - stroke: StrokeParam = Field(...) - __properties = ["attribute", "fillColor", "stroke"] + """ # noqa: E501 + attribute: StrictStr + fill_color: ColorParam = Field(alias="fillColor") + stroke: StrokeParam + __properties: ClassVar[List[str]] = ["attribute", "fillColor", "stroke"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TextSymbology: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TextSymbology 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of fill_color if self.fill_color: _dict['fillColor'] = self.fill_color.to_dict() @@ -66,18 +82,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> TextSymbology: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TextSymbology from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TextSymbology.parse_obj(obj) + return cls.model_validate(obj) - _obj = TextSymbology.parse_obj({ + _obj = cls.model_validate({ "attribute": obj.get("attribute"), - "fill_color": ColorParam.from_dict(obj.get("fillColor")) if obj.get("fillColor") is not None else None, - "stroke": StrokeParam.from_dict(obj.get("stroke")) if obj.get("stroke") is not None else None + "fillColor": ColorParam.from_dict(obj["fillColor"]) if obj.get("fillColor") is not None else None, + "stroke": StrokeParam.from_dict(obj["stroke"]) if obj.get("stroke") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/time_granularity.py b/python/geoengine_openapi_client/models/time_granularity.py index e879ed26..28b357fe 100644 --- a/python/geoengine_openapi_client/models/time_granularity.py +++ b/python/geoengine_openapi_client/models/time_granularity.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class TimeGranularity(str, Enum): @@ -39,8 +36,8 @@ class TimeGranularity(str, Enum): YEARS = 'years' @classmethod - def from_json(cls, json_str: str) -> TimeGranularity: + def from_json(cls, json_str: str) -> Self: """Create an instance of TimeGranularity from a JSON string""" - return TimeGranularity(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/time_interval.py b/python/geoengine_openapi_client/models/time_interval.py index ac17f48a..aae8409a 100644 --- a/python/geoengine_openapi_client/models/time_interval.py +++ b/python/geoengine_openapi_client/models/time_interval.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictInt +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class TimeInterval(BaseModel): """ - Stores time intervals in ms in close-open semantic [start, end) # noqa: E501 - """ - end: StrictInt = Field(...) - start: StrictInt = Field(...) - __properties = ["end", "start"] + Stores time intervals in ms in close-open semantic [start, end) + """ # noqa: E501 + end: StrictInt + start: StrictInt + __properties: ClassVar[List[str]] = ["end", "start"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TimeInterval: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TimeInterval 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) + 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: dict) -> TimeInterval: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TimeInterval from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TimeInterval.parse_obj(obj) + return cls.model_validate(obj) - _obj = TimeInterval.parse_obj({ + _obj = cls.model_validate({ "end": obj.get("end"), "start": obj.get("start") }) diff --git a/python/geoengine_openapi_client/models/time_reference.py b/python/geoengine_openapi_client/models/time_reference.py index 3c2c1fb0..4bcc47ca 100644 --- a/python/geoengine_openapi_client/models/time_reference.py +++ b/python/geoengine_openapi_client/models/time_reference.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class TimeReference(str, Enum): @@ -34,8 +31,8 @@ class TimeReference(str, Enum): END = 'end' @classmethod - def from_json(cls, json_str: str) -> TimeReference: + def from_json(cls, json_str: str) -> Self: """Create an instance of TimeReference from a JSON string""" - return TimeReference(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/time_step.py b/python/geoengine_openapi_client/models/time_step.py index 1e7dc352..6de7a1c4 100644 --- a/python/geoengine_openapi_client/models/time_step.py +++ b/python/geoengine_openapi_client/models/time_step.py @@ -18,55 +18,72 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, conint +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from geoengine_openapi_client.models.time_granularity import TimeGranularity +from typing import Optional, Set +from typing_extensions import Self class TimeStep(BaseModel): """ TimeStep - """ - granularity: TimeGranularity = Field(...) - step: conint(strict=True, ge=0) = Field(...) - __properties = ["granularity", "step"] + """ # noqa: E501 + granularity: TimeGranularity + step: Annotated[int, Field(strict=True, ge=0)] + __properties: ClassVar[List[str]] = ["granularity", "step"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TimeStep: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TimeStep 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) + 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: dict) -> TimeStep: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TimeStep from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TimeStep.parse_obj(obj) + return cls.model_validate(obj) - _obj = TimeStep.parse_obj({ + _obj = cls.model_validate({ "granularity": obj.get("granularity"), "step": obj.get("step") }) diff --git a/python/geoengine_openapi_client/models/typed_geometry.py b/python/geoengine_openapi_client/models/typed_geometry.py index 6028b1f5..05c64aae 100644 --- a/python/geoengine_openapi_client/models/typed_geometry.py +++ b/python/geoengine_openapi_client/models/typed_geometry.py @@ -14,19 +14,17 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.typed_geometry_one_of import TypedGeometryOneOf from geoengine_openapi_client.models.typed_geometry_one_of1 import TypedGeometryOneOf1 from geoengine_openapi_client.models.typed_geometry_one_of2 import TypedGeometryOneOf2 from geoengine_openapi_client.models.typed_geometry_one_of3 import TypedGeometryOneOf3 -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self TYPEDGEOMETRY_ONE_OF_SCHEMAS = ["TypedGeometryOneOf", "TypedGeometryOneOf1", "TypedGeometryOneOf2", "TypedGeometryOneOf3"] @@ -42,14 +40,14 @@ class TypedGeometry(BaseModel): oneof_schema_3_validator: Optional[TypedGeometryOneOf2] = None # data type: TypedGeometryOneOf3 oneof_schema_4_validator: Optional[TypedGeometryOneOf3] = None - if TYPE_CHECKING: - actual_instance: Union[TypedGeometryOneOf, TypedGeometryOneOf1, TypedGeometryOneOf2, TypedGeometryOneOf3] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(TYPEDGEOMETRY_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[TypedGeometryOneOf, TypedGeometryOneOf1, TypedGeometryOneOf2, TypedGeometryOneOf3]] = None + one_of_schemas: Set[str] = { "TypedGeometryOneOf", "TypedGeometryOneOf1", "TypedGeometryOneOf2", "TypedGeometryOneOf3" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True def __init__(self, *args, **kwargs) -> None: if args: @@ -61,9 +59,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = TypedGeometry.construct() + instance = TypedGeometry.model_construct() error_messages = [] match = 0 # validate data type: TypedGeometryOneOf @@ -96,13 +94,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> TypedGeometry: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> TypedGeometry: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = TypedGeometry.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -145,19 +143,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], TypedGeometryOneOf, TypedGeometryOneOf1, TypedGeometryOneOf2, TypedGeometryOneOf3]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -165,6 +161,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/typed_geometry_one_of.py b/python/geoengine_openapi_client/models/typed_geometry_one_of.py index e89d66d1..d1108fc6 100644 --- a/python/geoengine_openapi_client/models/typed_geometry_one_of.py +++ b/python/geoengine_openapi_client/models/typed_geometry_one_of.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class TypedGeometryOneOf(BaseModel): """ TypedGeometryOneOf - """ - data: Optional[Any] = Field(..., alias="Data") - __properties = ["Data"] + """ # noqa: E501 + data: Optional[Any] = Field(alias="Data") + __properties: ClassVar[List[str]] = ["Data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TypedGeometryOneOf: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TypedGeometryOneOf 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) + 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 data (nullable) is None - # and __fields_set__ contains the field - if self.data is None and "data" in self.__fields_set__: + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: _dict['Data'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> TypedGeometryOneOf: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TypedGeometryOneOf from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TypedGeometryOneOf.parse_obj(obj) + return cls.model_validate(obj) - _obj = TypedGeometryOneOf.parse_obj({ - "data": obj.get("Data") + _obj = cls.model_validate({ + "Data": obj.get("Data") }) return _obj diff --git a/python/geoengine_openapi_client/models/typed_geometry_one_of1.py b/python/geoengine_openapi_client/models/typed_geometry_one_of1.py index 0d41098b..3dbe55ae 100644 --- a/python/geoengine_openapi_client/models/typed_geometry_one_of1.py +++ b/python/geoengine_openapi_client/models/typed_geometry_one_of1.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.multi_point import MultiPoint +from typing import Optional, Set +from typing_extensions import Self class TypedGeometryOneOf1(BaseModel): """ TypedGeometryOneOf1 - """ - multi_point: MultiPoint = Field(..., alias="MultiPoint") - __properties = ["MultiPoint"] + """ # noqa: E501 + multi_point: MultiPoint = Field(alias="MultiPoint") + __properties: ClassVar[List[str]] = ["MultiPoint"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TypedGeometryOneOf1: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TypedGeometryOneOf1 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of multi_point if self.multi_point: _dict['MultiPoint'] = self.multi_point.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> TypedGeometryOneOf1: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TypedGeometryOneOf1 from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TypedGeometryOneOf1.parse_obj(obj) + return cls.model_validate(obj) - _obj = TypedGeometryOneOf1.parse_obj({ - "multi_point": MultiPoint.from_dict(obj.get("MultiPoint")) if obj.get("MultiPoint") is not None else None + _obj = cls.model_validate({ + "MultiPoint": MultiPoint.from_dict(obj["MultiPoint"]) if obj.get("MultiPoint") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/typed_geometry_one_of2.py b/python/geoengine_openapi_client/models/typed_geometry_one_of2.py index 3abd3c4f..ef865f71 100644 --- a/python/geoengine_openapi_client/models/typed_geometry_one_of2.py +++ b/python/geoengine_openapi_client/models/typed_geometry_one_of2.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.multi_line_string import MultiLineString +from typing import Optional, Set +from typing_extensions import Self class TypedGeometryOneOf2(BaseModel): """ TypedGeometryOneOf2 - """ - multi_line_string: MultiLineString = Field(..., alias="MultiLineString") - __properties = ["MultiLineString"] + """ # noqa: E501 + multi_line_string: MultiLineString = Field(alias="MultiLineString") + __properties: ClassVar[List[str]] = ["MultiLineString"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TypedGeometryOneOf2: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TypedGeometryOneOf2 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of multi_line_string if self.multi_line_string: _dict['MultiLineString'] = self.multi_line_string.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> TypedGeometryOneOf2: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TypedGeometryOneOf2 from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TypedGeometryOneOf2.parse_obj(obj) + return cls.model_validate(obj) - _obj = TypedGeometryOneOf2.parse_obj({ - "multi_line_string": MultiLineString.from_dict(obj.get("MultiLineString")) if obj.get("MultiLineString") is not None else None + _obj = cls.model_validate({ + "MultiLineString": MultiLineString.from_dict(obj["MultiLineString"]) if obj.get("MultiLineString") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/typed_geometry_one_of3.py b/python/geoengine_openapi_client/models/typed_geometry_one_of3.py index abd97bf2..7a48fcc0 100644 --- a/python/geoengine_openapi_client/models/typed_geometry_one_of3.py +++ b/python/geoengine_openapi_client/models/typed_geometry_one_of3.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.multi_polygon import MultiPolygon +from typing import Optional, Set +from typing_extensions import Self class TypedGeometryOneOf3(BaseModel): """ TypedGeometryOneOf3 - """ - multi_polygon: MultiPolygon = Field(..., alias="MultiPolygon") - __properties = ["MultiPolygon"] + """ # noqa: E501 + multi_polygon: MultiPolygon = Field(alias="MultiPolygon") + __properties: ClassVar[List[str]] = ["MultiPolygon"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TypedGeometryOneOf3: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TypedGeometryOneOf3 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of multi_polygon if self.multi_polygon: _dict['MultiPolygon'] = self.multi_polygon.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> TypedGeometryOneOf3: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TypedGeometryOneOf3 from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TypedGeometryOneOf3.parse_obj(obj) + return cls.model_validate(obj) - _obj = TypedGeometryOneOf3.parse_obj({ - "multi_polygon": MultiPolygon.from_dict(obj.get("MultiPolygon")) if obj.get("MultiPolygon") is not None else None + _obj = cls.model_validate({ + "MultiPolygon": MultiPolygon.from_dict(obj["MultiPolygon"]) if obj.get("MultiPolygon") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/typed_operator.py b/python/geoengine_openapi_client/models/typed_operator.py index a32032b2..a0c4a0cc 100644 --- a/python/geoengine_openapi_client/models/typed_operator.py +++ b/python/geoengine_openapi_client/models/typed_operator.py @@ -18,66 +18,82 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.typed_operator_operator import TypedOperatorOperator +from typing import Optional, Set +from typing_extensions import Self class TypedOperator(BaseModel): """ - An enum to differentiate between `Operator` variants # noqa: E501 - """ - operator: TypedOperatorOperator = Field(...) - type: StrictStr = Field(...) - __properties = ["operator", "type"] + An enum to differentiate between `Operator` variants + """ # noqa: E501 + operator: TypedOperatorOperator + type: StrictStr + __properties: ClassVar[List[str]] = ["operator", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('Vector', 'Raster', 'Plot'): + if value not in set(['Vector', 'Raster', 'Plot']): raise ValueError("must be one of enum values ('Vector', 'Raster', 'Plot')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> TypedOperator: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TypedOperator 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of operator if self.operator: _dict['operator'] = self.operator.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> TypedOperator: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TypedOperator from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TypedOperator.parse_obj(obj) + return cls.model_validate(obj) - _obj = TypedOperator.parse_obj({ - "operator": TypedOperatorOperator.from_dict(obj.get("operator")) if obj.get("operator") is not None else None, + _obj = cls.model_validate({ + "operator": TypedOperatorOperator.from_dict(obj["operator"]) if obj.get("operator") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/typed_operator_operator.py b/python/geoengine_openapi_client/models/typed_operator_operator.py index 561df952..453c5bc2 100644 --- a/python/geoengine_openapi_client/models/typed_operator_operator.py +++ b/python/geoengine_openapi_client/models/typed_operator_operator.py @@ -18,55 +18,71 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class TypedOperatorOperator(BaseModel): """ TypedOperatorOperator - """ + """ # noqa: E501 params: Optional[Dict[str, Any]] = None sources: Optional[Dict[str, Any]] = None - type: StrictStr = Field(...) - __properties = ["params", "sources", "type"] + type: StrictStr + __properties: ClassVar[List[str]] = ["params", "sources", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> TypedOperatorOperator: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TypedOperatorOperator 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) + 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: dict) -> TypedOperatorOperator: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TypedOperatorOperator from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TypedOperatorOperator.parse_obj(obj) + return cls.model_validate(obj) - _obj = TypedOperatorOperator.parse_obj({ + _obj = cls.model_validate({ "params": obj.get("params"), "sources": obj.get("sources"), "type": obj.get("type") diff --git a/python/geoengine_openapi_client/models/typed_plot_result_descriptor.py b/python/geoengine_openapi_client/models/typed_plot_result_descriptor.py index e211bf04..96759361 100644 --- a/python/geoengine_openapi_client/models/typed_plot_result_descriptor.py +++ b/python/geoengine_openapi_client/models/typed_plot_result_descriptor.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.bounding_box2_d import BoundingBox2D from geoengine_openapi_client.models.time_interval import TimeInterval +from typing import Optional, Set +from typing_extensions import Self class TypedPlotResultDescriptor(BaseModel): """ - A `ResultDescriptor` for plot queries # noqa: E501 - """ + A `ResultDescriptor` for plot queries + """ # noqa: E501 bbox: Optional[BoundingBox2D] = None - spatial_reference: StrictStr = Field(..., alias="spatialReference") + spatial_reference: StrictStr = Field(alias="spatialReference") time: Optional[TimeInterval] = None - type: StrictStr = Field(...) - __properties = ["bbox", "spatialReference", "time", "type"] + type: StrictStr + __properties: ClassVar[List[str]] = ["bbox", "spatialReference", "time", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('plot', 'raster', 'vector'): - raise ValueError("must be one of enum values ('plot', 'raster', 'vector')") + if value not in set(['plot']): + raise ValueError("must be one of enum values ('plot')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> TypedPlotResultDescriptor: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TypedPlotResultDescriptor 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of bbox if self.bbox: _dict['bbox'] = self.bbox.to_dict() @@ -72,30 +88,30 @@ def to_dict(self): if self.time: _dict['time'] = self.time.to_dict() # set to None if bbox (nullable) is None - # and __fields_set__ contains the field - if self.bbox is None and "bbox" in self.__fields_set__: + # and model_fields_set contains the field + if self.bbox is None and "bbox" in self.model_fields_set: _dict['bbox'] = None # set to None if time (nullable) is None - # and __fields_set__ contains the field - if self.time is None and "time" in self.__fields_set__: + # and model_fields_set contains the field + if self.time is None and "time" in self.model_fields_set: _dict['time'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> TypedPlotResultDescriptor: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TypedPlotResultDescriptor from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TypedPlotResultDescriptor.parse_obj(obj) + return cls.model_validate(obj) - _obj = TypedPlotResultDescriptor.parse_obj({ - "bbox": BoundingBox2D.from_dict(obj.get("bbox")) if obj.get("bbox") is not None else None, - "spatial_reference": obj.get("spatialReference"), - "time": TimeInterval.from_dict(obj.get("time")) if obj.get("time") is not None else None, + _obj = cls.model_validate({ + "bbox": BoundingBox2D.from_dict(obj["bbox"]) if obj.get("bbox") is not None else None, + "spatialReference": obj.get("spatialReference"), + "time": TimeInterval.from_dict(obj["time"]) if obj.get("time") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/typed_raster_result_descriptor.py b/python/geoengine_openapi_client/models/typed_raster_result_descriptor.py index f926ba10..bd6fe2b1 100644 --- a/python/geoengine_openapi_client/models/typed_raster_result_descriptor.py +++ b/python/geoengine_openapi_client/models/typed_raster_result_descriptor.py @@ -18,65 +18,81 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.raster_band_descriptor import RasterBandDescriptor from geoengine_openapi_client.models.raster_data_type import RasterDataType from geoengine_openapi_client.models.spatial_partition2_d import SpatialPartition2D from geoengine_openapi_client.models.spatial_resolution import SpatialResolution from geoengine_openapi_client.models.time_interval import TimeInterval +from typing import Optional, Set +from typing_extensions import Self class TypedRasterResultDescriptor(BaseModel): """ - A `ResultDescriptor` for raster queries # noqa: E501 - """ - bands: conlist(RasterBandDescriptor) = Field(...) + A `ResultDescriptor` for raster queries + """ # noqa: E501 + bands: List[RasterBandDescriptor] bbox: Optional[SpatialPartition2D] = None - data_type: RasterDataType = Field(..., alias="dataType") + data_type: RasterDataType = Field(alias="dataType") resolution: Optional[SpatialResolution] = None - spatial_reference: StrictStr = Field(..., alias="spatialReference") + spatial_reference: StrictStr = Field(alias="spatialReference") time: Optional[TimeInterval] = None - type: StrictStr = Field(...) - __properties = ["bands", "bbox", "dataType", "resolution", "spatialReference", "time", "type"] + type: StrictStr + __properties: ClassVar[List[str]] = ["bands", "bbox", "dataType", "resolution", "spatialReference", "time", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('raster'): + if value not in set(['raster']): raise ValueError("must be one of enum values ('raster')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> TypedRasterResultDescriptor: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TypedRasterResultDescriptor 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of each item in bands (list) _items = [] if self.bands: - for _item in self.bands: - if _item: - _items.append(_item.to_dict()) + for _item_bands in self.bands: + if _item_bands: + _items.append(_item_bands.to_dict()) _dict['bands'] = _items # override the default output from pydantic by calling `to_dict()` of bbox if self.bbox: @@ -88,38 +104,38 @@ def to_dict(self): if self.time: _dict['time'] = self.time.to_dict() # set to None if bbox (nullable) is None - # and __fields_set__ contains the field - if self.bbox is None and "bbox" in self.__fields_set__: + # and model_fields_set contains the field + if self.bbox is None and "bbox" in self.model_fields_set: _dict['bbox'] = None # set to None if resolution (nullable) is None - # and __fields_set__ contains the field - if self.resolution is None and "resolution" in self.__fields_set__: + # and model_fields_set contains the field + if self.resolution is None and "resolution" in self.model_fields_set: _dict['resolution'] = None # set to None if time (nullable) is None - # and __fields_set__ contains the field - if self.time is None and "time" in self.__fields_set__: + # and model_fields_set contains the field + if self.time is None and "time" in self.model_fields_set: _dict['time'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> TypedRasterResultDescriptor: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TypedRasterResultDescriptor from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TypedRasterResultDescriptor.parse_obj(obj) - - _obj = TypedRasterResultDescriptor.parse_obj({ - "bands": [RasterBandDescriptor.from_dict(_item) for _item in obj.get("bands")] if obj.get("bands") is not None else None, - "bbox": SpatialPartition2D.from_dict(obj.get("bbox")) if obj.get("bbox") is not None else None, - "data_type": obj.get("dataType"), - "resolution": SpatialResolution.from_dict(obj.get("resolution")) if obj.get("resolution") is not None else None, - "spatial_reference": obj.get("spatialReference"), - "time": TimeInterval.from_dict(obj.get("time")) if obj.get("time") is not None else None, + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bands": [RasterBandDescriptor.from_dict(_item) for _item in obj["bands"]] if obj.get("bands") is not None else None, + "bbox": SpatialPartition2D.from_dict(obj["bbox"]) if obj.get("bbox") is not None else None, + "dataType": obj.get("dataType"), + "resolution": SpatialResolution.from_dict(obj["resolution"]) if obj.get("resolution") is not None else None, + "spatialReference": obj.get("spatialReference"), + "time": TimeInterval.from_dict(obj["time"]) if obj.get("time") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/typed_result_descriptor.py b/python/geoengine_openapi_client/models/typed_result_descriptor.py index 5bb4794c..f06c5e53 100644 --- a/python/geoengine_openapi_client/models/typed_result_descriptor.py +++ b/python/geoengine_openapi_client/models/typed_result_descriptor.py @@ -14,18 +14,16 @@ from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from geoengine_openapi_client.models.typed_plot_result_descriptor import TypedPlotResultDescriptor from geoengine_openapi_client.models.typed_raster_result_descriptor import TypedRasterResultDescriptor from geoengine_openapi_client.models.typed_vector_result_descriptor import TypedVectorResultDescriptor -from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self TYPEDRESULTDESCRIPTOR_ONE_OF_SCHEMAS = ["TypedPlotResultDescriptor", "TypedRasterResultDescriptor", "TypedVectorResultDescriptor"] @@ -39,16 +37,16 @@ class TypedResultDescriptor(BaseModel): oneof_schema_2_validator: Optional[TypedRasterResultDescriptor] = None # data type: TypedVectorResultDescriptor oneof_schema_3_validator: Optional[TypedVectorResultDescriptor] = None - if TYPE_CHECKING: - actual_instance: Union[TypedPlotResultDescriptor, TypedRasterResultDescriptor, TypedVectorResultDescriptor] - else: - actual_instance: Any - one_of_schemas: List[str] = Field(TYPEDRESULTDESCRIPTOR_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[TypedPlotResultDescriptor, TypedRasterResultDescriptor, TypedVectorResultDescriptor]] = None + one_of_schemas: Set[str] = { "TypedPlotResultDescriptor", "TypedRasterResultDescriptor", "TypedVectorResultDescriptor" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - validate_assignment = True - discriminator_value_class_map = { + discriminator_value_class_map: Dict[str, str] = { } def __init__(self, *args, **kwargs) -> None: @@ -61,9 +59,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = TypedResultDescriptor.construct() + instance = TypedResultDescriptor.model_construct() error_messages = [] match = 0 # validate data type: TypedPlotResultDescriptor @@ -91,13 +89,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> TypedResultDescriptor: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> TypedResultDescriptor: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = TypedResultDescriptor.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -107,32 +105,32 @@ def from_json(cls, json_str: str) -> TypedResultDescriptor: raise ValueError("Failed to lookup data type from the field `type` in the input.") # check if data type is `TypedPlotResultDescriptor` - if _data_type == "TypedPlotResultDescriptor": + if _data_type == "plot": instance.actual_instance = TypedPlotResultDescriptor.from_json(json_str) return instance # check if data type is `TypedRasterResultDescriptor` - if _data_type == "TypedRasterResultDescriptor": + if _data_type == "raster": instance.actual_instance = TypedRasterResultDescriptor.from_json(json_str) return instance # check if data type is `TypedVectorResultDescriptor` - if _data_type == "TypedVectorResultDescriptor": + if _data_type == "vector": instance.actual_instance = TypedVectorResultDescriptor.from_json(json_str) return instance # check if data type is `TypedPlotResultDescriptor` - if _data_type == "plot": + if _data_type == "TypedPlotResultDescriptor": instance.actual_instance = TypedPlotResultDescriptor.from_json(json_str) return instance # check if data type is `TypedRasterResultDescriptor` - if _data_type == "raster": + if _data_type == "TypedRasterResultDescriptor": instance.actual_instance = TypedRasterResultDescriptor.from_json(json_str) return instance # check if data type is `TypedVectorResultDescriptor` - if _data_type == "vector": + if _data_type == "TypedVectorResultDescriptor": instance.actual_instance = TypedVectorResultDescriptor.from_json(json_str) return instance @@ -169,19 +167,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], TypedPlotResultDescriptor, TypedRasterResultDescriptor, TypedVectorResultDescriptor]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -189,6 +185,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) diff --git a/python/geoengine_openapi_client/models/typed_vector_result_descriptor.py b/python/geoengine_openapi_client/models/typed_vector_result_descriptor.py index 5e151881..90281332 100644 --- a/python/geoengine_openapi_client/models/typed_vector_result_descriptor.py +++ b/python/geoengine_openapi_client/models/typed_vector_result_descriptor.py @@ -18,102 +18,118 @@ import re # noqa: F401 import json - -from typing import Dict, Optional -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.bounding_box2_d import BoundingBox2D from geoengine_openapi_client.models.time_interval import TimeInterval from geoengine_openapi_client.models.vector_column_info import VectorColumnInfo from geoengine_openapi_client.models.vector_data_type import VectorDataType +from typing import Optional, Set +from typing_extensions import Self class TypedVectorResultDescriptor(BaseModel): """ TypedVectorResultDescriptor - """ + """ # noqa: E501 bbox: Optional[BoundingBox2D] = None - columns: Dict[str, VectorColumnInfo] = Field(...) - data_type: VectorDataType = Field(..., alias="dataType") - spatial_reference: StrictStr = Field(..., alias="spatialReference") + columns: Dict[str, VectorColumnInfo] + data_type: VectorDataType = Field(alias="dataType") + spatial_reference: StrictStr = Field(alias="spatialReference") time: Optional[TimeInterval] = None - type: StrictStr = Field(...) - __properties = ["bbox", "columns", "dataType", "spatialReference", "time", "type"] + type: StrictStr + __properties: ClassVar[List[str]] = ["bbox", "columns", "dataType", "spatialReference", "time", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('vector'): + if value not in set(['vector']): raise ValueError("must be one of enum values ('vector')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> TypedVectorResultDescriptor: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TypedVectorResultDescriptor 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of bbox if self.bbox: _dict['bbox'] = self.bbox.to_dict() # override the default output from pydantic by calling `to_dict()` of each value in columns (dict) _field_dict = {} if self.columns: - for _key in self.columns: - if self.columns[_key]: - _field_dict[_key] = self.columns[_key].to_dict() + for _key_columns in self.columns: + if self.columns[_key_columns]: + _field_dict[_key_columns] = self.columns[_key_columns].to_dict() _dict['columns'] = _field_dict # override the default output from pydantic by calling `to_dict()` of time if self.time: _dict['time'] = self.time.to_dict() # set to None if bbox (nullable) is None - # and __fields_set__ contains the field - if self.bbox is None and "bbox" in self.__fields_set__: + # and model_fields_set contains the field + if self.bbox is None and "bbox" in self.model_fields_set: _dict['bbox'] = None # set to None if time (nullable) is None - # and __fields_set__ contains the field - if self.time is None and "time" in self.__fields_set__: + # and model_fields_set contains the field + if self.time is None and "time" in self.model_fields_set: _dict['time'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> TypedVectorResultDescriptor: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TypedVectorResultDescriptor from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TypedVectorResultDescriptor.parse_obj(obj) + return cls.model_validate(obj) - _obj = TypedVectorResultDescriptor.parse_obj({ - "bbox": BoundingBox2D.from_dict(obj.get("bbox")) if obj.get("bbox") is not None else None, + _obj = cls.model_validate({ + "bbox": BoundingBox2D.from_dict(obj["bbox"]) if obj.get("bbox") is not None else None, "columns": dict( (_k, VectorColumnInfo.from_dict(_v)) - for _k, _v in obj.get("columns").items() + for _k, _v in obj["columns"].items() ) if obj.get("columns") is not None else None, - "data_type": obj.get("dataType"), - "spatial_reference": obj.get("spatialReference"), - "time": TimeInterval.from_dict(obj.get("time")) if obj.get("time") is not None else None, + "dataType": obj.get("dataType"), + "spatialReference": obj.get("spatialReference"), + "time": TimeInterval.from_dict(obj["time"]) if obj.get("time") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/unitless_measurement.py b/python/geoengine_openapi_client/models/unitless_measurement.py index c0ba7121..4c27eafe 100644 --- a/python/geoengine_openapi_client/models/unitless_measurement.py +++ b/python/geoengine_openapi_client/models/unitless_measurement.py @@ -18,60 +18,76 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class UnitlessMeasurement(BaseModel): """ UnitlessMeasurement - """ - type: StrictStr = Field(...) - __properties = ["type"] + """ # noqa: E501 + type: StrictStr + __properties: ClassVar[List[str]] = ["type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('unitless', 'continuous', 'classification'): - raise ValueError("must be one of enum values ('unitless', 'continuous', 'classification')") + if value not in set(['unitless']): + raise ValueError("must be one of enum values ('unitless')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> UnitlessMeasurement: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UnitlessMeasurement 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) + 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: dict) -> UnitlessMeasurement: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UnitlessMeasurement from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UnitlessMeasurement.parse_obj(obj) + return cls.model_validate(obj) - _obj = UnitlessMeasurement.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/unix_time_stamp_type.py b/python/geoengine_openapi_client/models/unix_time_stamp_type.py index c381609e..1ad4b3a3 100644 --- a/python/geoengine_openapi_client/models/unix_time_stamp_type.py +++ b/python/geoengine_openapi_client/models/unix_time_stamp_type.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class UnixTimeStampType(str, Enum): @@ -34,8 +31,8 @@ class UnixTimeStampType(str, Enum): EPOCHMILLISECONDS = 'epochMilliseconds' @classmethod - def from_json(cls, json_str: str) -> UnixTimeStampType: + def from_json(cls, json_str: str) -> Self: """Create an instance of UnixTimeStampType from a JSON string""" - return UnixTimeStampType(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/update_dataset.py b/python/geoengine_openapi_client/models/update_dataset.py index 23d309d6..21ab8a28 100644 --- a/python/geoengine_openapi_client/models/update_dataset.py +++ b/python/geoengine_openapi_client/models/update_dataset.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class UpdateDataset(BaseModel): """ UpdateDataset - """ - description: StrictStr = Field(...) - display_name: StrictStr = Field(...) - name: StrictStr = Field(...) - tags: conlist(StrictStr) = Field(...) - __properties = ["description", "display_name", "name", "tags"] + """ # noqa: E501 + description: StrictStr + display_name: StrictStr + name: StrictStr + tags: List[StrictStr] + __properties: ClassVar[List[str]] = ["description", "display_name", "name", "tags"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> UpdateDataset: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UpdateDataset 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) + 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: dict) -> UpdateDataset: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UpdateDataset from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UpdateDataset.parse_obj(obj) + return cls.model_validate(obj) - _obj = UpdateDataset.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), "display_name": obj.get("display_name"), "name": obj.get("name"), diff --git a/python/geoengine_openapi_client/models/update_layer.py b/python/geoengine_openapi_client/models/update_layer.py index ee7faed5..e99cb46a 100644 --- a/python/geoengine_openapi_client/models/update_layer.py +++ b/python/geoengine_openapi_client/models/update_layer.py @@ -18,48 +18,65 @@ import re # noqa: F401 import json - -from typing import Dict, List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from geoengine_openapi_client.models.symbology import Symbology from geoengine_openapi_client.models.workflow import Workflow +from typing import Optional, Set +from typing_extensions import Self 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") + """ # noqa: E501 + description: StrictStr + metadata: Optional[Dict[str, StrictStr]] = Field(default=None, description="metadata used for loading the data") + name: StrictStr + properties: Optional[List[Annotated[List[StrictStr], Field(min_length=2, max_length=2)]]] = Field(default=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"] + workflow: Workflow + __properties: ClassVar[List[str]] = ["description", "metadata", "name", "properties", "symbology", "workflow"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> UpdateLayer: + def from_json(cls, json_str: str) -> Optional[Self]: """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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of symbology if self.symbology: _dict['symbology'] = self.symbology.to_dict() @@ -67,28 +84,28 @@ def to_dict(self): 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__: + # and model_fields_set contains the field + if self.symbology is None and "symbology" in self.model_fields_set: _dict['symbology'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> UpdateLayer: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UpdateLayer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UpdateLayer.parse_obj(obj) + return cls.model_validate(obj) - _obj = UpdateLayer.parse_obj({ + _obj = cls.model_validate({ "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 + "symbology": Symbology.from_dict(obj["symbology"]) if obj.get("symbology") is not None else None, + "workflow": Workflow.from_dict(obj["workflow"]) if obj.get("workflow") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/update_layer_collection.py b/python/geoengine_openapi_client/models/update_layer_collection.py index 35c6780d..0a6341ae 100644 --- a/python/geoengine_openapi_client/models/update_layer_collection.py +++ b/python/geoengine_openapi_client/models/update_layer_collection.py @@ -18,55 +18,72 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self 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"] + """ # noqa: E501 + description: StrictStr + name: StrictStr + properties: Optional[List[Annotated[List[StrictStr], Field(min_length=2, max_length=2)]]] = None + __properties: ClassVar[List[str]] = ["description", "name", "properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> UpdateLayerCollection: + def from_json(cls, json_str: str) -> Optional[Self]: """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) + 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: dict) -> UpdateLayerCollection: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UpdateLayerCollection from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UpdateLayerCollection.parse_obj(obj) + return cls.model_validate(obj) - _obj = UpdateLayerCollection.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), "name": obj.get("name"), "properties": obj.get("properties") diff --git a/python/geoengine_openapi_client/models/update_project.py b/python/geoengine_openapi_client/models/update_project.py index 17eb2601..685a18e8 100644 --- a/python/geoengine_openapi_client/models/update_project.py +++ b/python/geoengine_openapi_client/models/update_project.py @@ -18,120 +18,136 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.layer_update import LayerUpdate from geoengine_openapi_client.models.plot_update import PlotUpdate from geoengine_openapi_client.models.st_rectangle import STRectangle from geoengine_openapi_client.models.time_step import TimeStep +from typing import Optional, Set +from typing_extensions import Self class UpdateProject(BaseModel): """ UpdateProject - """ + """ # noqa: E501 bounds: Optional[STRectangle] = None description: Optional[StrictStr] = None - id: StrictStr = Field(...) - layers: Optional[conlist(LayerUpdate)] = None + id: StrictStr + layers: Optional[List[LayerUpdate]] = None name: Optional[StrictStr] = None - plots: Optional[conlist(PlotUpdate)] = None - time_step: Optional[TimeStep] = Field(None, alias="timeStep") - __properties = ["bounds", "description", "id", "layers", "name", "plots", "timeStep"] + plots: Optional[List[PlotUpdate]] = None + time_step: Optional[TimeStep] = Field(default=None, alias="timeStep") + __properties: ClassVar[List[str]] = ["bounds", "description", "id", "layers", "name", "plots", "timeStep"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> UpdateProject: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UpdateProject 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of bounds if self.bounds: _dict['bounds'] = self.bounds.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in layers (list) _items = [] if self.layers: - for _item in self.layers: - if _item: - _items.append(_item.to_dict()) + for _item_layers in self.layers: + if _item_layers: + _items.append(_item_layers.to_dict()) _dict['layers'] = _items # override the default output from pydantic by calling `to_dict()` of each item in plots (list) _items = [] if self.plots: - for _item in self.plots: - if _item: - _items.append(_item.to_dict()) + for _item_plots in self.plots: + if _item_plots: + _items.append(_item_plots.to_dict()) _dict['plots'] = _items # override the default output from pydantic by calling `to_dict()` of time_step if self.time_step: _dict['timeStep'] = self.time_step.to_dict() # set to None if bounds (nullable) is None - # and __fields_set__ contains the field - if self.bounds is None and "bounds" in self.__fields_set__: + # and model_fields_set contains the field + if self.bounds is None and "bounds" in self.model_fields_set: _dict['bounds'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if layers (nullable) is None - # and __fields_set__ contains the field - if self.layers is None and "layers" in self.__fields_set__: + # and model_fields_set contains the field + if self.layers is None and "layers" in self.model_fields_set: _dict['layers'] = None # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if plots (nullable) is None - # and __fields_set__ contains the field - if self.plots is None and "plots" in self.__fields_set__: + # and model_fields_set contains the field + if self.plots is None and "plots" in self.model_fields_set: _dict['plots'] = None # set to None if time_step (nullable) is None - # and __fields_set__ contains the field - if self.time_step is None and "time_step" in self.__fields_set__: + # and model_fields_set contains the field + if self.time_step is None and "time_step" in self.model_fields_set: _dict['timeStep'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> UpdateProject: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UpdateProject from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UpdateProject.parse_obj(obj) + return cls.model_validate(obj) - _obj = UpdateProject.parse_obj({ - "bounds": STRectangle.from_dict(obj.get("bounds")) if obj.get("bounds") is not None else None, + _obj = cls.model_validate({ + "bounds": STRectangle.from_dict(obj["bounds"]) if obj.get("bounds") is not None else None, "description": obj.get("description"), "id": obj.get("id"), - "layers": [LayerUpdate.from_dict(_item) for _item in obj.get("layers")] if obj.get("layers") is not None else None, + "layers": [LayerUpdate.from_dict(_item) for _item in obj["layers"]] if obj.get("layers") is not None else None, "name": obj.get("name"), - "plots": [PlotUpdate.from_dict(_item) for _item in obj.get("plots")] if obj.get("plots") is not None else None, - "time_step": TimeStep.from_dict(obj.get("timeStep")) if obj.get("timeStep") is not None else None + "plots": [PlotUpdate.from_dict(_item) for _item in obj["plots"]] if obj.get("plots") is not None else None, + "timeStep": TimeStep.from_dict(obj["timeStep"]) if obj.get("timeStep") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/update_quota.py b/python/geoengine_openapi_client/models/update_quota.py index 2c75f7b3..7b871979 100644 --- a/python/geoengine_openapi_client/models/update_quota.py +++ b/python/geoengine_openapi_client/models/update_quota.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictInt +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class UpdateQuota(BaseModel): """ UpdateQuota - """ - available: StrictInt = Field(...) - __properties = ["available"] + """ # noqa: E501 + available: StrictInt + __properties: ClassVar[List[str]] = ["available"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> UpdateQuota: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UpdateQuota 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) + 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: dict) -> UpdateQuota: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UpdateQuota from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UpdateQuota.parse_obj(obj) + return cls.model_validate(obj) - _obj = UpdateQuota.parse_obj({ + _obj = cls.model_validate({ "available": obj.get("available") }) return _obj diff --git a/python/geoengine_openapi_client/models/upload_file_layers_response.py b/python/geoengine_openapi_client/models/upload_file_layers_response.py index 34ab5de7..0be461fb 100644 --- a/python/geoengine_openapi_client/models/upload_file_layers_response.py +++ b/python/geoengine_openapi_client/models/upload_file_layers_response.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class UploadFileLayersResponse(BaseModel): """ UploadFileLayersResponse - """ - layers: conlist(StrictStr) = Field(...) - __properties = ["layers"] + """ # noqa: E501 + layers: List[StrictStr] + __properties: ClassVar[List[str]] = ["layers"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> UploadFileLayersResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UploadFileLayersResponse 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) + 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: dict) -> UploadFileLayersResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UploadFileLayersResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UploadFileLayersResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = UploadFileLayersResponse.parse_obj({ + _obj = cls.model_validate({ "layers": obj.get("layers") }) return _obj diff --git a/python/geoengine_openapi_client/models/upload_files_response.py b/python/geoengine_openapi_client/models/upload_files_response.py index 1da3ffa0..233ceba9 100644 --- a/python/geoengine_openapi_client/models/upload_files_response.py +++ b/python/geoengine_openapi_client/models/upload_files_response.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class UploadFilesResponse(BaseModel): """ UploadFilesResponse - """ - files: conlist(StrictStr) = Field(...) - __properties = ["files"] + """ # noqa: E501 + files: List[StrictStr] + __properties: ClassVar[List[str]] = ["files"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> UploadFilesResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UploadFilesResponse 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) + 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: dict) -> UploadFilesResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UploadFilesResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UploadFilesResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = UploadFilesResponse.parse_obj({ + _obj = cls.model_validate({ "files": obj.get("files") }) return _obj diff --git a/python/geoengine_openapi_client/models/usage_summary_granularity.py b/python/geoengine_openapi_client/models/usage_summary_granularity.py index 57ed8688..cf7166af 100644 --- a/python/geoengine_openapi_client/models/usage_summary_granularity.py +++ b/python/geoengine_openapi_client/models/usage_summary_granularity.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class UsageSummaryGranularity(str, Enum): @@ -37,8 +34,8 @@ class UsageSummaryGranularity(str, Enum): YEARS = 'years' @classmethod - def from_json(cls, json_str: str) -> UsageSummaryGranularity: + def from_json(cls, json_str: str) -> Self: """Create an instance of UsageSummaryGranularity from a JSON string""" - return UsageSummaryGranularity(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/user_credentials.py b/python/geoengine_openapi_client/models/user_credentials.py index f888b9f7..1bff3987 100644 --- a/python/geoengine_openapi_client/models/user_credentials.py +++ b/python/geoengine_openapi_client/models/user_credentials.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class UserCredentials(BaseModel): """ UserCredentials - """ - email: StrictStr = Field(...) - password: StrictStr = Field(...) - __properties = ["email", "password"] + """ # noqa: E501 + email: StrictStr + password: StrictStr + __properties: ClassVar[List[str]] = ["email", "password"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> UserCredentials: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserCredentials 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) + 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: dict) -> UserCredentials: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserCredentials from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserCredentials.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserCredentials.parse_obj({ + _obj = cls.model_validate({ "email": obj.get("email"), "password": obj.get("password") }) diff --git a/python/geoengine_openapi_client/models/user_info.py b/python/geoengine_openapi_client/models/user_info.py index 52ede41c..b751f806 100644 --- a/python/geoengine_openapi_client/models/user_info.py +++ b/python/geoengine_openapi_client/models/user_info.py @@ -18,68 +18,84 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +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 UserInfo(BaseModel): """ UserInfo - """ + """ # noqa: E501 email: Optional[StrictStr] = None - id: StrictStr = Field(...) - real_name: Optional[StrictStr] = Field(None, alias="realName") - __properties = ["email", "id", "realName"] + id: StrictStr + real_name: Optional[StrictStr] = Field(default=None, alias="realName") + __properties: ClassVar[List[str]] = ["email", "id", "realName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> UserInfo: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserInfo 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) + 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 email (nullable) is None - # and __fields_set__ contains the field - if self.email is None and "email" in self.__fields_set__: + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: _dict['email'] = None # set to None if real_name (nullable) is None - # and __fields_set__ contains the field - if self.real_name is None and "real_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.real_name is None and "real_name" in self.model_fields_set: _dict['realName'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> UserInfo: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserInfo from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserInfo.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserInfo.parse_obj({ + _obj = cls.model_validate({ "email": obj.get("email"), "id": obj.get("id"), - "real_name": obj.get("realName") + "realName": obj.get("realName") }) return _obj diff --git a/python/geoengine_openapi_client/models/user_registration.py b/python/geoengine_openapi_client/models/user_registration.py index 66d409d0..7178b92a 100644 --- a/python/geoengine_openapi_client/models/user_registration.py +++ b/python/geoengine_openapi_client/models/user_registration.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +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 UserRegistration(BaseModel): """ UserRegistration - """ - email: StrictStr = Field(...) - password: StrictStr = Field(...) - real_name: StrictStr = Field(..., alias="realName") - __properties = ["email", "password", "realName"] + """ # noqa: E501 + email: StrictStr + password: StrictStr + real_name: StrictStr = Field(alias="realName") + __properties: ClassVar[List[str]] = ["email", "password", "realName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> UserRegistration: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserRegistration 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) + 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: dict) -> UserRegistration: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserRegistration from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserRegistration.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserRegistration.parse_obj({ + _obj = cls.model_validate({ "email": obj.get("email"), "password": obj.get("password"), - "real_name": obj.get("realName") + "realName": obj.get("realName") }) return _obj diff --git a/python/geoengine_openapi_client/models/user_session.py b/python/geoengine_openapi_client/models/user_session.py index 5e5dc940..95c3730d 100644 --- a/python/geoengine_openapi_client/models/user_session.py +++ b/python/geoengine_openapi_client/models/user_session.py @@ -19,48 +19,65 @@ import json from datetime import datetime -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.st_rectangle import STRectangle from geoengine_openapi_client.models.user_info import UserInfo +from typing import Optional, Set +from typing_extensions import Self class UserSession(BaseModel): """ UserSession - """ - created: datetime = Field(...) - id: StrictStr = Field(...) + """ # noqa: E501 + created: datetime + id: StrictStr project: Optional[StrictStr] = None - roles: conlist(StrictStr) = Field(...) - user: UserInfo = Field(...) - valid_until: datetime = Field(..., alias="validUntil") + roles: List[StrictStr] + user: UserInfo + valid_until: datetime = Field(alias="validUntil") view: Optional[STRectangle] = None - __properties = ["created", "id", "project", "roles", "user", "validUntil", "view"] + __properties: ClassVar[List[str]] = ["created", "id", "project", "roles", "user", "validUntil", "view"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> UserSession: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserSession 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of user if self.user: _dict['user'] = self.user.to_dict() @@ -68,34 +85,34 @@ def to_dict(self): if self.view: _dict['view'] = self.view.to_dict() # set to None if project (nullable) is None - # and __fields_set__ contains the field - if self.project is None and "project" in self.__fields_set__: + # and model_fields_set contains the field + if self.project is None and "project" in self.model_fields_set: _dict['project'] = None # set to None if view (nullable) is None - # and __fields_set__ contains the field - if self.view is None and "view" in self.__fields_set__: + # and model_fields_set contains the field + if self.view is None and "view" in self.model_fields_set: _dict['view'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> UserSession: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserSession from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserSession.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserSession.parse_obj({ + _obj = cls.model_validate({ "created": obj.get("created"), "id": obj.get("id"), "project": obj.get("project"), "roles": obj.get("roles"), - "user": UserInfo.from_dict(obj.get("user")) if obj.get("user") is not None else None, - "valid_until": obj.get("validUntil"), - "view": STRectangle.from_dict(obj.get("view")) if obj.get("view") is not None else None + "user": UserInfo.from_dict(obj["user"]) if obj.get("user") is not None else None, + "validUntil": obj.get("validUntil"), + "view": STRectangle.from_dict(obj["view"]) if obj.get("view") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/vector_column_info.py b/python/geoengine_openapi_client/models/vector_column_info.py index 5424a65e..e330090e 100644 --- a/python/geoengine_openapi_client/models/vector_column_info.py +++ b/python/geoengine_openapi_client/models/vector_column_info.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.feature_data_type import FeatureDataType from geoengine_openapi_client.models.measurement import Measurement +from typing import Optional, Set +from typing_extensions import Self class VectorColumnInfo(BaseModel): """ VectorColumnInfo - """ - data_type: FeatureDataType = Field(..., alias="dataType") - measurement: Measurement = Field(...) - __properties = ["dataType", "measurement"] + """ # noqa: E501 + data_type: FeatureDataType = Field(alias="dataType") + measurement: Measurement + __properties: ClassVar[List[str]] = ["dataType", "measurement"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> VectorColumnInfo: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of VectorColumnInfo 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of measurement if self.measurement: _dict['measurement'] = self.measurement.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> VectorColumnInfo: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of VectorColumnInfo from a dict""" if obj is None: return None if not isinstance(obj, dict): - return VectorColumnInfo.parse_obj(obj) + return cls.model_validate(obj) - _obj = VectorColumnInfo.parse_obj({ - "data_type": obj.get("dataType"), - "measurement": Measurement.from_dict(obj.get("measurement")) if obj.get("measurement") is not None else None + _obj = cls.model_validate({ + "dataType": obj.get("dataType"), + "measurement": Measurement.from_dict(obj["measurement"]) if obj.get("measurement") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/vector_data_type.py b/python/geoengine_openapi_client/models/vector_data_type.py index 38b19dd4..05a29c1b 100644 --- a/python/geoengine_openapi_client/models/vector_data_type.py +++ b/python/geoengine_openapi_client/models/vector_data_type.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class VectorDataType(str, Enum): @@ -36,8 +33,8 @@ class VectorDataType(str, Enum): MULTIPOLYGON = 'MultiPolygon' @classmethod - def from_json(cls, json_str: str) -> VectorDataType: + def from_json(cls, json_str: str) -> Self: """Create an instance of VectorDataType from a JSON string""" - return VectorDataType(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/vector_query_rectangle.py b/python/geoengine_openapi_client/models/vector_query_rectangle.py index 660535fe..e1887eb5 100644 --- a/python/geoengine_openapi_client/models/vector_query_rectangle.py +++ b/python/geoengine_openapi_client/models/vector_query_rectangle.py @@ -18,46 +18,62 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.bounding_box2_d import BoundingBox2D from geoengine_openapi_client.models.spatial_resolution import SpatialResolution from geoengine_openapi_client.models.time_interval import TimeInterval +from typing import Optional, Set +from typing_extensions import Self class VectorQueryRectangle(BaseModel): """ - A spatio-temporal rectangle with a specified resolution # noqa: E501 - """ - spatial_bounds: BoundingBox2D = Field(..., alias="spatialBounds") - spatial_resolution: SpatialResolution = Field(..., alias="spatialResolution") - time_interval: TimeInterval = Field(..., alias="timeInterval") - __properties = ["spatialBounds", "spatialResolution", "timeInterval"] + A spatio-temporal rectangle with a specified resolution + """ # noqa: E501 + spatial_bounds: BoundingBox2D = Field(alias="spatialBounds") + spatial_resolution: SpatialResolution = Field(alias="spatialResolution") + time_interval: TimeInterval = Field(alias="timeInterval") + __properties: ClassVar[List[str]] = ["spatialBounds", "spatialResolution", "timeInterval"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> VectorQueryRectangle: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of VectorQueryRectangle 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of spatial_bounds if self.spatial_bounds: _dict['spatialBounds'] = self.spatial_bounds.to_dict() @@ -70,18 +86,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> VectorQueryRectangle: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of VectorQueryRectangle from a dict""" if obj is None: return None if not isinstance(obj, dict): - return VectorQueryRectangle.parse_obj(obj) + return cls.model_validate(obj) - _obj = VectorQueryRectangle.parse_obj({ - "spatial_bounds": BoundingBox2D.from_dict(obj.get("spatialBounds")) if obj.get("spatialBounds") is not None else None, - "spatial_resolution": SpatialResolution.from_dict(obj.get("spatialResolution")) if obj.get("spatialResolution") is not None else None, - "time_interval": TimeInterval.from_dict(obj.get("timeInterval")) if obj.get("timeInterval") is not None else None + _obj = cls.model_validate({ + "spatialBounds": BoundingBox2D.from_dict(obj["spatialBounds"]) if obj.get("spatialBounds") is not None else None, + "spatialResolution": SpatialResolution.from_dict(obj["spatialResolution"]) if obj.get("spatialResolution") is not None else None, + "timeInterval": TimeInterval.from_dict(obj["timeInterval"]) if obj.get("timeInterval") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/vector_result_descriptor.py b/python/geoengine_openapi_client/models/vector_result_descriptor.py index 7f5c08b8..8899ce67 100644 --- a/python/geoengine_openapi_client/models/vector_result_descriptor.py +++ b/python/geoengine_openapi_client/models/vector_result_descriptor.py @@ -18,94 +18,110 @@ import re # noqa: F401 import json - -from typing import Dict, Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from geoengine_openapi_client.models.bounding_box2_d import BoundingBox2D from geoengine_openapi_client.models.time_interval import TimeInterval from geoengine_openapi_client.models.vector_column_info import VectorColumnInfo from geoengine_openapi_client.models.vector_data_type import VectorDataType +from typing import Optional, Set +from typing_extensions import Self class VectorResultDescriptor(BaseModel): """ VectorResultDescriptor - """ + """ # noqa: E501 bbox: Optional[BoundingBox2D] = None - columns: Dict[str, VectorColumnInfo] = Field(...) - data_type: VectorDataType = Field(..., alias="dataType") - spatial_reference: StrictStr = Field(..., alias="spatialReference") + columns: Dict[str, VectorColumnInfo] + data_type: VectorDataType = Field(alias="dataType") + spatial_reference: StrictStr = Field(alias="spatialReference") time: Optional[TimeInterval] = None - __properties = ["bbox", "columns", "dataType", "spatialReference", "time"] + __properties: ClassVar[List[str]] = ["bbox", "columns", "dataType", "spatialReference", "time"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> VectorResultDescriptor: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of VectorResultDescriptor 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of bbox if self.bbox: _dict['bbox'] = self.bbox.to_dict() # override the default output from pydantic by calling `to_dict()` of each value in columns (dict) _field_dict = {} if self.columns: - for _key in self.columns: - if self.columns[_key]: - _field_dict[_key] = self.columns[_key].to_dict() + for _key_columns in self.columns: + if self.columns[_key_columns]: + _field_dict[_key_columns] = self.columns[_key_columns].to_dict() _dict['columns'] = _field_dict # override the default output from pydantic by calling `to_dict()` of time if self.time: _dict['time'] = self.time.to_dict() # set to None if bbox (nullable) is None - # and __fields_set__ contains the field - if self.bbox is None and "bbox" in self.__fields_set__: + # and model_fields_set contains the field + if self.bbox is None and "bbox" in self.model_fields_set: _dict['bbox'] = None # set to None if time (nullable) is None - # and __fields_set__ contains the field - if self.time is None and "time" in self.__fields_set__: + # and model_fields_set contains the field + if self.time is None and "time" in self.model_fields_set: _dict['time'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> VectorResultDescriptor: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of VectorResultDescriptor from a dict""" if obj is None: return None if not isinstance(obj, dict): - return VectorResultDescriptor.parse_obj(obj) + return cls.model_validate(obj) - _obj = VectorResultDescriptor.parse_obj({ - "bbox": BoundingBox2D.from_dict(obj.get("bbox")) if obj.get("bbox") is not None else None, + _obj = cls.model_validate({ + "bbox": BoundingBox2D.from_dict(obj["bbox"]) if obj.get("bbox") is not None else None, "columns": dict( (_k, VectorColumnInfo.from_dict(_v)) - for _k, _v in obj.get("columns").items() + for _k, _v in obj["columns"].items() ) if obj.get("columns") is not None else None, - "data_type": obj.get("dataType"), - "spatial_reference": obj.get("spatialReference"), - "time": TimeInterval.from_dict(obj.get("time")) if obj.get("time") is not None else None + "dataType": obj.get("dataType"), + "spatialReference": obj.get("spatialReference"), + "time": TimeInterval.from_dict(obj["time"]) if obj.get("time") is not None else None }) return _obj diff --git a/python/geoengine_openapi_client/models/volume.py b/python/geoengine_openapi_client/models/volume.py index 3e2f9dbe..a86ae396 100644 --- a/python/geoengine_openapi_client/models/volume.py +++ b/python/geoengine_openapi_client/models/volume.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class Volume(BaseModel): """ Volume - """ - name: StrictStr = Field(...) + """ # noqa: E501 + name: StrictStr path: Optional[StrictStr] = None - __properties = ["name", "path"] + __properties: ClassVar[List[str]] = ["name", "path"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> Volume: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Volume 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) + 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 path (nullable) is None - # and __fields_set__ contains the field - if self.path is None and "path" in self.__fields_set__: + # and model_fields_set contains the field + if self.path is None and "path" in self.model_fields_set: _dict['path'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Volume: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Volume from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Volume.parse_obj(obj) + return cls.model_validate(obj) - _obj = Volume.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "path": obj.get("path") }) diff --git a/python/geoengine_openapi_client/models/volume_file_layers_response.py b/python/geoengine_openapi_client/models/volume_file_layers_response.py index 05e8f7a7..13c6bc87 100644 --- a/python/geoengine_openapi_client/models/volume_file_layers_response.py +++ b/python/geoengine_openapi_client/models/volume_file_layers_response.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - -from typing import List -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class VolumeFileLayersResponse(BaseModel): """ VolumeFileLayersResponse - """ - layers: conlist(StrictStr) = Field(...) - __properties = ["layers"] + """ # noqa: E501 + layers: List[StrictStr] + __properties: ClassVar[List[str]] = ["layers"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> VolumeFileLayersResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of VolumeFileLayersResponse 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) + 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: dict) -> VolumeFileLayersResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of VolumeFileLayersResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return VolumeFileLayersResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = VolumeFileLayersResponse.parse_obj({ + _obj = cls.model_validate({ "layers": obj.get("layers") }) return _obj diff --git a/python/geoengine_openapi_client/models/wcs_boundingbox.py b/python/geoengine_openapi_client/models/wcs_boundingbox.py index 6b6fade3..319945c1 100644 --- a/python/geoengine_openapi_client/models/wcs_boundingbox.py +++ b/python/geoengine_openapi_client/models/wcs_boundingbox.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - -from typing import List, Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self class WcsBoundingbox(BaseModel): """ WcsBoundingbox - """ - bbox: conlist(Union[StrictFloat, StrictInt]) = Field(...) + """ # noqa: E501 + bbox: List[Union[StrictFloat, StrictInt]] spatial_reference: Optional[StrictStr] = None - __properties = ["bbox", "spatial_reference"] + __properties: ClassVar[List[str]] = ["bbox", "spatial_reference"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> WcsBoundingbox: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of WcsBoundingbox 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) + 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 spatial_reference (nullable) is None - # and __fields_set__ contains the field - if self.spatial_reference is None and "spatial_reference" in self.__fields_set__: + # and model_fields_set contains the field + if self.spatial_reference is None and "spatial_reference" in self.model_fields_set: _dict['spatial_reference'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> WcsBoundingbox: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of WcsBoundingbox from a dict""" if obj is None: return None if not isinstance(obj, dict): - return WcsBoundingbox.parse_obj(obj) + return cls.model_validate(obj) - _obj = WcsBoundingbox.parse_obj({ + _obj = cls.model_validate({ "bbox": obj.get("bbox"), "spatial_reference": obj.get("spatial_reference") }) diff --git a/python/geoengine_openapi_client/models/wcs_service.py b/python/geoengine_openapi_client/models/wcs_service.py index 661f52d8..3a8f5be9 100644 --- a/python/geoengine_openapi_client/models/wcs_service.py +++ b/python/geoengine_openapi_client/models/wcs_service.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class WcsService(str, Enum): @@ -33,8 +30,8 @@ class WcsService(str, Enum): WCS = 'WCS' @classmethod - def from_json(cls, json_str: str) -> WcsService: + def from_json(cls, json_str: str) -> Self: """Create an instance of WcsService from a JSON string""" - return WcsService(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/wcs_version.py b/python/geoengine_openapi_client/models/wcs_version.py index 238f78ba..abd0d0bd 100644 --- a/python/geoengine_openapi_client/models/wcs_version.py +++ b/python/geoengine_openapi_client/models/wcs_version.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class WcsVersion(str, Enum): @@ -34,8 +31,8 @@ class WcsVersion(str, Enum): ENUM_1_DOT_1_DOT_1 = '1.1.1' @classmethod - def from_json(cls, json_str: str) -> WcsVersion: + def from_json(cls, json_str: str) -> Self: """Create an instance of WcsVersion from a JSON string""" - return WcsVersion(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/wfs_service.py b/python/geoengine_openapi_client/models/wfs_service.py index e6827212..5cfad687 100644 --- a/python/geoengine_openapi_client/models/wfs_service.py +++ b/python/geoengine_openapi_client/models/wfs_service.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class WfsService(str, Enum): @@ -33,8 +30,8 @@ class WfsService(str, Enum): WFS = 'WFS' @classmethod - def from_json(cls, json_str: str) -> WfsService: + def from_json(cls, json_str: str) -> Self: """Create an instance of WfsService from a JSON string""" - return WfsService(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/wfs_version.py b/python/geoengine_openapi_client/models/wfs_version.py index 2c278913..8656db7d 100644 --- a/python/geoengine_openapi_client/models/wfs_version.py +++ b/python/geoengine_openapi_client/models/wfs_version.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class WfsVersion(str, Enum): @@ -33,8 +30,8 @@ class WfsVersion(str, Enum): ENUM_2_DOT_0_DOT_0 = '2.0.0' @classmethod - def from_json(cls, json_str: str) -> WfsVersion: + def from_json(cls, json_str: str) -> Self: """Create an instance of WfsVersion from a JSON string""" - return WfsVersion(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/wms_service.py b/python/geoengine_openapi_client/models/wms_service.py index e17d8633..235a1148 100644 --- a/python/geoengine_openapi_client/models/wms_service.py +++ b/python/geoengine_openapi_client/models/wms_service.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class WmsService(str, Enum): @@ -33,8 +30,8 @@ class WmsService(str, Enum): WMS = 'WMS' @classmethod - def from_json(cls, json_str: str) -> WmsService: + def from_json(cls, json_str: str) -> Self: """Create an instance of WmsService from a JSON string""" - return WmsService(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/wms_version.py b/python/geoengine_openapi_client/models/wms_version.py index 019f76f3..6e1e52fc 100644 --- a/python/geoengine_openapi_client/models/wms_version.py +++ b/python/geoengine_openapi_client/models/wms_version.py @@ -13,13 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg - - - +from enum import Enum +from typing_extensions import Self class WmsVersion(str, Enum): @@ -33,8 +30,8 @@ class WmsVersion(str, Enum): ENUM_1_DOT_3_DOT_0 = '1.3.0' @classmethod - def from_json(cls, json_str: str) -> WmsVersion: + def from_json(cls, json_str: str) -> Self: """Create an instance of WmsVersion from a JSON string""" - return WmsVersion(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/python/geoengine_openapi_client/models/workflow.py b/python/geoengine_openapi_client/models/workflow.py index 2809777e..2ce9cd49 100644 --- a/python/geoengine_openapi_client/models/workflow.py +++ b/python/geoengine_openapi_client/models/workflow.py @@ -18,66 +18,82 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.typed_operator_operator import TypedOperatorOperator +from typing import Optional, Set +from typing_extensions import Self class Workflow(BaseModel): """ Workflow - """ - operator: TypedOperatorOperator = Field(...) - type: StrictStr = Field(...) - __properties = ["operator", "type"] + """ # noqa: E501 + operator: TypedOperatorOperator + type: StrictStr + __properties: ClassVar[List[str]] = ["operator", "type"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('Vector', 'Raster', 'Plot'): + if value not in set(['Vector', 'Raster', 'Plot']): raise ValueError("must be one of enum values ('Vector', 'Raster', 'Plot')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + 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.dict(by_alias=True)) + 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) -> Workflow: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Workflow 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) + 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, + ) # override the default output from pydantic by calling `to_dict()` of operator if self.operator: _dict['operator'] = self.operator.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> Workflow: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Workflow from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Workflow.parse_obj(obj) + return cls.model_validate(obj) - _obj = Workflow.parse_obj({ - "operator": TypedOperatorOperator.from_dict(obj.get("operator")) if obj.get("operator") is not None else None, + _obj = cls.model_validate({ + "operator": TypedOperatorOperator.from_dict(obj["operator"]) if obj.get("operator") is not None else None, "type": obj.get("type") }) return _obj diff --git a/python/geoengine_openapi_client/models/wrapped_plot_output.py b/python/geoengine_openapi_client/models/wrapped_plot_output.py index 0718fda1..1865374e 100644 --- a/python/geoengine_openapi_client/models/wrapped_plot_output.py +++ b/python/geoengine_openapi_client/models/wrapped_plot_output.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - -from typing import Any, Dict -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List from geoengine_openapi_client.models.plot_output_format import PlotOutputFormat +from typing import Optional, Set +from typing_extensions import Self class WrappedPlotOutput(BaseModel): """ WrappedPlotOutput - """ - data: Dict[str, Any] = Field(...) - output_format: PlotOutputFormat = Field(..., alias="outputFormat") - plot_type: StrictStr = Field(..., alias="plotType") - __properties = ["data", "outputFormat", "plotType"] + """ # noqa: E501 + data: Dict[str, Any] + output_format: PlotOutputFormat = Field(alias="outputFormat") + plot_type: StrictStr = Field(alias="plotType") + __properties: ClassVar[List[str]] = ["data", "outputFormat", "plotType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + 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) -> WrappedPlotOutput: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of WrappedPlotOutput 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) + 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: dict) -> WrappedPlotOutput: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of WrappedPlotOutput from a dict""" if obj is None: return None if not isinstance(obj, dict): - return WrappedPlotOutput.parse_obj(obj) + return cls.model_validate(obj) - _obj = WrappedPlotOutput.parse_obj({ + _obj = cls.model_validate({ "data": obj.get("data"), - "output_format": obj.get("outputFormat"), - "plot_type": obj.get("plotType") + "outputFormat": obj.get("outputFormat"), + "plotType": obj.get("plotType") }) return _obj diff --git a/python/geoengine_openapi_client/rest.py b/python/geoengine_openapi_client/rest.py index 45c90696..7f6bb656 100644 --- a/python/geoengine_openapi_client/rest.py +++ b/python/geoengine_openapi_client/rest.py @@ -15,43 +15,55 @@ import io import json -import logging import re import ssl -from urllib.parse import urlencode, quote_plus import urllib3 -from geoengine_openapi_client.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError, BadRequestException +from geoengine_openapi_client.exceptions import ApiException, ApiValueError +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): def __init__(self, resp) -> None: - self.urllib3_response = resp + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) + return self.response.headers.get(name, default) class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None) -> None: + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -60,74 +72,79 @@ def __init__(self, configuration, pools_size=4, maxsize=None) -> None: else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name + pool_args['server_hostname'] = configuration.tls_server_name if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager + self.pool_manager: urllib3.PoolManager + if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -136,63 +153,86 @@ def request(self, method, url, query_params=None, headers=None, post_params = post_params or {} headers = headers or {} - # url already contains the URL query string - # so reset query_params to empty dict - query_params = {} timeout = None if _request_timeout: - if isinstance(_request_timeout, (int,float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: # no content type provided or payload is json - if not headers.get('Content-Type') or re.search('json', headers['Content-Type'], re.IGNORECASE): + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -203,102 +243,16 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields={}, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 400: - raise BadRequestException(http_resp=r) - - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def get_request(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def head_request(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def options_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def delete_request(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def post_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def put_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def patch_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return RESTResponse(r) diff --git a/python/pyproject.toml b/python/pyproject.toml index 192defb1..eb4f908c 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "geoengine_openapi_client" -version = "0.0.20" +version = "0.0.21" description = "Geo Engine API" authors = ["Geo Engine Developers "] license = "Apache-2.0" @@ -10,17 +10,21 @@ keywords = ["OpenAPI", "OpenAPI-Generator", "Geo Engine API"] include = ["geoengine_openapi_client/py.typed"] [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" -urllib3 = ">= 1.25.3" -python-dateutil = ">=2.8.2" -pydantic = "^1.10.5, <2" -aenum = ">=3.1.11" +urllib3 = ">= 1.25.3, < 3.0.0" +python-dateutil = ">= 2.8.2" +pydantic = ">= 2" +typing-extensions = ">= 4.7.1" [tool.poetry.dev-dependencies] -pytest = ">=7.2.1" -tox = ">=3.9.0" -flake8 = ">=4.0.0" +pytest = ">= 7.2.1" +pytest-cov = ">= 2.8.1" +tox = ">= 3.9.0" +flake8 = ">= 4.0.0" +types-python-dateutil = ">= 2.8.19.14" +mypy = ">= 1.5" + [build-system] requires = ["setuptools"] @@ -28,3 +32,58 @@ build-backend = "setuptools.build_meta" [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "geoengine_openapi_client", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +extra_checks = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true + +[[tool.mypy.overrides]] +module = [ + "geoengine_openapi_client.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true diff --git a/python/requirements.txt b/python/requirements.txt index 258c179c..67f7f68d 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1,5 +1,4 @@ -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3, < 2.1.0 -pydantic >= 1.10.5, < 2 -aenum >= 3.1.11 +urllib3 >= 1.25.3, < 3.0.0 +python_dateutil >= 2.8.2 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/python/setup.py b/python/setup.py index 56ef63d9..34c127c1 100644 --- a/python/setup.py +++ b/python/setup.py @@ -22,13 +22,13 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "geoengine-openapi-client" -VERSION = "0.0.20" -PYTHON_REQUIRES = ">=3.7" +VERSION = "0.0.21" +PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ - "urllib3 >= 1.25.3, < 2.1.0", - "python-dateutil", - "pydantic >= 1.10.5, < 2", - "aenum" + "urllib3 >= 1.25.3, < 3.0.0", + "python-dateutil >= 2.8.2", + "pydantic >= 2", + "typing-extensions >= 4.7.1", ] setup( @@ -48,4 +48,4 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) """, # noqa: E501 package_data={"geoengine_openapi_client": ["py.typed"]}, -) +) \ No newline at end of file diff --git a/python/test-requirements.txt b/python/test-requirements.txt index 3a0d0b93..e98555c1 100644 --- a/python/test-requirements.txt +++ b/python/test-requirements.txt @@ -1,3 +1,6 @@ -pytest~=7.1.3 -pytest-cov>=2.8.1 -pytest-randomly>=3.12.0 +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 diff --git a/python/test/test_add_collection200_response.py b/python/test/test_add_collection200_response.py index 69c34b75..85b196df 100644 --- a/python/test/test_add_collection200_response.py +++ b/python/test/test_add_collection200_response.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response # noqa: E501 +from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response class TestAddCollection200Response(unittest.TestCase): """AddCollection200Response unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> AddCollection200Response: """Test AddCollection200Response - include_option is a boolean, when False only required + include_optional 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 `AddCollection200Response` """ - model = AddCollection200Response() # noqa: E501 + model = AddCollection200Response() if include_optional: return AddCollection200Response( id = '' diff --git a/python/test/test_add_dataset.py b/python/test/test_add_dataset.py index 3c8000fe..f834dda9 100644 --- a/python/test/test_add_dataset.py +++ b/python/test/test_add_dataset.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.add_dataset import AddDataset # noqa: E501 +from geoengine_openapi_client.models.add_dataset import AddDataset class TestAddDataset(unittest.TestCase): """AddDataset unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> AddDataset: """Test AddDataset - include_option is a boolean, when False only required + include_optional 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 `AddDataset` """ - model = AddDataset() # noqa: E501 + model = AddDataset() if include_optional: return AddDataset( description = '', diff --git a/python/test/test_add_layer.py b/python/test/test_add_layer.py index 3b5406ed..85c14728 100644 --- a/python/test/test_add_layer.py +++ b/python/test/test_add_layer.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.add_layer import AddLayer # noqa: E501 +from geoengine_openapi_client.models.add_layer import AddLayer class TestAddLayer(unittest.TestCase): """AddLayer unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> AddLayer: """Test AddLayer - include_option is a boolean, when False only required + include_optional 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 `AddLayer` """ - model = AddLayer() # noqa: E501 + model = AddLayer() if include_optional: return AddLayer( description = 'Example layer description', diff --git a/python/test/test_add_layer_collection.py b/python/test/test_add_layer_collection.py index 52efe282..6574ff45 100644 --- a/python/test/test_add_layer_collection.py +++ b/python/test/test_add_layer_collection.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.add_layer_collection import AddLayerCollection # noqa: E501 +from geoengine_openapi_client.models.add_layer_collection import AddLayerCollection class TestAddLayerCollection(unittest.TestCase): """AddLayerCollection unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> AddLayerCollection: """Test AddLayerCollection - include_option is a boolean, when False only required + include_optional 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 `AddLayerCollection` """ - model = AddLayerCollection() # noqa: E501 + model = AddLayerCollection() if include_optional: return AddLayerCollection( description = 'A description for an example collection', diff --git a/python/test/test_add_role.py b/python/test/test_add_role.py index ef34ac1f..f025f667 100644 --- a/python/test/test_add_role.py +++ b/python/test/test_add_role.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.add_role import AddRole # noqa: E501 +from geoengine_openapi_client.models.add_role import AddRole class TestAddRole(unittest.TestCase): """AddRole unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> AddRole: """Test AddRole - include_option is a boolean, when False only required + include_optional 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 `AddRole` """ - model = AddRole() # noqa: E501 + model = AddRole() if include_optional: return AddRole( name = '' diff --git a/python/test/test_auth_code_request_url.py b/python/test/test_auth_code_request_url.py index 447cf141..9a322482 100644 --- a/python/test/test_auth_code_request_url.py +++ b/python/test/test_auth_code_request_url.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.auth_code_request_url import AuthCodeRequestURL # noqa: E501 +from geoengine_openapi_client.models.auth_code_request_url import AuthCodeRequestURL class TestAuthCodeRequestURL(unittest.TestCase): """AuthCodeRequestURL unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> AuthCodeRequestURL: """Test AuthCodeRequestURL - include_option is a boolean, when False only required + include_optional 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 `AuthCodeRequestURL` """ - model = AuthCodeRequestURL() # noqa: E501 + model = AuthCodeRequestURL() if include_optional: return AuthCodeRequestURL( url = '' diff --git a/python/test/test_auth_code_response.py b/python/test/test_auth_code_response.py index 5c0b1bea..d98f1c3a 100644 --- a/python/test/test_auth_code_response.py +++ b/python/test/test_auth_code_response.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.auth_code_response import AuthCodeResponse # noqa: E501 +from geoengine_openapi_client.models.auth_code_response import AuthCodeResponse class TestAuthCodeResponse(unittest.TestCase): """AuthCodeResponse unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> AuthCodeResponse: """Test AuthCodeResponse - include_option is a boolean, when False only required + include_optional 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 `AuthCodeResponse` """ - model = AuthCodeResponse() # noqa: E501 + model = AuthCodeResponse() if include_optional: return AuthCodeResponse( code = '', diff --git a/python/test/test_auto_create_dataset.py b/python/test/test_auto_create_dataset.py index c0fc3e45..d1461734 100644 --- a/python/test/test_auto_create_dataset.py +++ b/python/test/test_auto_create_dataset.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.auto_create_dataset import AutoCreateDataset # noqa: E501 +from geoengine_openapi_client.models.auto_create_dataset import AutoCreateDataset class TestAutoCreateDataset(unittest.TestCase): """AutoCreateDataset unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> AutoCreateDataset: """Test AutoCreateDataset - include_option is a boolean, when False only required + include_optional 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 `AutoCreateDataset` """ - model = AutoCreateDataset() # noqa: E501 + model = AutoCreateDataset() if include_optional: return AutoCreateDataset( dataset_description = '', diff --git a/python/test/test_axis_order.py b/python/test/test_axis_order.py index f5bb91c4..523458af 100644 --- a/python/test/test_axis_order.py +++ b/python/test/test_axis_order.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.axis_order import AxisOrder # noqa: E501 +from geoengine_openapi_client.models.axis_order import AxisOrder class TestAxisOrder(unittest.TestCase): """AxisOrder unit test stubs""" diff --git a/python/test/test_bounding_box2_d.py b/python/test/test_bounding_box2_d.py index c6614ac1..1b8e8327 100644 --- a/python/test/test_bounding_box2_d.py +++ b/python/test/test_bounding_box2_d.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.bounding_box2_d import BoundingBox2D # noqa: E501 +from geoengine_openapi_client.models.bounding_box2_d import BoundingBox2D class TestBoundingBox2D(unittest.TestCase): """BoundingBox2D unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> BoundingBox2D: """Test BoundingBox2D - include_option is a boolean, when False only required + include_optional 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 `BoundingBox2D` """ - model = BoundingBox2D() # noqa: E501 + model = BoundingBox2D() if include_optional: return BoundingBox2D( lower_left_coordinate = geoengine_openapi_client.models.coordinate2_d.Coordinate2D( diff --git a/python/test/test_breakpoint.py b/python/test/test_breakpoint.py index 9cf896fb..54549fc6 100644 --- a/python/test/test_breakpoint.py +++ b/python/test/test_breakpoint.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.breakpoint import Breakpoint # noqa: E501 +from geoengine_openapi_client.models.breakpoint import Breakpoint class TestBreakpoint(unittest.TestCase): """Breakpoint unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Breakpoint: """Test Breakpoint - include_option is a boolean, when False only required + include_optional 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 `Breakpoint` """ - model = Breakpoint() # noqa: E501 + model = Breakpoint() if include_optional: return Breakpoint( color = [ diff --git a/python/test/test_classification_measurement.py b/python/test/test_classification_measurement.py index 176e62d5..b4271c7f 100644 --- a/python/test/test_classification_measurement.py +++ b/python/test/test_classification_measurement.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.classification_measurement import ClassificationMeasurement # noqa: E501 +from geoengine_openapi_client.models.classification_measurement import ClassificationMeasurement class TestClassificationMeasurement(unittest.TestCase): """ClassificationMeasurement unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ClassificationMeasurement: """Test ClassificationMeasurement - include_option is a boolean, when False only required + include_optional 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 `ClassificationMeasurement` """ - model = ClassificationMeasurement() # noqa: E501 + model = ClassificationMeasurement() if include_optional: return ClassificationMeasurement( classes = { diff --git a/python/test/test_collection_item.py b/python/test/test_collection_item.py index 9e18e955..7b357346 100644 --- a/python/test/test_collection_item.py +++ b/python/test/test_collection_item.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.collection_item import CollectionItem # noqa: E501 +from geoengine_openapi_client.models.collection_item import CollectionItem class TestCollectionItem(unittest.TestCase): """CollectionItem unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> CollectionItem: """Test CollectionItem - include_option is a boolean, when False only required + include_optional 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 `CollectionItem` """ - model = CollectionItem() # noqa: E501 + model = CollectionItem() if include_optional: return CollectionItem( description = '', diff --git a/python/test/test_collection_type.py b/python/test/test_collection_type.py index 508329ff..e7ae6ce4 100644 --- a/python/test/test_collection_type.py +++ b/python/test/test_collection_type.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.collection_type import CollectionType # noqa: E501 +from geoengine_openapi_client.models.collection_type import CollectionType class TestCollectionType(unittest.TestCase): """CollectionType unit test stubs""" diff --git a/python/test/test_color_param.py b/python/test/test_color_param.py index 4aed92f6..49982223 100644 --- a/python/test/test_color_param.py +++ b/python/test/test_color_param.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.color_param import ColorParam # noqa: E501 +from geoengine_openapi_client.models.color_param import ColorParam class TestColorParam(unittest.TestCase): """ColorParam unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ColorParam: """Test ColorParam - include_option is a boolean, when False only required + include_optional 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 `ColorParam` """ - model = ColorParam() # noqa: E501 + model = ColorParam() if include_optional: return ColorParam( color = [ diff --git a/python/test/test_color_param_static.py b/python/test/test_color_param_static.py index b8c6451f..f9a5ed86 100644 --- a/python/test/test_color_param_static.py +++ b/python/test/test_color_param_static.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.color_param_static import ColorParamStatic # noqa: E501 +from geoengine_openapi_client.models.color_param_static import ColorParamStatic class TestColorParamStatic(unittest.TestCase): """ColorParamStatic unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ColorParamStatic: """Test ColorParamStatic - include_option is a boolean, when False only required + include_optional 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 `ColorParamStatic` """ - model = ColorParamStatic() # noqa: E501 + model = ColorParamStatic() if include_optional: return ColorParamStatic( color = [ diff --git a/python/test/test_colorizer.py b/python/test/test_colorizer.py index 19c82ab2..86d909ad 100644 --- a/python/test/test_colorizer.py +++ b/python/test/test_colorizer.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.colorizer import Colorizer # noqa: E501 +from geoengine_openapi_client.models.colorizer import Colorizer class TestColorizer(unittest.TestCase): """Colorizer unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Colorizer: """Test Colorizer - include_option is a boolean, when False only required + include_optional 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 `Colorizer` """ - model = Colorizer() # noqa: E501 + model = Colorizer() if include_optional: return Colorizer( breakpoints = [ diff --git a/python/test/test_computation_quota.py b/python/test/test_computation_quota.py index 8b929f82..c8cf959f 100644 --- a/python/test/test_computation_quota.py +++ b/python/test/test_computation_quota.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.computation_quota import ComputationQuota # noqa: E501 +from geoengine_openapi_client.models.computation_quota import ComputationQuota class TestComputationQuota(unittest.TestCase): """ComputationQuota unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ComputationQuota: """Test ComputationQuota - include_option is a boolean, when False only required + include_optional 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 `ComputationQuota` """ - model = ComputationQuota() # noqa: E501 + model = ComputationQuota() if include_optional: return ComputationQuota( computation_id = '', diff --git a/python/test/test_continuous_measurement.py b/python/test/test_continuous_measurement.py index ad4a7a6e..df9fcdbb 100644 --- a/python/test/test_continuous_measurement.py +++ b/python/test/test_continuous_measurement.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.continuous_measurement import ContinuousMeasurement # noqa: E501 +from geoengine_openapi_client.models.continuous_measurement import ContinuousMeasurement class TestContinuousMeasurement(unittest.TestCase): """ContinuousMeasurement unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ContinuousMeasurement: """Test ContinuousMeasurement - include_option is a boolean, when False only required + include_optional 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 `ContinuousMeasurement` """ - model = ContinuousMeasurement() # noqa: E501 + model = ContinuousMeasurement() if include_optional: return ContinuousMeasurement( measurement = '', diff --git a/python/test/test_coordinate2_d.py b/python/test/test_coordinate2_d.py index 5815cd87..3c21de56 100644 --- a/python/test/test_coordinate2_d.py +++ b/python/test/test_coordinate2_d.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.coordinate2_d import Coordinate2D # noqa: E501 +from geoengine_openapi_client.models.coordinate2_d import Coordinate2D class TestCoordinate2D(unittest.TestCase): """Coordinate2D unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Coordinate2D: """Test Coordinate2D - include_option is a boolean, when False only required + include_optional 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 `Coordinate2D` """ - model = Coordinate2D() # noqa: E501 + model = Coordinate2D() if include_optional: return Coordinate2D( x = 1.337, diff --git a/python/test/test_create_dataset.py b/python/test/test_create_dataset.py index 2ec87b20..18fb48d1 100644 --- a/python/test/test_create_dataset.py +++ b/python/test/test_create_dataset.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.create_dataset import CreateDataset # noqa: E501 +from geoengine_openapi_client.models.create_dataset import CreateDataset class TestCreateDataset(unittest.TestCase): """CreateDataset unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> CreateDataset: """Test CreateDataset - include_option is a boolean, when False only required + include_optional 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 `CreateDataset` """ - model = CreateDataset() # noqa: E501 + model = CreateDataset() if include_optional: return CreateDataset( data_path = None, diff --git a/python/test/test_create_dataset_handler200_response.py b/python/test/test_create_dataset_handler200_response.py index f862a07e..ac8ea16d 100644 --- a/python/test/test_create_dataset_handler200_response.py +++ b/python/test/test_create_dataset_handler200_response.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.create_dataset_handler200_response import CreateDatasetHandler200Response # noqa: E501 +from geoengine_openapi_client.models.create_dataset_handler200_response import CreateDatasetHandler200Response class TestCreateDatasetHandler200Response(unittest.TestCase): """CreateDatasetHandler200Response unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> CreateDatasetHandler200Response: """Test CreateDatasetHandler200Response - include_option is a boolean, when False only required + include_optional 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 `CreateDatasetHandler200Response` """ - model = CreateDatasetHandler200Response() # noqa: E501 + model = CreateDatasetHandler200Response() if include_optional: return CreateDatasetHandler200Response( dataset_name = '' diff --git a/python/test/test_create_project.py b/python/test/test_create_project.py index 0e889e6f..68a2f855 100644 --- a/python/test/test_create_project.py +++ b/python/test/test_create_project.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.create_project import CreateProject # noqa: E501 +from geoengine_openapi_client.models.create_project import CreateProject class TestCreateProject(unittest.TestCase): """CreateProject unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> CreateProject: """Test CreateProject - include_option is a boolean, when False only required + include_optional 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 `CreateProject` """ - model = CreateProject() # noqa: E501 + model = CreateProject() if include_optional: return CreateProject( bounds = geoengine_openapi_client.models.st_rectangle.STRectangle( diff --git a/python/test/test_csv_header.py b/python/test/test_csv_header.py index de610b12..245e0c5a 100644 --- a/python/test/test_csv_header.py +++ b/python/test/test_csv_header.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.csv_header import CsvHeader # noqa: E501 +from geoengine_openapi_client.models.csv_header import CsvHeader class TestCsvHeader(unittest.TestCase): """CsvHeader unit test stubs""" diff --git a/python/test/test_data_id.py b/python/test/test_data_id.py index c10c7bc2..83519351 100644 --- a/python/test/test_data_id.py +++ b/python/test/test_data_id.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.data_id import DataId # noqa: E501 +from geoengine_openapi_client.models.data_id import DataId class TestDataId(unittest.TestCase): """DataId unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DataId: """Test DataId - include_option is a boolean, when False only required + include_optional 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 `DataId` """ - model = DataId() # noqa: E501 + model = DataId() if include_optional: return DataId( dataset_id = '', diff --git a/python/test/test_data_path.py b/python/test/test_data_path.py index eff78ce3..70480b7d 100644 --- a/python/test/test_data_path.py +++ b/python/test/test_data_path.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.data_path import DataPath # noqa: E501 +from geoengine_openapi_client.models.data_path import DataPath class TestDataPath(unittest.TestCase): """DataPath unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DataPath: """Test DataPath - include_option is a boolean, when False only required + include_optional 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 `DataPath` """ - model = DataPath() # noqa: E501 + model = DataPath() if include_optional: return DataPath( volume = '', diff --git a/python/test/test_data_path_one_of.py b/python/test/test_data_path_one_of.py index 1e51e8e0..69d4424e 100644 --- a/python/test/test_data_path_one_of.py +++ b/python/test/test_data_path_one_of.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.data_path_one_of import DataPathOneOf # noqa: E501 +from geoengine_openapi_client.models.data_path_one_of import DataPathOneOf class TestDataPathOneOf(unittest.TestCase): """DataPathOneOf unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DataPathOneOf: """Test DataPathOneOf - include_option is a boolean, when False only required + include_optional 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 `DataPathOneOf` """ - model = DataPathOneOf() # noqa: E501 + model = DataPathOneOf() if include_optional: return DataPathOneOf( volume = '' diff --git a/python/test/test_data_path_one_of1.py b/python/test/test_data_path_one_of1.py index 51ad7fa0..c61e1b06 100644 --- a/python/test/test_data_path_one_of1.py +++ b/python/test/test_data_path_one_of1.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.data_path_one_of1 import DataPathOneOf1 # noqa: E501 +from geoengine_openapi_client.models.data_path_one_of1 import DataPathOneOf1 class TestDataPathOneOf1(unittest.TestCase): """DataPathOneOf1 unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DataPathOneOf1: """Test DataPathOneOf1 - include_option is a boolean, when False only required + include_optional 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 `DataPathOneOf1` """ - model = DataPathOneOf1() # noqa: E501 + model = DataPathOneOf1() if include_optional: return DataPathOneOf1( upload = '' diff --git a/python/test/test_data_usage.py b/python/test/test_data_usage.py index 03e7d0d5..8faa5302 100644 --- a/python/test/test_data_usage.py +++ b/python/test/test_data_usage.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.data_usage import DataUsage # noqa: E501 +from geoengine_openapi_client.models.data_usage import DataUsage class TestDataUsage(unittest.TestCase): """DataUsage unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DataUsage: """Test DataUsage - include_option is a boolean, when False only required + include_optional 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 `DataUsage` """ - model = DataUsage() # noqa: E501 + model = DataUsage() if include_optional: return DataUsage( computation_id = '', diff --git a/python/test/test_data_usage_summary.py b/python/test/test_data_usage_summary.py index c796a1d8..6964ce9e 100644 --- a/python/test/test_data_usage_summary.py +++ b/python/test/test_data_usage_summary.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.data_usage_summary import DataUsageSummary # noqa: E501 +from geoengine_openapi_client.models.data_usage_summary import DataUsageSummary class TestDataUsageSummary(unittest.TestCase): """DataUsageSummary unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DataUsageSummary: """Test DataUsageSummary - include_option is a boolean, when False only required + include_optional 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 `DataUsageSummary` """ - model = DataUsageSummary() # noqa: E501 + model = DataUsageSummary() if include_optional: return DataUsageSummary( count = 0, diff --git a/python/test/test_dataset.py b/python/test/test_dataset.py index 01947019..e4a64c2b 100644 --- a/python/test/test_dataset.py +++ b/python/test/test_dataset.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.dataset import Dataset # noqa: E501 +from geoengine_openapi_client.models.dataset import Dataset class TestDataset(unittest.TestCase): """Dataset unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Dataset: """Test Dataset - include_option is a boolean, when False only required + include_optional 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 `Dataset` """ - model = Dataset() # noqa: E501 + model = Dataset() if include_optional: return Dataset( description = '', diff --git a/python/test/test_dataset_definition.py b/python/test/test_dataset_definition.py index 5caa402c..38034e03 100644 --- a/python/test/test_dataset_definition.py +++ b/python/test/test_dataset_definition.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.dataset_definition import DatasetDefinition # noqa: E501 +from geoengine_openapi_client.models.dataset_definition import DatasetDefinition class TestDatasetDefinition(unittest.TestCase): """DatasetDefinition unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DatasetDefinition: """Test DatasetDefinition - include_option is a boolean, when False only required + include_optional 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 `DatasetDefinition` """ - model = DatasetDefinition() # noqa: E501 + model = DatasetDefinition() if include_optional: return DatasetDefinition( meta_data = None, diff --git a/python/test/test_dataset_listing.py b/python/test/test_dataset_listing.py index 7e9d6f70..5e93362d 100644 --- a/python/test/test_dataset_listing.py +++ b/python/test/test_dataset_listing.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.dataset_listing import DatasetListing # noqa: E501 +from geoengine_openapi_client.models.dataset_listing import DatasetListing class TestDatasetListing(unittest.TestCase): """DatasetListing unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DatasetListing: """Test DatasetListing - include_option is a boolean, when False only required + include_optional 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 `DatasetListing` """ - model = DatasetListing() # noqa: E501 + model = DatasetListing() if include_optional: return DatasetListing( description = '', diff --git a/python/test/test_dataset_resource.py b/python/test/test_dataset_resource.py index f85d91ab..327441b6 100644 --- a/python/test/test_dataset_resource.py +++ b/python/test/test_dataset_resource.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.dataset_resource import DatasetResource # noqa: E501 +from geoengine_openapi_client.models.dataset_resource import DatasetResource class TestDatasetResource(unittest.TestCase): """DatasetResource unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DatasetResource: """Test DatasetResource - include_option is a boolean, when False only required + include_optional 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 `DatasetResource` """ - model = DatasetResource() # noqa: E501 + model = DatasetResource() if include_optional: return DatasetResource( id = '', diff --git a/python/test/test_datasets_api.py b/python/test/test_datasets_api.py index 2478a572..1ea64087 100644 --- a/python/test/test_datasets_api.py +++ b/python/test/test_datasets_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.datasets_api import DatasetsApi # noqa: E501 +from geoengine_openapi_client.api.datasets_api import DatasetsApi class TestDatasetsApi(unittest.TestCase): """DatasetsApi unit test stubs""" def setUp(self) -> None: - self.api = DatasetsApi() # noqa: E501 + self.api = DatasetsApi() def tearDown(self) -> None: pass @@ -30,70 +30,70 @@ def tearDown(self) -> None: def test_auto_create_dataset_handler(self) -> None: """Test case for auto_create_dataset_handler - Creates a new dataset using previously uploaded files. # noqa: E501 + Creates a new dataset using previously uploaded files. """ pass def test_create_dataset_handler(self) -> None: """Test case for create_dataset_handler - Creates a new dataset referencing files. # noqa: E501 + Creates a new dataset referencing files. """ pass def test_delete_dataset_handler(self) -> None: """Test case for delete_dataset_handler - Delete a dataset # noqa: E501 + Delete a dataset """ pass def test_get_dataset_handler(self) -> None: """Test case for get_dataset_handler - Retrieves details about a dataset using the internal name. # noqa: E501 + Retrieves details about a dataset using the internal name. """ pass def test_get_loading_info_handler(self) -> None: """Test case for get_loading_info_handler - Retrieves the loading information of a dataset # noqa: E501 + Retrieves the loading information of a dataset """ pass def test_list_datasets_handler(self) -> None: """Test case for list_datasets_handler - Lists available datasets. # noqa: E501 + Lists available datasets. """ pass def test_list_volume_file_layers_handler(self) -> None: """Test case for list_volume_file_layers_handler - List the layers of a file in a volume. # noqa: E501 + List the layers of a file in a volume. """ pass def test_list_volumes_handler(self) -> None: """Test case for list_volumes_handler - Lists available volumes. # noqa: E501 + Lists available volumes. """ pass def test_suggest_meta_data_handler(self) -> None: """Test case for suggest_meta_data_handler - Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. # noqa: E501 + Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. """ pass def test_update_dataset_handler(self) -> None: """Test case for update_dataset_handler - Update details about a dataset using the internal name. # noqa: E501 + Update details about a dataset using the internal name. """ pass @@ -106,14 +106,14 @@ def test_update_dataset_provenance_handler(self) -> None: def test_update_dataset_symbology_handler(self) -> None: """Test case for update_dataset_symbology_handler - Updates the dataset's symbology # noqa: E501 + Updates the dataset's symbology """ pass def test_update_loading_info_handler(self) -> None: """Test case for update_loading_info_handler - Updates the dataset's loading info # noqa: E501 + Updates the dataset's loading info """ pass diff --git a/python/test/test_date_time.py b/python/test/test_date_time.py index ffbb0092..1a992b0b 100644 --- a/python/test/test_date_time.py +++ b/python/test/test_date_time.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.date_time import DateTime # noqa: E501 +from geoengine_openapi_client.models.date_time import DateTime class TestDateTime(unittest.TestCase): """DateTime unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DateTime: """Test DateTime - include_option is a boolean, when False only required + include_optional 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 `DateTime` """ - model = DateTime() # noqa: E501 + model = DateTime() if include_optional: return DateTime( datetime = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') diff --git a/python/test/test_derived_color.py b/python/test/test_derived_color.py index 874dc3a8..25ad4f7e 100644 --- a/python/test/test_derived_color.py +++ b/python/test/test_derived_color.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.derived_color import DerivedColor # noqa: E501 +from geoengine_openapi_client.models.derived_color import DerivedColor class TestDerivedColor(unittest.TestCase): """DerivedColor unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DerivedColor: """Test DerivedColor - include_option is a boolean, when False only required + include_optional 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 `DerivedColor` """ - model = DerivedColor() # noqa: E501 + model = DerivedColor() if include_optional: return DerivedColor( attribute = '', diff --git a/python/test/test_derived_number.py b/python/test/test_derived_number.py index d2ef8aa8..ed47e622 100644 --- a/python/test/test_derived_number.py +++ b/python/test/test_derived_number.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.derived_number import DerivedNumber # noqa: E501 +from geoengine_openapi_client.models.derived_number import DerivedNumber class TestDerivedNumber(unittest.TestCase): """DerivedNumber unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> DerivedNumber: """Test DerivedNumber - include_option is a boolean, when False only required + include_optional 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 `DerivedNumber` """ - model = DerivedNumber() # noqa: E501 + model = DerivedNumber() if include_optional: return DerivedNumber( attribute = '', diff --git a/python/test/test_describe_coverage_request.py b/python/test/test_describe_coverage_request.py index e2e1145f..29b6bb02 100644 --- a/python/test/test_describe_coverage_request.py +++ b/python/test/test_describe_coverage_request.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.describe_coverage_request import DescribeCoverageRequest # noqa: E501 +from geoengine_openapi_client.models.describe_coverage_request import DescribeCoverageRequest class TestDescribeCoverageRequest(unittest.TestCase): """DescribeCoverageRequest unit test stubs""" diff --git a/python/test/test_error_response.py b/python/test/test_error_response.py index eae9a1a2..2aebb232 100644 --- a/python/test/test_error_response.py +++ b/python/test/test_error_response.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.error_response import ErrorResponse # noqa: E501 +from geoengine_openapi_client.models.error_response import ErrorResponse class TestErrorResponse(unittest.TestCase): """ErrorResponse unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ErrorResponse: """Test ErrorResponse - include_option is a boolean, when False only required + include_optional 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 `ErrorResponse` """ - model = ErrorResponse() # noqa: E501 + model = ErrorResponse() if include_optional: return ErrorResponse( error = '', diff --git a/python/test/test_external_data_id.py b/python/test/test_external_data_id.py index e64f1a76..fffcfd73 100644 --- a/python/test/test_external_data_id.py +++ b/python/test/test_external_data_id.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.external_data_id import ExternalDataId # noqa: E501 +from geoengine_openapi_client.models.external_data_id import ExternalDataId class TestExternalDataId(unittest.TestCase): """ExternalDataId unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ExternalDataId: """Test ExternalDataId - include_option is a boolean, when False only required + include_optional 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 `ExternalDataId` """ - model = ExternalDataId() # noqa: E501 + model = ExternalDataId() if include_optional: return ExternalDataId( layer_id = '', diff --git a/python/test/test_feature_data_type.py b/python/test/test_feature_data_type.py index a64c302c..598f5d21 100644 --- a/python/test/test_feature_data_type.py +++ b/python/test/test_feature_data_type.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.feature_data_type import FeatureDataType # noqa: E501 +from geoengine_openapi_client.models.feature_data_type import FeatureDataType class TestFeatureDataType(unittest.TestCase): """FeatureDataType unit test stubs""" diff --git a/python/test/test_file_not_found_handling.py b/python/test/test_file_not_found_handling.py index 3d0dbbed..78f1a414 100644 --- a/python/test/test_file_not_found_handling.py +++ b/python/test/test_file_not_found_handling.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.file_not_found_handling import FileNotFoundHandling # noqa: E501 +from geoengine_openapi_client.models.file_not_found_handling import FileNotFoundHandling class TestFileNotFoundHandling(unittest.TestCase): """FileNotFoundHandling unit test stubs""" diff --git a/python/test/test_format_specifics.py b/python/test/test_format_specifics.py index 47108da5..67fa0357 100644 --- a/python/test/test_format_specifics.py +++ b/python/test/test_format_specifics.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.format_specifics import FormatSpecifics # noqa: E501 +from geoengine_openapi_client.models.format_specifics import FormatSpecifics class TestFormatSpecifics(unittest.TestCase): """FormatSpecifics unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> FormatSpecifics: """Test FormatSpecifics - include_option is a boolean, when False only required + include_optional 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 `FormatSpecifics` """ - model = FormatSpecifics() # noqa: E501 + model = FormatSpecifics() if include_optional: return FormatSpecifics( csv = geoengine_openapi_client.models.format_specifics_one_of_csv.FormatSpecifics_oneOf_csv( diff --git a/python/test/test_format_specifics_one_of.py b/python/test/test_format_specifics_one_of.py index a203f31e..abe9481a 100644 --- a/python/test/test_format_specifics_one_of.py +++ b/python/test/test_format_specifics_one_of.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.format_specifics_one_of import FormatSpecificsOneOf # noqa: E501 +from geoengine_openapi_client.models.format_specifics_one_of import FormatSpecificsOneOf class TestFormatSpecificsOneOf(unittest.TestCase): """FormatSpecificsOneOf unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> FormatSpecificsOneOf: """Test FormatSpecificsOneOf - include_option is a boolean, when False only required + include_optional 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 `FormatSpecificsOneOf` """ - model = FormatSpecificsOneOf() # noqa: E501 + model = FormatSpecificsOneOf() if include_optional: return FormatSpecificsOneOf( csv = geoengine_openapi_client.models.format_specifics_one_of_csv.FormatSpecifics_oneOf_csv( diff --git a/python/test/test_format_specifics_one_of_csv.py b/python/test/test_format_specifics_one_of_csv.py index d055473c..8dfee509 100644 --- a/python/test/test_format_specifics_one_of_csv.py +++ b/python/test/test_format_specifics_one_of_csv.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.format_specifics_one_of_csv import FormatSpecificsOneOfCsv # noqa: E501 +from geoengine_openapi_client.models.format_specifics_one_of_csv import FormatSpecificsOneOfCsv class TestFormatSpecificsOneOfCsv(unittest.TestCase): """FormatSpecificsOneOfCsv unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> FormatSpecificsOneOfCsv: """Test FormatSpecificsOneOfCsv - include_option is a boolean, when False only required + include_optional 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 `FormatSpecificsOneOfCsv` """ - model = FormatSpecificsOneOfCsv() # noqa: E501 + model = FormatSpecificsOneOfCsv() if include_optional: return FormatSpecificsOneOfCsv( header = 'yes' diff --git a/python/test/test_gdal_dataset_geo_transform.py b/python/test/test_gdal_dataset_geo_transform.py index 3cf94d75..e0d99702 100644 --- a/python/test/test_gdal_dataset_geo_transform.py +++ b/python/test/test_gdal_dataset_geo_transform.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.gdal_dataset_geo_transform import GdalDatasetGeoTransform # noqa: E501 +from geoengine_openapi_client.models.gdal_dataset_geo_transform import GdalDatasetGeoTransform class TestGdalDatasetGeoTransform(unittest.TestCase): """GdalDatasetGeoTransform unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> GdalDatasetGeoTransform: """Test GdalDatasetGeoTransform - include_option is a boolean, when False only required + include_optional 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 `GdalDatasetGeoTransform` """ - model = GdalDatasetGeoTransform() # noqa: E501 + model = GdalDatasetGeoTransform() if include_optional: return GdalDatasetGeoTransform( origin_coordinate = geoengine_openapi_client.models.coordinate2_d.Coordinate2D( diff --git a/python/test/test_gdal_dataset_parameters.py b/python/test/test_gdal_dataset_parameters.py index 1c436366..0a191627 100644 --- a/python/test/test_gdal_dataset_parameters.py +++ b/python/test/test_gdal_dataset_parameters.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.gdal_dataset_parameters import GdalDatasetParameters # noqa: E501 +from geoengine_openapi_client.models.gdal_dataset_parameters import GdalDatasetParameters class TestGdalDatasetParameters(unittest.TestCase): """GdalDatasetParameters unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> GdalDatasetParameters: """Test GdalDatasetParameters - include_option is a boolean, when False only required + include_optional 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 `GdalDatasetParameters` """ - model = GdalDatasetParameters() # noqa: E501 + model = GdalDatasetParameters() if include_optional: return GdalDatasetParameters( allow_alphaband_as_mask = True, diff --git a/python/test/test_gdal_loading_info_temporal_slice.py b/python/test/test_gdal_loading_info_temporal_slice.py index 88afcf68..06f47c2b 100644 --- a/python/test/test_gdal_loading_info_temporal_slice.py +++ b/python/test/test_gdal_loading_info_temporal_slice.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.gdal_loading_info_temporal_slice import GdalLoadingInfoTemporalSlice # noqa: E501 +from geoengine_openapi_client.models.gdal_loading_info_temporal_slice import GdalLoadingInfoTemporalSlice class TestGdalLoadingInfoTemporalSlice(unittest.TestCase): """GdalLoadingInfoTemporalSlice unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> GdalLoadingInfoTemporalSlice: """Test GdalLoadingInfoTemporalSlice - include_option is a boolean, when False only required + include_optional 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 `GdalLoadingInfoTemporalSlice` """ - model = GdalLoadingInfoTemporalSlice() # noqa: E501 + model = GdalLoadingInfoTemporalSlice() if include_optional: return GdalLoadingInfoTemporalSlice( cache_ttl = 0, diff --git a/python/test/test_gdal_meta_data_list.py b/python/test/test_gdal_meta_data_list.py index eef6f8cd..715b2690 100644 --- a/python/test/test_gdal_meta_data_list.py +++ b/python/test/test_gdal_meta_data_list.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.gdal_meta_data_list import GdalMetaDataList # noqa: E501 +from geoengine_openapi_client.models.gdal_meta_data_list import GdalMetaDataList class TestGdalMetaDataList(unittest.TestCase): """GdalMetaDataList unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> GdalMetaDataList: """Test GdalMetaDataList - include_option is a boolean, when False only required + include_optional 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 `GdalMetaDataList` """ - model = GdalMetaDataList() # noqa: E501 + model = GdalMetaDataList() if include_optional: return GdalMetaDataList( params = [ diff --git a/python/test/test_gdal_meta_data_regular.py b/python/test/test_gdal_meta_data_regular.py index 7e4f4d04..261bb905 100644 --- a/python/test/test_gdal_meta_data_regular.py +++ b/python/test/test_gdal_meta_data_regular.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.gdal_meta_data_regular import GdalMetaDataRegular # noqa: E501 +from geoengine_openapi_client.models.gdal_meta_data_regular import GdalMetaDataRegular class TestGdalMetaDataRegular(unittest.TestCase): """GdalMetaDataRegular unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> GdalMetaDataRegular: """Test GdalMetaDataRegular - include_option is a boolean, when False only required + include_optional 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 `GdalMetaDataRegular` """ - model = GdalMetaDataRegular() # noqa: E501 + model = GdalMetaDataRegular() if include_optional: return GdalMetaDataRegular( cache_ttl = 0, diff --git a/python/test/test_gdal_meta_data_static.py b/python/test/test_gdal_meta_data_static.py index 597ff43b..39094698 100644 --- a/python/test/test_gdal_meta_data_static.py +++ b/python/test/test_gdal_meta_data_static.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.gdal_meta_data_static import GdalMetaDataStatic # noqa: E501 +from geoengine_openapi_client.models.gdal_meta_data_static import GdalMetaDataStatic class TestGdalMetaDataStatic(unittest.TestCase): """GdalMetaDataStatic unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> GdalMetaDataStatic: """Test GdalMetaDataStatic - include_option is a boolean, when False only required + include_optional 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 `GdalMetaDataStatic` """ - model = GdalMetaDataStatic() # noqa: E501 + model = GdalMetaDataStatic() if include_optional: return GdalMetaDataStatic( cache_ttl = 0, diff --git a/python/test/test_gdal_metadata_mapping.py b/python/test/test_gdal_metadata_mapping.py index c6227d89..1e0dc211 100644 --- a/python/test/test_gdal_metadata_mapping.py +++ b/python/test/test_gdal_metadata_mapping.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.gdal_metadata_mapping import GdalMetadataMapping # noqa: E501 +from geoengine_openapi_client.models.gdal_metadata_mapping import GdalMetadataMapping class TestGdalMetadataMapping(unittest.TestCase): """GdalMetadataMapping unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> GdalMetadataMapping: """Test GdalMetadataMapping - include_option is a boolean, when False only required + include_optional 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 `GdalMetadataMapping` """ - model = GdalMetadataMapping() # noqa: E501 + model = GdalMetadataMapping() if include_optional: return GdalMetadataMapping( source_key = geoengine_openapi_client.models.raster_properties_key.RasterPropertiesKey( diff --git a/python/test/test_gdal_metadata_net_cdf_cf.py b/python/test/test_gdal_metadata_net_cdf_cf.py index 241b60fa..e7540edb 100644 --- a/python/test/test_gdal_metadata_net_cdf_cf.py +++ b/python/test/test_gdal_metadata_net_cdf_cf.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.gdal_metadata_net_cdf_cf import GdalMetadataNetCdfCf # noqa: E501 +from geoengine_openapi_client.models.gdal_metadata_net_cdf_cf import GdalMetadataNetCdfCf class TestGdalMetadataNetCdfCf(unittest.TestCase): """GdalMetadataNetCdfCf unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> GdalMetadataNetCdfCf: """Test GdalMetadataNetCdfCf - include_option is a boolean, when False only required + include_optional 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 `GdalMetadataNetCdfCf` """ - model = GdalMetadataNetCdfCf() # noqa: E501 + model = GdalMetadataNetCdfCf() if include_optional: return GdalMetadataNetCdfCf( band_offset = 0, diff --git a/python/test/test_gdal_source_time_placeholder.py b/python/test/test_gdal_source_time_placeholder.py index 66a0487d..83f7093a 100644 --- a/python/test/test_gdal_source_time_placeholder.py +++ b/python/test/test_gdal_source_time_placeholder.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.gdal_source_time_placeholder import GdalSourceTimePlaceholder # noqa: E501 +from geoengine_openapi_client.models.gdal_source_time_placeholder import GdalSourceTimePlaceholder class TestGdalSourceTimePlaceholder(unittest.TestCase): """GdalSourceTimePlaceholder unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> GdalSourceTimePlaceholder: """Test GdalSourceTimePlaceholder - include_option is a boolean, when False only required + include_optional 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 `GdalSourceTimePlaceholder` """ - model = GdalSourceTimePlaceholder() # noqa: E501 + model = GdalSourceTimePlaceholder() if include_optional: return GdalSourceTimePlaceholder( format = '', diff --git a/python/test/test_general_api.py b/python/test/test_general_api.py index ccaafa94..fc634733 100644 --- a/python/test/test_general_api.py +++ b/python/test/test_general_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.general_api import GeneralApi # noqa: E501 +from geoengine_openapi_client.api.general_api import GeneralApi class TestGeneralApi(unittest.TestCase): """GeneralApi unit test stubs""" def setUp(self) -> None: - self.api = GeneralApi() # noqa: E501 + self.api = GeneralApi() def tearDown(self) -> None: pass @@ -30,14 +30,14 @@ def tearDown(self) -> None: def test_available_handler(self) -> None: """Test case for available_handler - Server availablity check. # noqa: E501 + Server availablity check. """ pass def test_server_info_handler(self) -> None: """Test case for server_info_handler - Shows information about the server software version. # noqa: E501 + Shows information about the server software version. """ pass diff --git a/python/test/test_geo_json.py b/python/test/test_geo_json.py index 90859b3e..8858b6d4 100644 --- a/python/test/test_geo_json.py +++ b/python/test/test_geo_json.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.geo_json import GeoJson # noqa: E501 +from geoengine_openapi_client.models.geo_json import GeoJson class TestGeoJson(unittest.TestCase): """GeoJson unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> GeoJson: """Test GeoJson - include_option is a boolean, when False only required + include_optional 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 `GeoJson` """ - model = GeoJson() # noqa: E501 + model = GeoJson() if include_optional: return GeoJson( features = [ diff --git a/python/test/test_get_capabilities_format.py b/python/test/test_get_capabilities_format.py index a64df5fb..a6ab84b4 100644 --- a/python/test/test_get_capabilities_format.py +++ b/python/test/test_get_capabilities_format.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.get_capabilities_format import GetCapabilitiesFormat # noqa: E501 +from geoengine_openapi_client.models.get_capabilities_format import GetCapabilitiesFormat class TestGetCapabilitiesFormat(unittest.TestCase): """GetCapabilitiesFormat unit test stubs""" diff --git a/python/test/test_get_capabilities_request.py b/python/test/test_get_capabilities_request.py index 5271ce9d..936f40cb 100644 --- a/python/test/test_get_capabilities_request.py +++ b/python/test/test_get_capabilities_request.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.get_capabilities_request import GetCapabilitiesRequest # noqa: E501 +from geoengine_openapi_client.models.get_capabilities_request import GetCapabilitiesRequest class TestGetCapabilitiesRequest(unittest.TestCase): """GetCapabilitiesRequest unit test stubs""" diff --git a/python/test/test_get_coverage_format.py b/python/test/test_get_coverage_format.py index 44623296..5b17b576 100644 --- a/python/test/test_get_coverage_format.py +++ b/python/test/test_get_coverage_format.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.get_coverage_format import GetCoverageFormat # noqa: E501 +from geoengine_openapi_client.models.get_coverage_format import GetCoverageFormat class TestGetCoverageFormat(unittest.TestCase): """GetCoverageFormat unit test stubs""" diff --git a/python/test/test_get_coverage_request.py b/python/test/test_get_coverage_request.py index 17b1c43e..bd8fd7de 100644 --- a/python/test/test_get_coverage_request.py +++ b/python/test/test_get_coverage_request.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.get_coverage_request import GetCoverageRequest # noqa: E501 +from geoengine_openapi_client.models.get_coverage_request import GetCoverageRequest class TestGetCoverageRequest(unittest.TestCase): """GetCoverageRequest unit test stubs""" diff --git a/python/test/test_get_feature_request.py b/python/test/test_get_feature_request.py index f29b55dd..0dbf2235 100644 --- a/python/test/test_get_feature_request.py +++ b/python/test/test_get_feature_request.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.get_feature_request import GetFeatureRequest # noqa: E501 +from geoengine_openapi_client.models.get_feature_request import GetFeatureRequest class TestGetFeatureRequest(unittest.TestCase): """GetFeatureRequest unit test stubs""" diff --git a/python/test/test_get_legend_graphic_request.py b/python/test/test_get_legend_graphic_request.py index a8b68f2b..658cc132 100644 --- a/python/test/test_get_legend_graphic_request.py +++ b/python/test/test_get_legend_graphic_request.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.get_legend_graphic_request import GetLegendGraphicRequest # noqa: E501 +from geoengine_openapi_client.models.get_legend_graphic_request import GetLegendGraphicRequest class TestGetLegendGraphicRequest(unittest.TestCase): """GetLegendGraphicRequest unit test stubs""" diff --git a/python/test/test_get_map_exception_format.py b/python/test/test_get_map_exception_format.py index f297f80d..1f7e58a5 100644 --- a/python/test/test_get_map_exception_format.py +++ b/python/test/test_get_map_exception_format.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.get_map_exception_format import GetMapExceptionFormat # noqa: E501 +from geoengine_openapi_client.models.get_map_exception_format import GetMapExceptionFormat class TestGetMapExceptionFormat(unittest.TestCase): """GetMapExceptionFormat unit test stubs""" diff --git a/python/test/test_get_map_format.py b/python/test/test_get_map_format.py index 3c28a242..fea9a1b8 100644 --- a/python/test/test_get_map_format.py +++ b/python/test/test_get_map_format.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.get_map_format import GetMapFormat # noqa: E501 +from geoengine_openapi_client.models.get_map_format import GetMapFormat class TestGetMapFormat(unittest.TestCase): """GetMapFormat unit test stubs""" diff --git a/python/test/test_get_map_request.py b/python/test/test_get_map_request.py index 1e16a2de..04b8c92c 100644 --- a/python/test/test_get_map_request.py +++ b/python/test/test_get_map_request.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.get_map_request import GetMapRequest # noqa: E501 +from geoengine_openapi_client.models.get_map_request import GetMapRequest class TestGetMapRequest(unittest.TestCase): """GetMapRequest unit test stubs""" diff --git a/python/test/test_inline_object.py b/python/test/test_inline_object.py new file mode 100644 index 00000000..f179dfd5 --- /dev/null +++ b/python/test/test_inline_object.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Geo Engine API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.8.0 + Contact: dev@geoengine.de + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geoengine_openapi_client.models.inline_object import InlineObject + +class TestInlineObject(unittest.TestCase): + """InlineObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InlineObject: + """Test InlineObject + include_optional 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 `InlineObject` + """ + model = InlineObject() + if include_optional: + return InlineObject( + url = '' + ) + else: + return InlineObject( + url = '', + ) + """ + + def testInlineObject(self): + """Test InlineObject""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_internal_data_id.py b/python/test/test_internal_data_id.py index 6e7a9523..e3b5ea5f 100644 --- a/python/test/test_internal_data_id.py +++ b/python/test/test_internal_data_id.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.internal_data_id import InternalDataId # noqa: E501 +from geoengine_openapi_client.models.internal_data_id import InternalDataId class TestInternalDataId(unittest.TestCase): """InternalDataId unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> InternalDataId: """Test InternalDataId - include_option is a boolean, when False only required + include_optional 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 `InternalDataId` """ - model = InternalDataId() # noqa: E501 + model = InternalDataId() if include_optional: return InternalDataId( dataset_id = '', diff --git a/python/test/test_layer.py b/python/test/test_layer.py index 09cffc93..1f64627b 100644 --- a/python/test/test_layer.py +++ b/python/test/test_layer.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.layer import Layer # noqa: E501 +from geoengine_openapi_client.models.layer import Layer class TestLayer(unittest.TestCase): """Layer unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Layer: """Test Layer - include_option is a boolean, when False only required + include_optional 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 `Layer` """ - model = Layer() # noqa: E501 + model = Layer() if include_optional: return Layer( description = '', diff --git a/python/test/test_layer_collection.py b/python/test/test_layer_collection.py index 58e531eb..d9f8a61b 100644 --- a/python/test/test_layer_collection.py +++ b/python/test/test_layer_collection.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.layer_collection import LayerCollection # noqa: E501 +from geoengine_openapi_client.models.layer_collection import LayerCollection class TestLayerCollection(unittest.TestCase): """LayerCollection unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> LayerCollection: """Test LayerCollection - include_option is a boolean, when False only required + include_optional 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 `LayerCollection` """ - model = LayerCollection() # noqa: E501 + model = LayerCollection() if include_optional: return LayerCollection( description = '', diff --git a/python/test/test_layer_collection_listing.py b/python/test/test_layer_collection_listing.py index f472b022..a44b30bb 100644 --- a/python/test/test_layer_collection_listing.py +++ b/python/test/test_layer_collection_listing.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.layer_collection_listing import LayerCollectionListing # noqa: E501 +from geoengine_openapi_client.models.layer_collection_listing import LayerCollectionListing class TestLayerCollectionListing(unittest.TestCase): """LayerCollectionListing unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> LayerCollectionListing: """Test LayerCollectionListing - include_option is a boolean, when False only required + include_optional 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 `LayerCollectionListing` """ - model = LayerCollectionListing() # noqa: E501 + model = LayerCollectionListing() if include_optional: return LayerCollectionListing( description = '', diff --git a/python/test/test_layer_collection_resource.py b/python/test/test_layer_collection_resource.py index d43b6567..57f66683 100644 --- a/python/test/test_layer_collection_resource.py +++ b/python/test/test_layer_collection_resource.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.layer_collection_resource import LayerCollectionResource # noqa: E501 +from geoengine_openapi_client.models.layer_collection_resource import LayerCollectionResource class TestLayerCollectionResource(unittest.TestCase): """LayerCollectionResource unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> LayerCollectionResource: """Test LayerCollectionResource - include_option is a boolean, when False only required + include_optional 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 `LayerCollectionResource` """ - model = LayerCollectionResource() # noqa: E501 + model = LayerCollectionResource() if include_optional: return LayerCollectionResource( id = '', diff --git a/python/test/test_layer_listing.py b/python/test/test_layer_listing.py index ac1b5d87..82625cd4 100644 --- a/python/test/test_layer_listing.py +++ b/python/test/test_layer_listing.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.layer_listing import LayerListing # noqa: E501 +from geoengine_openapi_client.models.layer_listing import LayerListing class TestLayerListing(unittest.TestCase): """LayerListing unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> LayerListing: """Test LayerListing - include_option is a boolean, when False only required + include_optional 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 `LayerListing` """ - model = LayerListing() # noqa: E501 + model = LayerListing() if include_optional: return LayerListing( description = '', diff --git a/python/test/test_layer_resource.py b/python/test/test_layer_resource.py index baa77d4d..ddc12cca 100644 --- a/python/test/test_layer_resource.py +++ b/python/test/test_layer_resource.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.layer_resource import LayerResource # noqa: E501 +from geoengine_openapi_client.models.layer_resource import LayerResource class TestLayerResource(unittest.TestCase): """LayerResource unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> LayerResource: """Test LayerResource - include_option is a boolean, when False only required + include_optional 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 `LayerResource` """ - model = LayerResource() # noqa: E501 + model = LayerResource() if include_optional: return LayerResource( id = '', diff --git a/python/test/test_layer_update.py b/python/test/test_layer_update.py index 64c1d5c9..c75d8a31 100644 --- a/python/test/test_layer_update.py +++ b/python/test/test_layer_update.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.layer_update import LayerUpdate # noqa: E501 +from geoengine_openapi_client.models.layer_update import LayerUpdate class TestLayerUpdate(unittest.TestCase): """LayerUpdate unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> LayerUpdate: """Test LayerUpdate - include_option is a boolean, when False only required + include_optional 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 `LayerUpdate` """ - model = LayerUpdate() # noqa: E501 + model = LayerUpdate() if include_optional: return LayerUpdate( name = '', diff --git a/python/test/test_layer_visibility.py b/python/test/test_layer_visibility.py index 1ad762c8..3aaef2dc 100644 --- a/python/test/test_layer_visibility.py +++ b/python/test/test_layer_visibility.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.layer_visibility import LayerVisibility # noqa: E501 +from geoengine_openapi_client.models.layer_visibility import LayerVisibility class TestLayerVisibility(unittest.TestCase): """LayerVisibility unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> LayerVisibility: """Test LayerVisibility - include_option is a boolean, when False only required + include_optional 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 `LayerVisibility` """ - model = LayerVisibility() # noqa: E501 + model = LayerVisibility() if include_optional: return LayerVisibility( data = True, diff --git a/python/test/test_layers_api.py b/python/test/test_layers_api.py index bdd3e6c1..56ed3cb4 100644 --- a/python/test/test_layers_api.py +++ b/python/test/test_layers_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.layers_api import LayersApi # noqa: E501 +from geoengine_openapi_client.api.layers_api import LayersApi class TestLayersApi(unittest.TestCase): """LayersApi unit test stubs""" def setUp(self) -> None: - self.api = LayersApi() # noqa: E501 + self.api = LayersApi() def tearDown(self) -> None: pass @@ -30,70 +30,70 @@ def tearDown(self) -> None: def test_add_collection(self) -> None: """Test case for add_collection - Add a new collection to an existing collection # noqa: E501 + Add a new collection to an existing collection """ pass def test_add_existing_collection_to_collection(self) -> None: """Test case for add_existing_collection_to_collection - Add an existing collection to a collection # noqa: E501 + Add an existing collection to a collection """ pass def test_add_existing_layer_to_collection(self) -> None: """Test case for add_existing_layer_to_collection - Add an existing layer to a collection # noqa: E501 + Add an existing layer to a collection """ pass def test_add_layer(self) -> None: """Test case for add_layer - Add a new layer to a collection # noqa: E501 + Add a new layer to a collection """ pass def test_autocomplete_handler(self) -> None: """Test case for autocomplete_handler - Autocompletes the search on the contents of the collection of the given provider # noqa: E501 + Autocompletes the search on the contents of the collection of the given provider """ pass def test_layer_handler(self) -> None: """Test case for layer_handler - Retrieves the layer of the given provider # noqa: E501 + Retrieves the layer of the given provider """ pass def test_layer_to_dataset(self) -> None: """Test case for layer_to_dataset - Persist a raster layer from a provider as a dataset. # noqa: E501 + Persist a raster layer from a provider as a dataset. """ pass def test_layer_to_workflow_id_handler(self) -> None: """Test case for layer_to_workflow_id_handler - Registers a layer from a provider as a workflow and returns the workflow id # noqa: E501 + Registers a layer from a provider as a workflow and returns the workflow id """ pass def test_list_collection_handler(self) -> None: """Test case for list_collection_handler - List the contents of the collection of the given provider # noqa: E501 + List the contents of the collection of the given provider """ pass def test_list_root_collections_handler(self) -> None: """Test case for list_root_collections_handler - List all layer collections # noqa: E501 + List all layer collections """ pass @@ -106,49 +106,49 @@ def test_provider_capabilities_handler(self) -> None: def test_remove_collection(self) -> None: """Test case for remove_collection - Remove a collection # noqa: E501 + Remove a collection """ pass def test_remove_collection_from_collection(self) -> None: """Test case for remove_collection_from_collection - Delete a collection from a collection # noqa: E501 + Delete a collection from a collection """ pass def test_remove_layer(self) -> None: """Test case for remove_layer - Remove a collection # noqa: E501 + Remove a collection """ pass def test_remove_layer_from_collection(self) -> None: """Test case for remove_layer_from_collection - Remove a layer from a collection # noqa: E501 + Remove a layer from a collection """ pass def test_search_handler(self) -> None: """Test case for search_handler - Searches the contents of the collection of the given provider # noqa: E501 + Searches the contents of the collection of the given provider """ pass def test_update_collection(self) -> None: """Test case for update_collection - Update a collection # noqa: E501 + Update a collection """ pass def test_update_layer(self) -> None: """Test case for update_layer - Update a layer # noqa: E501 + Update a layer """ pass diff --git a/python/test/test_line_symbology.py b/python/test/test_line_symbology.py index d1f44793..d1a0a826 100644 --- a/python/test/test_line_symbology.py +++ b/python/test/test_line_symbology.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.line_symbology import LineSymbology # noqa: E501 +from geoengine_openapi_client.models.line_symbology import LineSymbology class TestLineSymbology(unittest.TestCase): """LineSymbology unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> LineSymbology: """Test LineSymbology - include_option is a boolean, when False only required + include_optional 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 `LineSymbology` """ - model = LineSymbology() # noqa: E501 + model = LineSymbology() if include_optional: return LineSymbology( auto_simplified = True, diff --git a/python/test/test_linear_gradient.py b/python/test/test_linear_gradient.py index 1e5b8a1d..284fc245 100644 --- a/python/test/test_linear_gradient.py +++ b/python/test/test_linear_gradient.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.linear_gradient import LinearGradient # noqa: E501 +from geoengine_openapi_client.models.linear_gradient import LinearGradient class TestLinearGradient(unittest.TestCase): """LinearGradient unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> LinearGradient: """Test LinearGradient - include_option is a boolean, when False only required + include_optional 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 `LinearGradient` """ - model = LinearGradient() # noqa: E501 + model = LinearGradient() if include_optional: return LinearGradient( breakpoints = [ diff --git a/python/test/test_logarithmic_gradient.py b/python/test/test_logarithmic_gradient.py index 71b9c63b..27d9a17a 100644 --- a/python/test/test_logarithmic_gradient.py +++ b/python/test/test_logarithmic_gradient.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.logarithmic_gradient import LogarithmicGradient # noqa: E501 +from geoengine_openapi_client.models.logarithmic_gradient import LogarithmicGradient class TestLogarithmicGradient(unittest.TestCase): """LogarithmicGradient unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> LogarithmicGradient: """Test LogarithmicGradient - include_option is a boolean, when False only required + include_optional 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 `LogarithmicGradient` """ - model = LogarithmicGradient() # noqa: E501 + model = LogarithmicGradient() if include_optional: return LogarithmicGradient( breakpoints = [ diff --git a/python/test/test_measurement.py b/python/test/test_measurement.py index a9162b97..c2f2b36a 100644 --- a/python/test/test_measurement.py +++ b/python/test/test_measurement.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.measurement import Measurement # noqa: E501 +from geoengine_openapi_client.models.measurement import Measurement class TestMeasurement(unittest.TestCase): """Measurement unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Measurement: """Test Measurement - include_option is a boolean, when False only required + include_optional 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 `Measurement` """ - model = Measurement() # noqa: E501 + model = Measurement() if include_optional: return Measurement( type = 'unitless', diff --git a/python/test/test_meta_data_definition.py b/python/test/test_meta_data_definition.py index fa96ca0a..45ee9538 100644 --- a/python/test/test_meta_data_definition.py +++ b/python/test/test_meta_data_definition.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.meta_data_definition import MetaDataDefinition # noqa: E501 +from geoengine_openapi_client.models.meta_data_definition import MetaDataDefinition class TestMetaDataDefinition(unittest.TestCase): """MetaDataDefinition unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MetaDataDefinition: """Test MetaDataDefinition - include_option is a boolean, when False only required + include_optional 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 `MetaDataDefinition` """ - model = MetaDataDefinition() # noqa: E501 + model = MetaDataDefinition() if include_optional: return MetaDataDefinition( loading_info = geoengine_openapi_client.models.ogr_source_dataset.OgrSourceDataset( diff --git a/python/test/test_meta_data_suggestion.py b/python/test/test_meta_data_suggestion.py index b0069977..2e7dce2d 100644 --- a/python/test/test_meta_data_suggestion.py +++ b/python/test/test_meta_data_suggestion.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.meta_data_suggestion import MetaDataSuggestion # noqa: E501 +from geoengine_openapi_client.models.meta_data_suggestion import MetaDataSuggestion class TestMetaDataSuggestion(unittest.TestCase): """MetaDataSuggestion unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MetaDataSuggestion: """Test MetaDataSuggestion - include_option is a boolean, when False only required + include_optional 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 `MetaDataSuggestion` """ - model = MetaDataSuggestion() # noqa: E501 + model = MetaDataSuggestion() if include_optional: return MetaDataSuggestion( layer_name = '', diff --git a/python/test/test_ml_api.py b/python/test/test_ml_api.py index b8428ae7..d1c722e8 100644 --- a/python/test/test_ml_api.py +++ b/python/test/test_ml_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.ml_api import MLApi # noqa: E501 +from geoengine_openapi_client.api.ml_api import MLApi class TestMLApi(unittest.TestCase): """MLApi unit test stubs""" def setUp(self) -> None: - self.api = MLApi() # noqa: E501 + self.api = MLApi() def tearDown(self) -> None: pass @@ -30,21 +30,21 @@ def tearDown(self) -> None: def test_add_ml_model(self) -> None: """Test case for add_ml_model - Create a new ml model. # noqa: E501 + Create a new ml model. """ pass def test_get_ml_model(self) -> None: """Test case for get_ml_model - Get ml model by name. # noqa: E501 + Get ml model by name. """ pass def test_list_ml_models(self) -> None: """Test case for list_ml_models - List ml models. # noqa: E501 + List ml models. """ pass diff --git a/python/test/test_ml_model.py b/python/test/test_ml_model.py index d93cca15..aadc36d3 100644 --- a/python/test/test_ml_model.py +++ b/python/test/test_ml_model.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ml_model import MlModel # noqa: E501 +from geoengine_openapi_client.models.ml_model import MlModel class TestMlModel(unittest.TestCase): """MlModel unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MlModel: """Test MlModel - include_option is a boolean, when False only required + include_optional 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 `MlModel` """ - model = MlModel() # noqa: E501 + model = MlModel() if include_optional: return MlModel( description = '', diff --git a/python/test/test_ml_model_metadata.py b/python/test/test_ml_model_metadata.py index f118df2b..492e7f20 100644 --- a/python/test/test_ml_model_metadata.py +++ b/python/test/test_ml_model_metadata.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ml_model_metadata import MlModelMetadata # noqa: E501 +from geoengine_openapi_client.models.ml_model_metadata import MlModelMetadata class TestMlModelMetadata(unittest.TestCase): """MlModelMetadata unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MlModelMetadata: """Test MlModelMetadata - include_option is a boolean, when False only required + include_optional 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 `MlModelMetadata` """ - model = MlModelMetadata() # noqa: E501 + model = MlModelMetadata() if include_optional: return MlModelMetadata( file_name = '', diff --git a/python/test/test_ml_model_name_response.py b/python/test/test_ml_model_name_response.py index 967aa611..9876ede1 100644 --- a/python/test/test_ml_model_name_response.py +++ b/python/test/test_ml_model_name_response.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ml_model_name_response import MlModelNameResponse # noqa: E501 +from geoengine_openapi_client.models.ml_model_name_response import MlModelNameResponse class TestMlModelNameResponse(unittest.TestCase): """MlModelNameResponse unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MlModelNameResponse: """Test MlModelNameResponse - include_option is a boolean, when False only required + include_optional 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 `MlModelNameResponse` """ - model = MlModelNameResponse() # noqa: E501 + model = MlModelNameResponse() if include_optional: return MlModelNameResponse( ml_model_name = '' diff --git a/python/test/test_ml_model_resource.py b/python/test/test_ml_model_resource.py index 6ff90d5c..9eb71960 100644 --- a/python/test/test_ml_model_resource.py +++ b/python/test/test_ml_model_resource.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ml_model_resource import MlModelResource # noqa: E501 +from geoengine_openapi_client.models.ml_model_resource import MlModelResource class TestMlModelResource(unittest.TestCase): """MlModelResource unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MlModelResource: """Test MlModelResource - include_option is a boolean, when False only required + include_optional 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 `MlModelResource` """ - model = MlModelResource() # noqa: E501 + model = MlModelResource() if include_optional: return MlModelResource( id = '', diff --git a/python/test/test_mock_dataset_data_source_loading_info.py b/python/test/test_mock_dataset_data_source_loading_info.py index 6482c2c6..9b432667 100644 --- a/python/test/test_mock_dataset_data_source_loading_info.py +++ b/python/test/test_mock_dataset_data_source_loading_info.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.mock_dataset_data_source_loading_info import MockDatasetDataSourceLoadingInfo # noqa: E501 +from geoengine_openapi_client.models.mock_dataset_data_source_loading_info import MockDatasetDataSourceLoadingInfo class TestMockDatasetDataSourceLoadingInfo(unittest.TestCase): """MockDatasetDataSourceLoadingInfo unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MockDatasetDataSourceLoadingInfo: """Test MockDatasetDataSourceLoadingInfo - include_option is a boolean, when False only required + include_optional 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 `MockDatasetDataSourceLoadingInfo` """ - model = MockDatasetDataSourceLoadingInfo() # noqa: E501 + model = MockDatasetDataSourceLoadingInfo() if include_optional: return MockDatasetDataSourceLoadingInfo( points = [ diff --git a/python/test/test_mock_meta_data.py b/python/test/test_mock_meta_data.py index 13a61c98..3c761c90 100644 --- a/python/test/test_mock_meta_data.py +++ b/python/test/test_mock_meta_data.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.mock_meta_data import MockMetaData # noqa: E501 +from geoengine_openapi_client.models.mock_meta_data import MockMetaData class TestMockMetaData(unittest.TestCase): """MockMetaData unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MockMetaData: """Test MockMetaData - include_option is a boolean, when False only required + include_optional 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 `MockMetaData` """ - model = MockMetaData() # noqa: E501 + model = MockMetaData() if include_optional: return MockMetaData( loading_info = geoengine_openapi_client.models.mock_dataset_data_source_loading_info.MockDatasetDataSourceLoadingInfo( diff --git a/python/test/test_multi_band_raster_colorizer.py b/python/test/test_multi_band_raster_colorizer.py index 5d589978..0e44a6cd 100644 --- a/python/test/test_multi_band_raster_colorizer.py +++ b/python/test/test_multi_band_raster_colorizer.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.multi_band_raster_colorizer import MultiBandRasterColorizer # noqa: E501 +from geoengine_openapi_client.models.multi_band_raster_colorizer import MultiBandRasterColorizer class TestMultiBandRasterColorizer(unittest.TestCase): """MultiBandRasterColorizer unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MultiBandRasterColorizer: """Test MultiBandRasterColorizer - include_option is a boolean, when False only required + include_optional 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 `MultiBandRasterColorizer` """ - model = MultiBandRasterColorizer() # noqa: E501 + model = MultiBandRasterColorizer() if include_optional: return MultiBandRasterColorizer( blue_band = 0, diff --git a/python/test/test_multi_line_string.py b/python/test/test_multi_line_string.py index 1534c868..f0561181 100644 --- a/python/test/test_multi_line_string.py +++ b/python/test/test_multi_line_string.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.multi_line_string import MultiLineString # noqa: E501 +from geoengine_openapi_client.models.multi_line_string import MultiLineString class TestMultiLineString(unittest.TestCase): """MultiLineString unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MultiLineString: """Test MultiLineString - include_option is a boolean, when False only required + include_optional 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 `MultiLineString` """ - model = MultiLineString() # noqa: E501 + model = MultiLineString() if include_optional: return MultiLineString( coordinates = [ diff --git a/python/test/test_multi_point.py b/python/test/test_multi_point.py index cc6d7aae..a78f2c51 100644 --- a/python/test/test_multi_point.py +++ b/python/test/test_multi_point.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.multi_point import MultiPoint # noqa: E501 +from geoengine_openapi_client.models.multi_point import MultiPoint class TestMultiPoint(unittest.TestCase): """MultiPoint unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MultiPoint: """Test MultiPoint - include_option is a boolean, when False only required + include_optional 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 `MultiPoint` """ - model = MultiPoint() # noqa: E501 + model = MultiPoint() if include_optional: return MultiPoint( coordinates = [ diff --git a/python/test/test_multi_polygon.py b/python/test/test_multi_polygon.py index 93bc5481..c21f0b62 100644 --- a/python/test/test_multi_polygon.py +++ b/python/test/test_multi_polygon.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.multi_polygon import MultiPolygon # noqa: E501 +from geoengine_openapi_client.models.multi_polygon import MultiPolygon class TestMultiPolygon(unittest.TestCase): """MultiPolygon unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> MultiPolygon: """Test MultiPolygon - include_option is a boolean, when False only required + include_optional 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 `MultiPolygon` """ - model = MultiPolygon() # noqa: E501 + model = MultiPolygon() if include_optional: return MultiPolygon( polygons = [ diff --git a/python/test/test_number_param.py b/python/test/test_number_param.py index 84132201..bdb3d225 100644 --- a/python/test/test_number_param.py +++ b/python/test/test_number_param.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.number_param import NumberParam # noqa: E501 +from geoengine_openapi_client.models.number_param import NumberParam class TestNumberParam(unittest.TestCase): """NumberParam unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> NumberParam: """Test NumberParam - include_option is a boolean, when False only required + include_optional 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 `NumberParam` """ - model = NumberParam() # noqa: E501 + model = NumberParam() if include_optional: return NumberParam( type = 'static', diff --git a/python/test/test_ogcwcs_api.py b/python/test/test_ogcwcs_api.py index 6c2b5373..42e178ea 100644 --- a/python/test/test_ogcwcs_api.py +++ b/python/test/test_ogcwcs_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.ogcwcs_api import OGCWCSApi # noqa: E501 +from geoengine_openapi_client.api.ogcwcs_api import OGCWCSApi class TestOGCWCSApi(unittest.TestCase): """OGCWCSApi unit test stubs""" def setUp(self) -> None: - self.api = OGCWCSApi() # noqa: E501 + self.api = OGCWCSApi() def tearDown(self) -> None: pass @@ -30,21 +30,21 @@ def tearDown(self) -> None: def test_wcs_capabilities_handler(self) -> None: """Test case for wcs_capabilities_handler - Get WCS Capabilities # noqa: E501 + Get WCS Capabilities """ pass def test_wcs_describe_coverage_handler(self) -> None: """Test case for wcs_describe_coverage_handler - Get WCS Coverage Description # noqa: E501 + Get WCS Coverage Description """ pass def test_wcs_get_coverage_handler(self) -> None: """Test case for wcs_get_coverage_handler - Get WCS Coverage # noqa: E501 + Get WCS Coverage """ pass diff --git a/python/test/test_ogcwfs_api.py b/python/test/test_ogcwfs_api.py index f72c5dd8..49ecfc54 100644 --- a/python/test/test_ogcwfs_api.py +++ b/python/test/test_ogcwfs_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.ogcwfs_api import OGCWFSApi # noqa: E501 +from geoengine_openapi_client.api.ogcwfs_api import OGCWFSApi class TestOGCWFSApi(unittest.TestCase): """OGCWFSApi unit test stubs""" def setUp(self) -> None: - self.api = OGCWFSApi() # noqa: E501 + self.api = OGCWFSApi() def tearDown(self) -> None: pass @@ -30,14 +30,14 @@ def tearDown(self) -> None: def test_wfs_capabilities_handler(self) -> None: """Test case for wfs_capabilities_handler - Get WFS Capabilities # noqa: E501 + Get WFS Capabilities """ pass def test_wfs_feature_handler(self) -> None: """Test case for wfs_feature_handler - Get WCS Features # noqa: E501 + Get WCS Features """ pass diff --git a/python/test/test_ogcwms_api.py b/python/test/test_ogcwms_api.py index 02f8d606..787b92ba 100644 --- a/python/test/test_ogcwms_api.py +++ b/python/test/test_ogcwms_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.ogcwms_api import OGCWMSApi # noqa: E501 +from geoengine_openapi_client.api.ogcwms_api import OGCWMSApi class TestOGCWMSApi(unittest.TestCase): """OGCWMSApi unit test stubs""" def setUp(self) -> None: - self.api = OGCWMSApi() # noqa: E501 + self.api = OGCWMSApi() def tearDown(self) -> None: pass @@ -30,21 +30,21 @@ def tearDown(self) -> None: def test_wms_capabilities_handler(self) -> None: """Test case for wms_capabilities_handler - Get WMS Capabilities # noqa: E501 + Get WMS Capabilities """ pass def test_wms_legend_graphic_handler(self) -> None: """Test case for wms_legend_graphic_handler - Get WMS Legend Graphic # noqa: E501 + Get WMS Legend Graphic """ pass def test_wms_map_handler(self) -> None: """Test case for wms_map_handler - Get WMS Map # noqa: E501 + Get WMS Map """ pass diff --git a/python/test/test_ogr_meta_data.py b/python/test/test_ogr_meta_data.py index 49f6c33a..f35586b7 100644 --- a/python/test/test_ogr_meta_data.py +++ b/python/test/test_ogr_meta_data.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_meta_data import OgrMetaData # noqa: E501 +from geoengine_openapi_client.models.ogr_meta_data import OgrMetaData class TestOgrMetaData(unittest.TestCase): """OgrMetaData unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrMetaData: """Test OgrMetaData - include_option is a boolean, when False only required + include_optional 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 `OgrMetaData` """ - model = OgrMetaData() # noqa: E501 + model = OgrMetaData() if include_optional: return OgrMetaData( loading_info = geoengine_openapi_client.models.ogr_source_dataset.OgrSourceDataset( diff --git a/python/test/test_ogr_source_column_spec.py b/python/test/test_ogr_source_column_spec.py index 81e164eb..b9f0f1b7 100644 --- a/python/test/test_ogr_source_column_spec.py +++ b/python/test/test_ogr_source_column_spec.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_column_spec import OgrSourceColumnSpec # noqa: E501 +from geoengine_openapi_client.models.ogr_source_column_spec import OgrSourceColumnSpec class TestOgrSourceColumnSpec(unittest.TestCase): """OgrSourceColumnSpec unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceColumnSpec: """Test OgrSourceColumnSpec - include_option is a boolean, when False only required + include_optional 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 `OgrSourceColumnSpec` """ - model = OgrSourceColumnSpec() # noqa: E501 + model = OgrSourceColumnSpec() if include_optional: return OgrSourceColumnSpec( bool = [ @@ -43,7 +42,7 @@ def make_instance(self, include_optional) -> OgrSourceColumnSpec: datetime = [ '' ], - float = [ + var_float = [ '' ], format_specifics = None, diff --git a/python/test/test_ogr_source_dataset.py b/python/test/test_ogr_source_dataset.py index f4c66e98..4eefdcb5 100644 --- a/python/test/test_ogr_source_dataset.py +++ b/python/test/test_ogr_source_dataset.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_dataset import OgrSourceDataset # noqa: E501 +from geoengine_openapi_client.models.ogr_source_dataset import OgrSourceDataset class TestOgrSourceDataset(unittest.TestCase): """OgrSourceDataset unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceDataset: """Test OgrSourceDataset - include_option is a boolean, when False only required + include_optional 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 `OgrSourceDataset` """ - model = OgrSourceDataset() # noqa: E501 + model = OgrSourceDataset() if include_optional: return OgrSourceDataset( attribute_query = '', diff --git a/python/test/test_ogr_source_dataset_time_type.py b/python/test/test_ogr_source_dataset_time_type.py index 148c91e8..d1039b08 100644 --- a/python/test/test_ogr_source_dataset_time_type.py +++ b/python/test/test_ogr_source_dataset_time_type.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_dataset_time_type import OgrSourceDatasetTimeType # noqa: E501 +from geoengine_openapi_client.models.ogr_source_dataset_time_type import OgrSourceDatasetTimeType class TestOgrSourceDatasetTimeType(unittest.TestCase): """OgrSourceDatasetTimeType unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceDatasetTimeType: """Test OgrSourceDatasetTimeType - include_option is a boolean, when False only required + include_optional 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 `OgrSourceDatasetTimeType` """ - model = OgrSourceDatasetTimeType() # noqa: E501 + model = OgrSourceDatasetTimeType() if include_optional: return OgrSourceDatasetTimeType( type = 'none', diff --git a/python/test/test_ogr_source_dataset_time_type_none.py b/python/test/test_ogr_source_dataset_time_type_none.py index 1ee8db63..34c5a92c 100644 --- a/python/test/test_ogr_source_dataset_time_type_none.py +++ b/python/test/test_ogr_source_dataset_time_type_none.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_dataset_time_type_none import OgrSourceDatasetTimeTypeNone # noqa: E501 +from geoengine_openapi_client.models.ogr_source_dataset_time_type_none import OgrSourceDatasetTimeTypeNone class TestOgrSourceDatasetTimeTypeNone(unittest.TestCase): """OgrSourceDatasetTimeTypeNone unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceDatasetTimeTypeNone: """Test OgrSourceDatasetTimeTypeNone - include_option is a boolean, when False only required + include_optional 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 `OgrSourceDatasetTimeTypeNone` """ - model = OgrSourceDatasetTimeTypeNone() # noqa: E501 + model = OgrSourceDatasetTimeTypeNone() if include_optional: return OgrSourceDatasetTimeTypeNone( type = 'none' diff --git a/python/test/test_ogr_source_dataset_time_type_start.py b/python/test/test_ogr_source_dataset_time_type_start.py index 9aa84cfa..06605fb7 100644 --- a/python/test/test_ogr_source_dataset_time_type_start.py +++ b/python/test/test_ogr_source_dataset_time_type_start.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_dataset_time_type_start import OgrSourceDatasetTimeTypeStart # noqa: E501 +from geoengine_openapi_client.models.ogr_source_dataset_time_type_start import OgrSourceDatasetTimeTypeStart class TestOgrSourceDatasetTimeTypeStart(unittest.TestCase): """OgrSourceDatasetTimeTypeStart unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceDatasetTimeTypeStart: """Test OgrSourceDatasetTimeTypeStart - include_option is a boolean, when False only required + include_optional 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 `OgrSourceDatasetTimeTypeStart` """ - model = OgrSourceDatasetTimeTypeStart() # noqa: E501 + model = OgrSourceDatasetTimeTypeStart() if include_optional: return OgrSourceDatasetTimeTypeStart( duration = None, diff --git a/python/test/test_ogr_source_dataset_time_type_start_duration.py b/python/test/test_ogr_source_dataset_time_type_start_duration.py index 8234fd22..dad7ac48 100644 --- a/python/test/test_ogr_source_dataset_time_type_start_duration.py +++ b/python/test/test_ogr_source_dataset_time_type_start_duration.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_dataset_time_type_start_duration import OgrSourceDatasetTimeTypeStartDuration # noqa: E501 +from geoengine_openapi_client.models.ogr_source_dataset_time_type_start_duration import OgrSourceDatasetTimeTypeStartDuration class TestOgrSourceDatasetTimeTypeStartDuration(unittest.TestCase): """OgrSourceDatasetTimeTypeStartDuration unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceDatasetTimeTypeStartDuration: """Test OgrSourceDatasetTimeTypeStartDuration - include_option is a boolean, when False only required + include_optional 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 `OgrSourceDatasetTimeTypeStartDuration` """ - model = OgrSourceDatasetTimeTypeStartDuration() # noqa: E501 + model = OgrSourceDatasetTimeTypeStartDuration() if include_optional: return OgrSourceDatasetTimeTypeStartDuration( duration_field = '', diff --git a/python/test/test_ogr_source_dataset_time_type_start_end.py b/python/test/test_ogr_source_dataset_time_type_start_end.py index 1176dffe..53af1094 100644 --- a/python/test/test_ogr_source_dataset_time_type_start_end.py +++ b/python/test/test_ogr_source_dataset_time_type_start_end.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_dataset_time_type_start_end import OgrSourceDatasetTimeTypeStartEnd # noqa: E501 +from geoengine_openapi_client.models.ogr_source_dataset_time_type_start_end import OgrSourceDatasetTimeTypeStartEnd class TestOgrSourceDatasetTimeTypeStartEnd(unittest.TestCase): """OgrSourceDatasetTimeTypeStartEnd unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceDatasetTimeTypeStartEnd: """Test OgrSourceDatasetTimeTypeStartEnd - include_option is a boolean, when False only required + include_optional 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 `OgrSourceDatasetTimeTypeStartEnd` """ - model = OgrSourceDatasetTimeTypeStartEnd() # noqa: E501 + model = OgrSourceDatasetTimeTypeStartEnd() if include_optional: return OgrSourceDatasetTimeTypeStartEnd( end_field = '', diff --git a/python/test/test_ogr_source_duration_spec.py b/python/test/test_ogr_source_duration_spec.py index 800a2112..575e691d 100644 --- a/python/test/test_ogr_source_duration_spec.py +++ b/python/test/test_ogr_source_duration_spec.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_duration_spec import OgrSourceDurationSpec # noqa: E501 +from geoengine_openapi_client.models.ogr_source_duration_spec import OgrSourceDurationSpec class TestOgrSourceDurationSpec(unittest.TestCase): """OgrSourceDurationSpec unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceDurationSpec: """Test OgrSourceDurationSpec - include_option is a boolean, when False only required + include_optional 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 `OgrSourceDurationSpec` """ - model = OgrSourceDurationSpec() # noqa: E501 + model = OgrSourceDurationSpec() if include_optional: return OgrSourceDurationSpec( type = 'infinite', diff --git a/python/test/test_ogr_source_duration_spec_infinite.py b/python/test/test_ogr_source_duration_spec_infinite.py index 53424f69..803c5c57 100644 --- a/python/test/test_ogr_source_duration_spec_infinite.py +++ b/python/test/test_ogr_source_duration_spec_infinite.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_duration_spec_infinite import OgrSourceDurationSpecInfinite # noqa: E501 +from geoengine_openapi_client.models.ogr_source_duration_spec_infinite import OgrSourceDurationSpecInfinite class TestOgrSourceDurationSpecInfinite(unittest.TestCase): """OgrSourceDurationSpecInfinite unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceDurationSpecInfinite: """Test OgrSourceDurationSpecInfinite - include_option is a boolean, when False only required + include_optional 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 `OgrSourceDurationSpecInfinite` """ - model = OgrSourceDurationSpecInfinite() # noqa: E501 + model = OgrSourceDurationSpecInfinite() if include_optional: return OgrSourceDurationSpecInfinite( type = 'infinite' diff --git a/python/test/test_ogr_source_duration_spec_value.py b/python/test/test_ogr_source_duration_spec_value.py index d91d7b57..eafd13b3 100644 --- a/python/test/test_ogr_source_duration_spec_value.py +++ b/python/test/test_ogr_source_duration_spec_value.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_duration_spec_value import OgrSourceDurationSpecValue # noqa: E501 +from geoengine_openapi_client.models.ogr_source_duration_spec_value import OgrSourceDurationSpecValue class TestOgrSourceDurationSpecValue(unittest.TestCase): """OgrSourceDurationSpecValue unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceDurationSpecValue: """Test OgrSourceDurationSpecValue - include_option is a boolean, when False only required + include_optional 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 `OgrSourceDurationSpecValue` """ - model = OgrSourceDurationSpecValue() # noqa: E501 + model = OgrSourceDurationSpecValue() if include_optional: return OgrSourceDurationSpecValue( granularity = 'millis', diff --git a/python/test/test_ogr_source_duration_spec_zero.py b/python/test/test_ogr_source_duration_spec_zero.py index 750bb6de..55ca109d 100644 --- a/python/test/test_ogr_source_duration_spec_zero.py +++ b/python/test/test_ogr_source_duration_spec_zero.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_duration_spec_zero import OgrSourceDurationSpecZero # noqa: E501 +from geoengine_openapi_client.models.ogr_source_duration_spec_zero import OgrSourceDurationSpecZero class TestOgrSourceDurationSpecZero(unittest.TestCase): """OgrSourceDurationSpecZero unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceDurationSpecZero: """Test OgrSourceDurationSpecZero - include_option is a boolean, when False only required + include_optional 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 `OgrSourceDurationSpecZero` """ - model = OgrSourceDurationSpecZero() # noqa: E501 + model = OgrSourceDurationSpecZero() if include_optional: return OgrSourceDurationSpecZero( type = 'zero' diff --git a/python/test/test_ogr_source_error_spec.py b/python/test/test_ogr_source_error_spec.py index 936db630..b4850f63 100644 --- a/python/test/test_ogr_source_error_spec.py +++ b/python/test/test_ogr_source_error_spec.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_error_spec import OgrSourceErrorSpec # noqa: E501 +from geoengine_openapi_client.models.ogr_source_error_spec import OgrSourceErrorSpec class TestOgrSourceErrorSpec(unittest.TestCase): """OgrSourceErrorSpec unit test stubs""" diff --git a/python/test/test_ogr_source_time_format.py b/python/test/test_ogr_source_time_format.py index 4494d4fb..3d7e635b 100644 --- a/python/test/test_ogr_source_time_format.py +++ b/python/test/test_ogr_source_time_format.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_time_format import OgrSourceTimeFormat # noqa: E501 +from geoengine_openapi_client.models.ogr_source_time_format import OgrSourceTimeFormat class TestOgrSourceTimeFormat(unittest.TestCase): """OgrSourceTimeFormat unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceTimeFormat: """Test OgrSourceTimeFormat - include_option is a boolean, when False only required + include_optional 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 `OgrSourceTimeFormat` """ - model = OgrSourceTimeFormat() # noqa: E501 + model = OgrSourceTimeFormat() if include_optional: return OgrSourceTimeFormat( custom_format = '', diff --git a/python/test/test_ogr_source_time_format_auto.py b/python/test/test_ogr_source_time_format_auto.py index b99a1355..a88e37ad 100644 --- a/python/test/test_ogr_source_time_format_auto.py +++ b/python/test/test_ogr_source_time_format_auto.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_time_format_auto import OgrSourceTimeFormatAuto # noqa: E501 +from geoengine_openapi_client.models.ogr_source_time_format_auto import OgrSourceTimeFormatAuto class TestOgrSourceTimeFormatAuto(unittest.TestCase): """OgrSourceTimeFormatAuto unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceTimeFormatAuto: """Test OgrSourceTimeFormatAuto - include_option is a boolean, when False only required + include_optional 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 `OgrSourceTimeFormatAuto` """ - model = OgrSourceTimeFormatAuto() # noqa: E501 + model = OgrSourceTimeFormatAuto() if include_optional: return OgrSourceTimeFormatAuto( format = 'auto' diff --git a/python/test/test_ogr_source_time_format_custom.py b/python/test/test_ogr_source_time_format_custom.py index b7620bb7..7bdfc5ad 100644 --- a/python/test/test_ogr_source_time_format_custom.py +++ b/python/test/test_ogr_source_time_format_custom.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_time_format_custom import OgrSourceTimeFormatCustom # noqa: E501 +from geoengine_openapi_client.models.ogr_source_time_format_custom import OgrSourceTimeFormatCustom class TestOgrSourceTimeFormatCustom(unittest.TestCase): """OgrSourceTimeFormatCustom unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceTimeFormatCustom: """Test OgrSourceTimeFormatCustom - include_option is a boolean, when False only required + include_optional 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 `OgrSourceTimeFormatCustom` """ - model = OgrSourceTimeFormatCustom() # noqa: E501 + model = OgrSourceTimeFormatCustom() if include_optional: return OgrSourceTimeFormatCustom( custom_format = '', diff --git a/python/test/test_ogr_source_time_format_unix_time_stamp.py b/python/test/test_ogr_source_time_format_unix_time_stamp.py index 6796fd77..60dc720e 100644 --- a/python/test/test_ogr_source_time_format_unix_time_stamp.py +++ b/python/test/test_ogr_source_time_format_unix_time_stamp.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.ogr_source_time_format_unix_time_stamp import OgrSourceTimeFormatUnixTimeStamp # noqa: E501 +from geoengine_openapi_client.models.ogr_source_time_format_unix_time_stamp import OgrSourceTimeFormatUnixTimeStamp class TestOgrSourceTimeFormatUnixTimeStamp(unittest.TestCase): """OgrSourceTimeFormatUnixTimeStamp unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OgrSourceTimeFormatUnixTimeStamp: """Test OgrSourceTimeFormatUnixTimeStamp - include_option is a boolean, when False only required + include_optional 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 `OgrSourceTimeFormatUnixTimeStamp` """ - model = OgrSourceTimeFormatUnixTimeStamp() # noqa: E501 + model = OgrSourceTimeFormatUnixTimeStamp() if include_optional: return OgrSourceTimeFormatUnixTimeStamp( format = 'unixTimeStamp', diff --git a/python/test/test_operator_quota.py b/python/test/test_operator_quota.py index 6cbf2de9..b73e74c9 100644 --- a/python/test/test_operator_quota.py +++ b/python/test/test_operator_quota.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.operator_quota import OperatorQuota # noqa: E501 +from geoengine_openapi_client.models.operator_quota import OperatorQuota class TestOperatorQuota(unittest.TestCase): """OperatorQuota unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> OperatorQuota: """Test OperatorQuota - include_option is a boolean, when False only required + include_optional 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 `OperatorQuota` """ - model = OperatorQuota() # noqa: E501 + model = OperatorQuota() if include_optional: return OperatorQuota( count = 0, diff --git a/python/test/test_order_by.py b/python/test/test_order_by.py index 692f668a..79dd079d 100644 --- a/python/test/test_order_by.py +++ b/python/test/test_order_by.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.order_by import OrderBy # noqa: E501 +from geoengine_openapi_client.models.order_by import OrderBy class TestOrderBy(unittest.TestCase): """OrderBy unit test stubs""" diff --git a/python/test/test_palette_colorizer.py b/python/test/test_palette_colorizer.py index 88790f13..82d79002 100644 --- a/python/test/test_palette_colorizer.py +++ b/python/test/test_palette_colorizer.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.palette_colorizer import PaletteColorizer # noqa: E501 +from geoengine_openapi_client.models.palette_colorizer import PaletteColorizer class TestPaletteColorizer(unittest.TestCase): """PaletteColorizer unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> PaletteColorizer: """Test PaletteColorizer - include_option is a boolean, when False only required + include_optional 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 `PaletteColorizer` """ - model = PaletteColorizer() # noqa: E501 + model = PaletteColorizer() if include_optional: return PaletteColorizer( colors = { diff --git a/python/test/test_permission.py b/python/test/test_permission.py index c43def16..d940e796 100644 --- a/python/test/test_permission.py +++ b/python/test/test_permission.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.permission import Permission # noqa: E501 +from geoengine_openapi_client.models.permission import Permission class TestPermission(unittest.TestCase): """Permission unit test stubs""" diff --git a/python/test/test_permission_list_options.py b/python/test/test_permission_list_options.py index 2ab29119..72cf54b6 100644 --- a/python/test/test_permission_list_options.py +++ b/python/test/test_permission_list_options.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.permission_list_options import PermissionListOptions # noqa: E501 +from geoengine_openapi_client.models.permission_list_options import PermissionListOptions class TestPermissionListOptions(unittest.TestCase): """PermissionListOptions unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> PermissionListOptions: """Test PermissionListOptions - include_option is a boolean, when False only required + include_optional 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 `PermissionListOptions` """ - model = PermissionListOptions() # noqa: E501 + model = PermissionListOptions() if include_optional: return PermissionListOptions( limit = 0, diff --git a/python/test/test_permission_listing.py b/python/test/test_permission_listing.py index 2ee16fd0..5ff41d18 100644 --- a/python/test/test_permission_listing.py +++ b/python/test/test_permission_listing.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.permission_listing import PermissionListing # noqa: E501 +from geoengine_openapi_client.models.permission_listing import PermissionListing class TestPermissionListing(unittest.TestCase): """PermissionListing unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> PermissionListing: """Test PermissionListing - include_option is a boolean, when False only required + include_optional 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 `PermissionListing` """ - model = PermissionListing() # noqa: E501 + model = PermissionListing() if include_optional: return PermissionListing( permission = 'Read', diff --git a/python/test/test_permission_request.py b/python/test/test_permission_request.py index d3eeaa35..951c299d 100644 --- a/python/test/test_permission_request.py +++ b/python/test/test_permission_request.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.permission_request import PermissionRequest # noqa: E501 +from geoengine_openapi_client.models.permission_request import PermissionRequest class TestPermissionRequest(unittest.TestCase): """PermissionRequest unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> PermissionRequest: """Test PermissionRequest - include_option is a boolean, when False only required + include_optional 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 `PermissionRequest` """ - model = PermissionRequest() # noqa: E501 + model = PermissionRequest() if include_optional: return PermissionRequest( permission = 'Read', diff --git a/python/test/test_permissions_api.py b/python/test/test_permissions_api.py index 3beaf07e..db811c97 100644 --- a/python/test/test_permissions_api.py +++ b/python/test/test_permissions_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.permissions_api import PermissionsApi # noqa: E501 +from geoengine_openapi_client.api.permissions_api import PermissionsApi class TestPermissionsApi(unittest.TestCase): """PermissionsApi unit test stubs""" def setUp(self) -> None: - self.api = PermissionsApi() # noqa: E501 + self.api = PermissionsApi() def tearDown(self) -> None: pass @@ -30,21 +30,21 @@ def tearDown(self) -> None: def test_add_permission_handler(self) -> None: """Test case for add_permission_handler - Adds a new permission. # noqa: E501 + Adds a new permission. """ pass def test_get_resource_permissions_handler(self) -> None: """Test case for get_resource_permissions_handler - Lists permission for a given resource. # noqa: E501 + Lists permission for a given resource. """ pass def test_remove_permission_handler(self) -> None: """Test case for remove_permission_handler - Removes an existing permission. # noqa: E501 + Removes an existing permission. """ pass diff --git a/python/test/test_plot.py b/python/test/test_plot.py index 49270606..9ced7aa1 100644 --- a/python/test/test_plot.py +++ b/python/test/test_plot.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.plot import Plot # noqa: E501 +from geoengine_openapi_client.models.plot import Plot class TestPlot(unittest.TestCase): """Plot unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Plot: """Test Plot - include_option is a boolean, when False only required + include_optional 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 `Plot` """ - model = Plot() # noqa: E501 + model = Plot() if include_optional: return Plot( name = '', diff --git a/python/test/test_plot_output_format.py b/python/test/test_plot_output_format.py index a7ddc5ec..6fd579ef 100644 --- a/python/test/test_plot_output_format.py +++ b/python/test/test_plot_output_format.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.plot_output_format import PlotOutputFormat # noqa: E501 +from geoengine_openapi_client.models.plot_output_format import PlotOutputFormat class TestPlotOutputFormat(unittest.TestCase): """PlotOutputFormat unit test stubs""" diff --git a/python/test/test_plot_query_rectangle.py b/python/test/test_plot_query_rectangle.py index c984e842..a29de7ce 100644 --- a/python/test/test_plot_query_rectangle.py +++ b/python/test/test_plot_query_rectangle.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.plot_query_rectangle import PlotQueryRectangle # noqa: E501 +from geoengine_openapi_client.models.plot_query_rectangle import PlotQueryRectangle class TestPlotQueryRectangle(unittest.TestCase): """PlotQueryRectangle unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> PlotQueryRectangle: """Test PlotQueryRectangle - include_option is a boolean, when False only required + include_optional 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 `PlotQueryRectangle` """ - model = PlotQueryRectangle() # noqa: E501 + model = PlotQueryRectangle() if include_optional: return PlotQueryRectangle( spatial_bounds = geoengine_openapi_client.models.bounding_box2_d.BoundingBox2D( diff --git a/python/test/test_plot_result_descriptor.py b/python/test/test_plot_result_descriptor.py index 8c9d5469..4f84be94 100644 --- a/python/test/test_plot_result_descriptor.py +++ b/python/test/test_plot_result_descriptor.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.plot_result_descriptor import PlotResultDescriptor # noqa: E501 +from geoengine_openapi_client.models.plot_result_descriptor import PlotResultDescriptor class TestPlotResultDescriptor(unittest.TestCase): """PlotResultDescriptor unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> PlotResultDescriptor: """Test PlotResultDescriptor - include_option is a boolean, when False only required + include_optional 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 `PlotResultDescriptor` """ - model = PlotResultDescriptor() # noqa: E501 + model = PlotResultDescriptor() if include_optional: return PlotResultDescriptor( bbox = geoengine_openapi_client.models.bounding_box2_d.BoundingBox2D( diff --git a/python/test/test_plot_update.py b/python/test/test_plot_update.py index 28cb70dd..a1766c56 100644 --- a/python/test/test_plot_update.py +++ b/python/test/test_plot_update.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.plot_update import PlotUpdate # noqa: E501 +from geoengine_openapi_client.models.plot_update import PlotUpdate class TestPlotUpdate(unittest.TestCase): """PlotUpdate unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> PlotUpdate: """Test PlotUpdate - include_option is a boolean, when False only required + include_optional 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 `PlotUpdate` """ - model = PlotUpdate() # noqa: E501 + model = PlotUpdate() if include_optional: return PlotUpdate( name = '', diff --git a/python/test/test_plots_api.py b/python/test/test_plots_api.py index 801ae52d..988275b4 100644 --- a/python/test/test_plots_api.py +++ b/python/test/test_plots_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.plots_api import PlotsApi # noqa: E501 +from geoengine_openapi_client.api.plots_api import PlotsApi class TestPlotsApi(unittest.TestCase): """PlotsApi unit test stubs""" def setUp(self) -> None: - self.api = PlotsApi() # noqa: E501 + self.api = PlotsApi() def tearDown(self) -> None: pass @@ -30,7 +30,7 @@ def tearDown(self) -> None: def test_get_plot_handler(self) -> None: """Test case for get_plot_handler - Generates a plot. # noqa: E501 + Generates a plot. """ pass diff --git a/python/test/test_point_symbology.py b/python/test/test_point_symbology.py index 4c4c423a..14c13fe3 100644 --- a/python/test/test_point_symbology.py +++ b/python/test/test_point_symbology.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.point_symbology import PointSymbology # noqa: E501 +from geoengine_openapi_client.models.point_symbology import PointSymbology class TestPointSymbology(unittest.TestCase): """PointSymbology unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> PointSymbology: """Test PointSymbology - include_option is a boolean, when False only required + include_optional 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 `PointSymbology` """ - model = PointSymbology() # noqa: E501 + model = PointSymbology() if include_optional: return PointSymbology( fill_color = None, diff --git a/python/test/test_polygon_symbology.py b/python/test/test_polygon_symbology.py index 75d8dcdc..4c90416d 100644 --- a/python/test/test_polygon_symbology.py +++ b/python/test/test_polygon_symbology.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.polygon_symbology import PolygonSymbology # noqa: E501 +from geoengine_openapi_client.models.polygon_symbology import PolygonSymbology class TestPolygonSymbology(unittest.TestCase): """PolygonSymbology unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> PolygonSymbology: """Test PolygonSymbology - include_option is a boolean, when False only required + include_optional 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 `PolygonSymbology` """ - model = PolygonSymbology() # noqa: E501 + model = PolygonSymbology() if include_optional: return PolygonSymbology( auto_simplified = True, diff --git a/python/test/test_project.py b/python/test/test_project.py index 79946e26..7faefba2 100644 --- a/python/test/test_project.py +++ b/python/test/test_project.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.project import Project # noqa: E501 +from geoengine_openapi_client.models.project import Project class TestProject(unittest.TestCase): """Project unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Project: """Test Project - include_option is a boolean, when False only required + include_optional 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 `Project` """ - model = Project() # noqa: E501 + model = Project() if include_optional: return Project( bounds = geoengine_openapi_client.models.st_rectangle.STRectangle( diff --git a/python/test/test_project_layer.py b/python/test/test_project_layer.py index 37fe9a17..12dd5d59 100644 --- a/python/test/test_project_layer.py +++ b/python/test/test_project_layer.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.project_layer import ProjectLayer # noqa: E501 +from geoengine_openapi_client.models.project_layer import ProjectLayer class TestProjectLayer(unittest.TestCase): """ProjectLayer unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ProjectLayer: """Test ProjectLayer - include_option is a boolean, when False only required + include_optional 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 `ProjectLayer` """ - model = ProjectLayer() # noqa: E501 + model = ProjectLayer() if include_optional: return ProjectLayer( name = '', diff --git a/python/test/test_project_listing.py b/python/test/test_project_listing.py index f727143f..acc99244 100644 --- a/python/test/test_project_listing.py +++ b/python/test/test_project_listing.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.project_listing import ProjectListing # noqa: E501 +from geoengine_openapi_client.models.project_listing import ProjectListing class TestProjectListing(unittest.TestCase): """ProjectListing unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ProjectListing: """Test ProjectListing - include_option is a boolean, when False only required + include_optional 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 `ProjectListing` """ - model = ProjectListing() # noqa: E501 + model = ProjectListing() if include_optional: return ProjectListing( changed = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), diff --git a/python/test/test_project_resource.py b/python/test/test_project_resource.py index 7ba319b1..d854c337 100644 --- a/python/test/test_project_resource.py +++ b/python/test/test_project_resource.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.project_resource import ProjectResource # noqa: E501 +from geoengine_openapi_client.models.project_resource import ProjectResource class TestProjectResource(unittest.TestCase): """ProjectResource unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ProjectResource: """Test ProjectResource - include_option is a boolean, when False only required + include_optional 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 `ProjectResource` """ - model = ProjectResource() # noqa: E501 + model = ProjectResource() if include_optional: return ProjectResource( id = '', diff --git a/python/test/test_project_update_token.py b/python/test/test_project_update_token.py index 3804f8f4..b4beb713 100644 --- a/python/test/test_project_update_token.py +++ b/python/test/test_project_update_token.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.project_update_token import ProjectUpdateToken # noqa: E501 +from geoengine_openapi_client.models.project_update_token import ProjectUpdateToken class TestProjectUpdateToken(unittest.TestCase): """ProjectUpdateToken unit test stubs""" diff --git a/python/test/test_project_version.py b/python/test/test_project_version.py index 3b73d581..716b702f 100644 --- a/python/test/test_project_version.py +++ b/python/test/test_project_version.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.project_version import ProjectVersion # noqa: E501 +from geoengine_openapi_client.models.project_version import ProjectVersion class TestProjectVersion(unittest.TestCase): """ProjectVersion unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ProjectVersion: """Test ProjectVersion - include_option is a boolean, when False only required + include_optional 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 `ProjectVersion` """ - model = ProjectVersion() # noqa: E501 + model = ProjectVersion() if include_optional: return ProjectVersion( changed = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), diff --git a/python/test/test_projects_api.py b/python/test/test_projects_api.py index edd9f7dd..afb9bacd 100644 --- a/python/test/test_projects_api.py +++ b/python/test/test_projects_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.projects_api import ProjectsApi # noqa: E501 +from geoengine_openapi_client.api.projects_api import ProjectsApi class TestProjectsApi(unittest.TestCase): """ProjectsApi unit test stubs""" def setUp(self) -> None: - self.api = ProjectsApi() # noqa: E501 + self.api = ProjectsApi() def tearDown(self) -> None: pass @@ -30,49 +30,49 @@ def tearDown(self) -> None: def test_create_project_handler(self) -> None: """Test case for create_project_handler - Create a new project for the user. # noqa: E501 + Create a new project for the user. """ pass def test_delete_project_handler(self) -> None: """Test case for delete_project_handler - Deletes a project. # noqa: E501 + Deletes a project. """ pass def test_list_projects_handler(self) -> None: """Test case for list_projects_handler - List all projects accessible to the user that match the selected criteria. # noqa: E501 + List all projects accessible to the user that match the selected criteria. """ pass def test_load_project_latest_handler(self) -> None: """Test case for load_project_latest_handler - Retrieves details about the latest version of a project. # noqa: E501 + Retrieves details about the latest version of a project. """ pass def test_load_project_version_handler(self) -> None: """Test case for load_project_version_handler - Retrieves details about the given version of a project. # noqa: E501 + Retrieves details about the given version of a project. """ pass def test_project_versions_handler(self) -> None: """Test case for project_versions_handler - Lists all available versions of a project. # noqa: E501 + Lists all available versions of a project. """ pass def test_update_project_handler(self) -> None: """Test case for update_project_handler - Updates a project. # noqa: E501 + Updates a project. """ pass diff --git a/python/test/test_provenance.py b/python/test/test_provenance.py index 5e8d3404..17ae6b29 100644 --- a/python/test/test_provenance.py +++ b/python/test/test_provenance.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.provenance import Provenance # noqa: E501 +from geoengine_openapi_client.models.provenance import Provenance class TestProvenance(unittest.TestCase): """Provenance unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Provenance: """Test Provenance - include_option is a boolean, when False only required + include_optional 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 `Provenance` """ - model = Provenance() # noqa: E501 + model = Provenance() if include_optional: return Provenance( citation = '', diff --git a/python/test/test_provenance_entry.py b/python/test/test_provenance_entry.py index f29a33fa..c70cd847 100644 --- a/python/test/test_provenance_entry.py +++ b/python/test/test_provenance_entry.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.provenance_entry import ProvenanceEntry # noqa: E501 +from geoengine_openapi_client.models.provenance_entry import ProvenanceEntry class TestProvenanceEntry(unittest.TestCase): """ProvenanceEntry unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ProvenanceEntry: """Test ProvenanceEntry - include_option is a boolean, when False only required + include_optional 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 `ProvenanceEntry` """ - model = ProvenanceEntry() # noqa: E501 + model = ProvenanceEntry() if include_optional: return ProvenanceEntry( data = [ diff --git a/python/test/test_provenance_output.py b/python/test/test_provenance_output.py index 8f86ac71..01ec5062 100644 --- a/python/test/test_provenance_output.py +++ b/python/test/test_provenance_output.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.provenance_output import ProvenanceOutput # noqa: E501 +from geoengine_openapi_client.models.provenance_output import ProvenanceOutput class TestProvenanceOutput(unittest.TestCase): """ProvenanceOutput unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ProvenanceOutput: """Test ProvenanceOutput - include_option is a boolean, when False only required + include_optional 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 `ProvenanceOutput` """ - model = ProvenanceOutput() # noqa: E501 + model = ProvenanceOutput() if include_optional: return ProvenanceOutput( data = None, diff --git a/python/test/test_provenances.py b/python/test/test_provenances.py index 2a94547a..2e81964d 100644 --- a/python/test/test_provenances.py +++ b/python/test/test_provenances.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.provenances import Provenances # noqa: E501 +from geoengine_openapi_client.models.provenances import Provenances class TestProvenances(unittest.TestCase): """Provenances unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Provenances: """Test Provenances - include_option is a boolean, when False only required + include_optional 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 `Provenances` """ - model = Provenances() # noqa: E501 + model = Provenances() if include_optional: return Provenances( provenances = [ diff --git a/python/test/test_provider_capabilities.py b/python/test/test_provider_capabilities.py index a12cce2a..98671351 100644 --- a/python/test/test_provider_capabilities.py +++ b/python/test/test_provider_capabilities.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.provider_capabilities import ProviderCapabilities # noqa: E501 +from geoengine_openapi_client.models.provider_capabilities import ProviderCapabilities class TestProviderCapabilities(unittest.TestCase): """ProviderCapabilities unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ProviderCapabilities: """Test ProviderCapabilities - include_option is a boolean, when False only required + include_optional 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 `ProviderCapabilities` """ - model = ProviderCapabilities() # noqa: E501 + model = ProviderCapabilities() if include_optional: return ProviderCapabilities( listing = True, diff --git a/python/test/test_provider_layer_collection_id.py b/python/test/test_provider_layer_collection_id.py index 1c30df71..33478e31 100644 --- a/python/test/test_provider_layer_collection_id.py +++ b/python/test/test_provider_layer_collection_id.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.provider_layer_collection_id import ProviderLayerCollectionId # noqa: E501 +from geoengine_openapi_client.models.provider_layer_collection_id import ProviderLayerCollectionId class TestProviderLayerCollectionId(unittest.TestCase): """ProviderLayerCollectionId unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ProviderLayerCollectionId: """Test ProviderLayerCollectionId - include_option is a boolean, when False only required + include_optional 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 `ProviderLayerCollectionId` """ - model = ProviderLayerCollectionId() # noqa: E501 + model = ProviderLayerCollectionId() if include_optional: return ProviderLayerCollectionId( collection_id = '', diff --git a/python/test/test_provider_layer_id.py b/python/test/test_provider_layer_id.py index d7164b6e..b756d835 100644 --- a/python/test/test_provider_layer_id.py +++ b/python/test/test_provider_layer_id.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.provider_layer_id import ProviderLayerId # noqa: E501 +from geoengine_openapi_client.models.provider_layer_id import ProviderLayerId class TestProviderLayerId(unittest.TestCase): """ProviderLayerId unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ProviderLayerId: """Test ProviderLayerId - include_option is a boolean, when False only required + include_optional 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 `ProviderLayerId` """ - model = ProviderLayerId() # noqa: E501 + model = ProviderLayerId() if include_optional: return ProviderLayerId( layer_id = '', diff --git a/python/test/test_quota.py b/python/test/test_quota.py index e4a75128..b44f401d 100644 --- a/python/test/test_quota.py +++ b/python/test/test_quota.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.quota import Quota # noqa: E501 +from geoengine_openapi_client.models.quota import Quota class TestQuota(unittest.TestCase): """Quota unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Quota: """Test Quota - include_option is a boolean, when False only required + include_optional 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 `Quota` """ - model = Quota() # noqa: E501 + model = Quota() if include_optional: return Quota( available = 56, diff --git a/python/test/test_raster_band_descriptor.py b/python/test/test_raster_band_descriptor.py index 1808fdb1..c8298f35 100644 --- a/python/test/test_raster_band_descriptor.py +++ b/python/test/test_raster_band_descriptor.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.raster_band_descriptor import RasterBandDescriptor # noqa: E501 +from geoengine_openapi_client.models.raster_band_descriptor import RasterBandDescriptor class TestRasterBandDescriptor(unittest.TestCase): """RasterBandDescriptor unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> RasterBandDescriptor: """Test RasterBandDescriptor - include_option is a boolean, when False only required + include_optional 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 `RasterBandDescriptor` """ - model = RasterBandDescriptor() # noqa: E501 + model = RasterBandDescriptor() if include_optional: return RasterBandDescriptor( measurement = None, diff --git a/python/test/test_raster_colorizer.py b/python/test/test_raster_colorizer.py index 7af0490b..fc671037 100644 --- a/python/test/test_raster_colorizer.py +++ b/python/test/test_raster_colorizer.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.raster_colorizer import RasterColorizer # noqa: E501 +from geoengine_openapi_client.models.raster_colorizer import RasterColorizer class TestRasterColorizer(unittest.TestCase): """RasterColorizer unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> RasterColorizer: """Test RasterColorizer - include_option is a boolean, when False only required + include_optional 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 `RasterColorizer` """ - model = RasterColorizer() # noqa: E501 + model = RasterColorizer() if include_optional: return RasterColorizer( band = 0, diff --git a/python/test/test_raster_data_type.py b/python/test/test_raster_data_type.py index 4a409522..4b8642ed 100644 --- a/python/test/test_raster_data_type.py +++ b/python/test/test_raster_data_type.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.raster_data_type import RasterDataType # noqa: E501 +from geoengine_openapi_client.models.raster_data_type import RasterDataType class TestRasterDataType(unittest.TestCase): """RasterDataType unit test stubs""" diff --git a/python/test/test_raster_dataset_from_workflow.py b/python/test/test_raster_dataset_from_workflow.py index a7030b56..63635691 100644 --- a/python/test/test_raster_dataset_from_workflow.py +++ b/python/test/test_raster_dataset_from_workflow.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.raster_dataset_from_workflow import RasterDatasetFromWorkflow # noqa: E501 +from geoengine_openapi_client.models.raster_dataset_from_workflow import RasterDatasetFromWorkflow class TestRasterDatasetFromWorkflow(unittest.TestCase): """RasterDatasetFromWorkflow unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> RasterDatasetFromWorkflow: """Test RasterDatasetFromWorkflow - include_option is a boolean, when False only required + include_optional 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 `RasterDatasetFromWorkflow` """ - model = RasterDatasetFromWorkflow() # noqa: E501 + model = RasterDatasetFromWorkflow() if include_optional: return RasterDatasetFromWorkflow( as_cog = True, diff --git a/python/test/test_raster_dataset_from_workflow_result.py b/python/test/test_raster_dataset_from_workflow_result.py index 807218ae..a9536305 100644 --- a/python/test/test_raster_dataset_from_workflow_result.py +++ b/python/test/test_raster_dataset_from_workflow_result.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.raster_dataset_from_workflow_result import RasterDatasetFromWorkflowResult # noqa: E501 +from geoengine_openapi_client.models.raster_dataset_from_workflow_result import RasterDatasetFromWorkflowResult class TestRasterDatasetFromWorkflowResult(unittest.TestCase): """RasterDatasetFromWorkflowResult unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> RasterDatasetFromWorkflowResult: """Test RasterDatasetFromWorkflowResult - include_option is a boolean, when False only required + include_optional 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 `RasterDatasetFromWorkflowResult` """ - model = RasterDatasetFromWorkflowResult() # noqa: E501 + model = RasterDatasetFromWorkflowResult() if include_optional: return RasterDatasetFromWorkflowResult( dataset = '', diff --git a/python/test/test_raster_properties_entry_type.py b/python/test/test_raster_properties_entry_type.py index cc37e8ff..b6334751 100644 --- a/python/test/test_raster_properties_entry_type.py +++ b/python/test/test_raster_properties_entry_type.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.raster_properties_entry_type import RasterPropertiesEntryType # noqa: E501 +from geoengine_openapi_client.models.raster_properties_entry_type import RasterPropertiesEntryType class TestRasterPropertiesEntryType(unittest.TestCase): """RasterPropertiesEntryType unit test stubs""" diff --git a/python/test/test_raster_properties_key.py b/python/test/test_raster_properties_key.py index 7088d238..0e816086 100644 --- a/python/test/test_raster_properties_key.py +++ b/python/test/test_raster_properties_key.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.raster_properties_key import RasterPropertiesKey # noqa: E501 +from geoengine_openapi_client.models.raster_properties_key import RasterPropertiesKey class TestRasterPropertiesKey(unittest.TestCase): """RasterPropertiesKey unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> RasterPropertiesKey: """Test RasterPropertiesKey - include_option is a boolean, when False only required + include_optional 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 `RasterPropertiesKey` """ - model = RasterPropertiesKey() # noqa: E501 + model = RasterPropertiesKey() if include_optional: return RasterPropertiesKey( domain = '', diff --git a/python/test/test_raster_query_rectangle.py b/python/test/test_raster_query_rectangle.py index b5d46b77..bbcf57bd 100644 --- a/python/test/test_raster_query_rectangle.py +++ b/python/test/test_raster_query_rectangle.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.raster_query_rectangle import RasterQueryRectangle # noqa: E501 +from geoengine_openapi_client.models.raster_query_rectangle import RasterQueryRectangle class TestRasterQueryRectangle(unittest.TestCase): """RasterQueryRectangle unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> RasterQueryRectangle: """Test RasterQueryRectangle - include_option is a boolean, when False only required + include_optional 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 `RasterQueryRectangle` """ - model = RasterQueryRectangle() # noqa: E501 + model = RasterQueryRectangle() if include_optional: return RasterQueryRectangle( spatial_bounds = geoengine_openapi_client.models.spatial_partition2_d.SpatialPartition2D( diff --git a/python/test/test_raster_result_descriptor.py b/python/test/test_raster_result_descriptor.py index ace5ee51..8ce8ad2e 100644 --- a/python/test/test_raster_result_descriptor.py +++ b/python/test/test_raster_result_descriptor.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.raster_result_descriptor import RasterResultDescriptor # noqa: E501 +from geoengine_openapi_client.models.raster_result_descriptor import RasterResultDescriptor class TestRasterResultDescriptor(unittest.TestCase): """RasterResultDescriptor unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> RasterResultDescriptor: """Test RasterResultDescriptor - include_option is a boolean, when False only required + include_optional 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 `RasterResultDescriptor` """ - model = RasterResultDescriptor() # noqa: E501 + model = RasterResultDescriptor() if include_optional: return RasterResultDescriptor( bands = [ diff --git a/python/test/test_raster_stream_websocket_result_type.py b/python/test/test_raster_stream_websocket_result_type.py index 92c93284..75c66f77 100644 --- a/python/test/test_raster_stream_websocket_result_type.py +++ b/python/test/test_raster_stream_websocket_result_type.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.raster_stream_websocket_result_type import RasterStreamWebsocketResultType # noqa: E501 +from geoengine_openapi_client.models.raster_stream_websocket_result_type import RasterStreamWebsocketResultType class TestRasterStreamWebsocketResultType(unittest.TestCase): """RasterStreamWebsocketResultType unit test stubs""" diff --git a/python/test/test_raster_symbology.py b/python/test/test_raster_symbology.py index 4e71494f..ce821972 100644 --- a/python/test/test_raster_symbology.py +++ b/python/test/test_raster_symbology.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.raster_symbology import RasterSymbology # noqa: E501 +from geoengine_openapi_client.models.raster_symbology import RasterSymbology class TestRasterSymbology(unittest.TestCase): """RasterSymbology unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> RasterSymbology: """Test RasterSymbology - include_option is a boolean, when False only required + include_optional 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 `RasterSymbology` """ - model = RasterSymbology() # noqa: E501 + model = RasterSymbology() if include_optional: return RasterSymbology( opacity = 1.337, diff --git a/python/test/test_resource.py b/python/test/test_resource.py index d1e154fa..894fcc67 100644 --- a/python/test/test_resource.py +++ b/python/test/test_resource.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.resource import Resource # noqa: E501 +from geoengine_openapi_client.models.resource import Resource class TestResource(unittest.TestCase): """Resource unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Resource: """Test Resource - include_option is a boolean, when False only required + include_optional 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 `Resource` """ - model = Resource() # noqa: E501 + model = Resource() if include_optional: return Resource( id = '', diff --git a/python/test/test_resource_id.py b/python/test/test_resource_id.py index 8a75a079..c7bff3e9 100644 --- a/python/test/test_resource_id.py +++ b/python/test/test_resource_id.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.resource_id import ResourceId # noqa: E501 +from geoengine_openapi_client.models.resource_id import ResourceId class TestResourceId(unittest.TestCase): """ResourceId unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ResourceId: """Test ResourceId - include_option is a boolean, when False only required + include_optional 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 `ResourceId` """ - model = ResourceId() # noqa: E501 + model = ResourceId() if include_optional: return ResourceId( id = '', diff --git a/python/test/test_resource_id_dataset_id.py b/python/test/test_resource_id_dataset_id.py index ca158c6d..4f864c27 100644 --- a/python/test/test_resource_id_dataset_id.py +++ b/python/test/test_resource_id_dataset_id.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.resource_id_dataset_id import ResourceIdDatasetId # noqa: E501 +from geoengine_openapi_client.models.resource_id_dataset_id import ResourceIdDatasetId class TestResourceIdDatasetId(unittest.TestCase): """ResourceIdDatasetId unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ResourceIdDatasetId: """Test ResourceIdDatasetId - include_option is a boolean, when False only required + include_optional 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 `ResourceIdDatasetId` """ - model = ResourceIdDatasetId() # noqa: E501 + model = ResourceIdDatasetId() if include_optional: return ResourceIdDatasetId( id = '', diff --git a/python/test/test_resource_id_layer.py b/python/test/test_resource_id_layer.py index e8e99cdc..4806f8e6 100644 --- a/python/test/test_resource_id_layer.py +++ b/python/test/test_resource_id_layer.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.resource_id_layer import ResourceIdLayer # noqa: E501 +from geoengine_openapi_client.models.resource_id_layer import ResourceIdLayer class TestResourceIdLayer(unittest.TestCase): """ResourceIdLayer unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ResourceIdLayer: """Test ResourceIdLayer - include_option is a boolean, when False only required + include_optional 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 `ResourceIdLayer` """ - model = ResourceIdLayer() # noqa: E501 + model = ResourceIdLayer() if include_optional: return ResourceIdLayer( id = '', diff --git a/python/test/test_resource_id_layer_collection.py b/python/test/test_resource_id_layer_collection.py index 9ece6b13..93857fbb 100644 --- a/python/test/test_resource_id_layer_collection.py +++ b/python/test/test_resource_id_layer_collection.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.resource_id_layer_collection import ResourceIdLayerCollection # noqa: E501 +from geoengine_openapi_client.models.resource_id_layer_collection import ResourceIdLayerCollection class TestResourceIdLayerCollection(unittest.TestCase): """ResourceIdLayerCollection unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ResourceIdLayerCollection: """Test ResourceIdLayerCollection - include_option is a boolean, when False only required + include_optional 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 `ResourceIdLayerCollection` """ - model = ResourceIdLayerCollection() # noqa: E501 + model = ResourceIdLayerCollection() if include_optional: return ResourceIdLayerCollection( id = '', diff --git a/python/test/test_resource_id_ml_model.py b/python/test/test_resource_id_ml_model.py index d9b36b52..21027e05 100644 --- a/python/test/test_resource_id_ml_model.py +++ b/python/test/test_resource_id_ml_model.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.resource_id_ml_model import ResourceIdMlModel # noqa: E501 +from geoengine_openapi_client.models.resource_id_ml_model import ResourceIdMlModel class TestResourceIdMlModel(unittest.TestCase): """ResourceIdMlModel unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ResourceIdMlModel: """Test ResourceIdMlModel - include_option is a boolean, when False only required + include_optional 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 `ResourceIdMlModel` """ - model = ResourceIdMlModel() # noqa: E501 + model = ResourceIdMlModel() if include_optional: return ResourceIdMlModel( id = '', diff --git a/python/test/test_resource_id_project.py b/python/test/test_resource_id_project.py index 102ae43d..d096b54b 100644 --- a/python/test/test_resource_id_project.py +++ b/python/test/test_resource_id_project.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.resource_id_project import ResourceIdProject # noqa: E501 +from geoengine_openapi_client.models.resource_id_project import ResourceIdProject class TestResourceIdProject(unittest.TestCase): """ResourceIdProject unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ResourceIdProject: """Test ResourceIdProject - include_option is a boolean, when False only required + include_optional 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 `ResourceIdProject` """ - model = ResourceIdProject() # noqa: E501 + model = ResourceIdProject() if include_optional: return ResourceIdProject( id = '', diff --git a/python/test/test_role.py b/python/test/test_role.py index 8e8a6959..34e13116 100644 --- a/python/test/test_role.py +++ b/python/test/test_role.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.role import Role # noqa: E501 +from geoengine_openapi_client.models.role import Role class TestRole(unittest.TestCase): """Role unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Role: """Test Role - include_option is a boolean, when False only required + include_optional 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 `Role` """ - model = Role() # noqa: E501 + model = Role() if include_optional: return Role( id = '', diff --git a/python/test/test_role_description.py b/python/test/test_role_description.py index db3ea38e..143659c4 100644 --- a/python/test/test_role_description.py +++ b/python/test/test_role_description.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.role_description import RoleDescription # noqa: E501 +from geoengine_openapi_client.models.role_description import RoleDescription class TestRoleDescription(unittest.TestCase): """RoleDescription unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> RoleDescription: """Test RoleDescription - include_option is a boolean, when False only required + include_optional 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 `RoleDescription` """ - model = RoleDescription() # noqa: E501 + model = RoleDescription() if include_optional: return RoleDescription( individual = True, diff --git a/python/test/test_search_capabilities.py b/python/test/test_search_capabilities.py index 34059791..024c9732 100644 --- a/python/test/test_search_capabilities.py +++ b/python/test/test_search_capabilities.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.search_capabilities import SearchCapabilities # noqa: E501 +from geoengine_openapi_client.models.search_capabilities import SearchCapabilities class TestSearchCapabilities(unittest.TestCase): """SearchCapabilities unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> SearchCapabilities: """Test SearchCapabilities - include_option is a boolean, when False only required + include_optional 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 `SearchCapabilities` """ - model = SearchCapabilities() # noqa: E501 + model = SearchCapabilities() if include_optional: return SearchCapabilities( autocomplete = True, diff --git a/python/test/test_search_type.py b/python/test/test_search_type.py index 3d8008c5..b0f33dbe 100644 --- a/python/test/test_search_type.py +++ b/python/test/test_search_type.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.search_type import SearchType # noqa: E501 +from geoengine_openapi_client.models.search_type import SearchType class TestSearchType(unittest.TestCase): """SearchType unit test stubs""" diff --git a/python/test/test_search_types.py b/python/test/test_search_types.py index 4cf1dc0e..943da8d1 100644 --- a/python/test/test_search_types.py +++ b/python/test/test_search_types.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.search_types import SearchTypes # noqa: E501 +from geoengine_openapi_client.models.search_types import SearchTypes class TestSearchTypes(unittest.TestCase): """SearchTypes unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> SearchTypes: """Test SearchTypes - include_option is a boolean, when False only required + include_optional 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 `SearchTypes` """ - model = SearchTypes() # noqa: E501 + model = SearchTypes() if include_optional: return SearchTypes( fulltext = True, diff --git a/python/test/test_server_info.py b/python/test/test_server_info.py index 6d94e0ca..899a5e5f 100644 --- a/python/test/test_server_info.py +++ b/python/test/test_server_info.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.server_info import ServerInfo # noqa: E501 +from geoengine_openapi_client.models.server_info import ServerInfo class TestServerInfo(unittest.TestCase): """ServerInfo unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> ServerInfo: """Test ServerInfo - include_option is a boolean, when False only required + include_optional 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 `ServerInfo` """ - model = ServerInfo() # noqa: E501 + model = ServerInfo() if include_optional: return ServerInfo( build_date = '', diff --git a/python/test/test_session_api.py b/python/test/test_session_api.py index b4cdebc9..caaf86d0 100644 --- a/python/test/test_session_api.py +++ b/python/test/test_session_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.session_api import SessionApi # noqa: E501 +from geoengine_openapi_client.api.session_api import SessionApi class TestSessionApi(unittest.TestCase): """SessionApi unit test stubs""" def setUp(self) -> None: - self.api = SessionApi() # noqa: E501 + self.api = SessionApi() def tearDown(self) -> None: pass @@ -30,49 +30,49 @@ def tearDown(self) -> None: def test_anonymous_handler(self) -> None: """Test case for anonymous_handler - Creates session for anonymous user. The session's id serves as a Bearer token for requests. # noqa: E501 + Creates session for anonymous user. The session's id serves as a Bearer token for requests. """ pass def test_login_handler(self) -> None: """Test case for login_handler - Creates a session by providing user credentials. The session's id serves as a Bearer token for requests. # noqa: E501 + Creates a session by providing user credentials. The session's id serves as a Bearer token for requests. """ pass def test_logout_handler(self) -> None: """Test case for logout_handler - Ends a session. # noqa: E501 + Ends a session. """ pass def test_oidc_init(self) -> None: """Test case for oidc_init - Initializes the Open Id Connect login procedure by requesting a parametrized url to the configured Id Provider. # noqa: E501 + Initializes the Open Id Connect login procedure by requesting a parametrized url to the configured Id Provider. """ pass def test_oidc_login(self) -> None: """Test case for oidc_login - Creates a session for a user via a login with Open Id Connect. # noqa: E501 + Creates a session for a user via a login with Open Id Connect. """ pass def test_register_user_handler(self) -> None: """Test case for register_user_handler - Registers a user. # noqa: E501 + Registers a user. """ pass def test_session_handler(self) -> None: """Test case for session_handler - Retrieves details about the current session. # noqa: E501 + Retrieves details about the current session. """ pass diff --git a/python/test/test_single_band_raster_colorizer.py b/python/test/test_single_band_raster_colorizer.py index 23fd8b57..8a4cb660 100644 --- a/python/test/test_single_band_raster_colorizer.py +++ b/python/test/test_single_band_raster_colorizer.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.single_band_raster_colorizer import SingleBandRasterColorizer # noqa: E501 +from geoengine_openapi_client.models.single_band_raster_colorizer import SingleBandRasterColorizer class TestSingleBandRasterColorizer(unittest.TestCase): """SingleBandRasterColorizer unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> SingleBandRasterColorizer: """Test SingleBandRasterColorizer - include_option is a boolean, when False only required + include_optional 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 `SingleBandRasterColorizer` """ - model = SingleBandRasterColorizer() # noqa: E501 + model = SingleBandRasterColorizer() if include_optional: return SingleBandRasterColorizer( band = 0, diff --git a/python/test/test_spatial_partition2_d.py b/python/test/test_spatial_partition2_d.py index 2b5d894c..51061d34 100644 --- a/python/test/test_spatial_partition2_d.py +++ b/python/test/test_spatial_partition2_d.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.spatial_partition2_d import SpatialPartition2D # noqa: E501 +from geoengine_openapi_client.models.spatial_partition2_d import SpatialPartition2D class TestSpatialPartition2D(unittest.TestCase): """SpatialPartition2D unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> SpatialPartition2D: """Test SpatialPartition2D - include_option is a boolean, when False only required + include_optional 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 `SpatialPartition2D` """ - model = SpatialPartition2D() # noqa: E501 + model = SpatialPartition2D() if include_optional: return SpatialPartition2D( lower_right_coordinate = geoengine_openapi_client.models.coordinate2_d.Coordinate2D( diff --git a/python/test/test_spatial_reference_authority.py b/python/test/test_spatial_reference_authority.py index b95daa96..5776d893 100644 --- a/python/test/test_spatial_reference_authority.py +++ b/python/test/test_spatial_reference_authority.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.spatial_reference_authority import SpatialReferenceAuthority # noqa: E501 +from geoengine_openapi_client.models.spatial_reference_authority import SpatialReferenceAuthority class TestSpatialReferenceAuthority(unittest.TestCase): """SpatialReferenceAuthority unit test stubs""" diff --git a/python/test/test_spatial_reference_specification.py b/python/test/test_spatial_reference_specification.py index b1dd24e8..62dc8888 100644 --- a/python/test/test_spatial_reference_specification.py +++ b/python/test/test_spatial_reference_specification.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.spatial_reference_specification import SpatialReferenceSpecification # noqa: E501 +from geoengine_openapi_client.models.spatial_reference_specification import SpatialReferenceSpecification class TestSpatialReferenceSpecification(unittest.TestCase): """SpatialReferenceSpecification unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> SpatialReferenceSpecification: """Test SpatialReferenceSpecification - include_option is a boolean, when False only required + include_optional 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 `SpatialReferenceSpecification` """ - model = SpatialReferenceSpecification() # noqa: E501 + model = SpatialReferenceSpecification() if include_optional: return SpatialReferenceSpecification( axis_labels = [ diff --git a/python/test/test_spatial_references_api.py b/python/test/test_spatial_references_api.py index a958d0ec..a118fff6 100644 --- a/python/test/test_spatial_references_api.py +++ b/python/test/test_spatial_references_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.spatial_references_api import SpatialReferencesApi # noqa: E501 +from geoengine_openapi_client.api.spatial_references_api import SpatialReferencesApi class TestSpatialReferencesApi(unittest.TestCase): """SpatialReferencesApi unit test stubs""" def setUp(self) -> None: - self.api = SpatialReferencesApi() # noqa: E501 + self.api = SpatialReferencesApi() def tearDown(self) -> None: pass diff --git a/python/test/test_spatial_resolution.py b/python/test/test_spatial_resolution.py index a410eec7..e6a7c7ef 100644 --- a/python/test/test_spatial_resolution.py +++ b/python/test/test_spatial_resolution.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.spatial_resolution import SpatialResolution # noqa: E501 +from geoengine_openapi_client.models.spatial_resolution import SpatialResolution class TestSpatialResolution(unittest.TestCase): """SpatialResolution unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> SpatialResolution: """Test SpatialResolution - include_option is a boolean, when False only required + include_optional 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 `SpatialResolution` """ - model = SpatialResolution() # noqa: E501 + model = SpatialResolution() if include_optional: return SpatialResolution( x = 1.337, diff --git a/python/test/test_st_rectangle.py b/python/test/test_st_rectangle.py index 27f21ce3..abd124bd 100644 --- a/python/test/test_st_rectangle.py +++ b/python/test/test_st_rectangle.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.st_rectangle import STRectangle # noqa: E501 +from geoengine_openapi_client.models.st_rectangle import STRectangle class TestSTRectangle(unittest.TestCase): """STRectangle unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> STRectangle: """Test STRectangle - include_option is a boolean, when False only required + include_optional 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 `STRectangle` """ - model = STRectangle() # noqa: E501 + model = STRectangle() if include_optional: return STRectangle( bounding_box = geoengine_openapi_client.models.bounding_box2_d.BoundingBox2D( diff --git a/python/test/test_static_number_param.py b/python/test/test_static_number_param.py index e90b10ec..4e2201c7 100644 --- a/python/test/test_static_number_param.py +++ b/python/test/test_static_number_param.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.static_number_param import StaticNumberParam # noqa: E501 +from geoengine_openapi_client.models.static_number_param import StaticNumberParam class TestStaticNumberParam(unittest.TestCase): """StaticNumberParam unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> StaticNumberParam: """Test StaticNumberParam - include_option is a boolean, when False only required + include_optional 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 `StaticNumberParam` """ - model = StaticNumberParam() # noqa: E501 + model = StaticNumberParam() if include_optional: return StaticNumberParam( type = 'static', diff --git a/python/test/test_stroke_param.py b/python/test/test_stroke_param.py index 99cec95c..5bd39328 100644 --- a/python/test/test_stroke_param.py +++ b/python/test/test_stroke_param.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.stroke_param import StrokeParam # noqa: E501 +from geoengine_openapi_client.models.stroke_param import StrokeParam class TestStrokeParam(unittest.TestCase): """StrokeParam unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> StrokeParam: """Test StrokeParam - include_option is a boolean, when False only required + include_optional 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 `StrokeParam` """ - model = StrokeParam() # noqa: E501 + model = StrokeParam() if include_optional: return StrokeParam( color = None, diff --git a/python/test/test_suggest_meta_data.py b/python/test/test_suggest_meta_data.py index 3407e716..2b97b38c 100644 --- a/python/test/test_suggest_meta_data.py +++ b/python/test/test_suggest_meta_data.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.suggest_meta_data import SuggestMetaData # noqa: E501 +from geoengine_openapi_client.models.suggest_meta_data import SuggestMetaData class TestSuggestMetaData(unittest.TestCase): """SuggestMetaData unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> SuggestMetaData: """Test SuggestMetaData - include_option is a boolean, when False only required + include_optional 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 `SuggestMetaData` """ - model = SuggestMetaData() # noqa: E501 + model = SuggestMetaData() if include_optional: return SuggestMetaData( data_path = None, diff --git a/python/test/test_symbology.py b/python/test/test_symbology.py index ab723a76..31249fb7 100644 --- a/python/test/test_symbology.py +++ b/python/test/test_symbology.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.symbology import Symbology # noqa: E501 +from geoengine_openapi_client.models.symbology import Symbology class TestSymbology(unittest.TestCase): """Symbology unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Symbology: """Test Symbology - include_option is a boolean, when False only required + include_optional 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 `Symbology` """ - model = Symbology() # noqa: E501 + model = Symbology() if include_optional: return Symbology( opacity = 1.337, diff --git a/python/test/test_task_abort_options.py b/python/test/test_task_abort_options.py index 8ea2879f..6a43c00c 100644 --- a/python/test/test_task_abort_options.py +++ b/python/test/test_task_abort_options.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.task_abort_options import TaskAbortOptions # noqa: E501 +from geoengine_openapi_client.models.task_abort_options import TaskAbortOptions class TestTaskAbortOptions(unittest.TestCase): """TaskAbortOptions unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TaskAbortOptions: """Test TaskAbortOptions - include_option is a boolean, when False only required + include_optional 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 `TaskAbortOptions` """ - model = TaskAbortOptions() # noqa: E501 + model = TaskAbortOptions() if include_optional: return TaskAbortOptions( force = True diff --git a/python/test/test_task_filter.py b/python/test/test_task_filter.py index 40b81b59..194640d9 100644 --- a/python/test/test_task_filter.py +++ b/python/test/test_task_filter.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.task_filter import TaskFilter # noqa: E501 +from geoengine_openapi_client.models.task_filter import TaskFilter class TestTaskFilter(unittest.TestCase): """TaskFilter unit test stubs""" diff --git a/python/test/test_task_list_options.py b/python/test/test_task_list_options.py index ae2efa97..93df6e77 100644 --- a/python/test/test_task_list_options.py +++ b/python/test/test_task_list_options.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.task_list_options import TaskListOptions # noqa: E501 +from geoengine_openapi_client.models.task_list_options import TaskListOptions class TestTaskListOptions(unittest.TestCase): """TaskListOptions unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TaskListOptions: """Test TaskListOptions - include_option is a boolean, when False only required + include_optional 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 `TaskListOptions` """ - model = TaskListOptions() # noqa: E501 + model = TaskListOptions() if include_optional: return TaskListOptions( filter = 'running', diff --git a/python/test/test_task_response.py b/python/test/test_task_response.py index c7a3fa26..a1d5b4c3 100644 --- a/python/test/test_task_response.py +++ b/python/test/test_task_response.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.task_response import TaskResponse # noqa: E501 +from geoengine_openapi_client.models.task_response import TaskResponse class TestTaskResponse(unittest.TestCase): """TaskResponse unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TaskResponse: """Test TaskResponse - include_option is a boolean, when False only required + include_optional 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 `TaskResponse` """ - model = TaskResponse() # noqa: E501 + model = TaskResponse() if include_optional: return TaskResponse( task_id = '' diff --git a/python/test/test_task_status.py b/python/test/test_task_status.py index 2a845e9c..9b35fa67 100644 --- a/python/test/test_task_status.py +++ b/python/test/test_task_status.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.task_status import TaskStatus # noqa: E501 +from geoengine_openapi_client.models.task_status import TaskStatus class TestTaskStatus(unittest.TestCase): """TaskStatus unit test stubs""" @@ -29,24 +28,24 @@ def tearDown(self): def make_instance(self, include_optional) -> TaskStatus: """Test TaskStatus - include_option is a boolean, when False only required + include_optional 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 `TaskStatus` """ - model = TaskStatus() # noqa: E501 + model = TaskStatus() if include_optional: return TaskStatus( description = '', estimated_time_remaining = '', - info = None, + info = geoengine_openapi_client.models.info.info(), pct_complete = '', status = 'failed', task_type = '', time_started = '', time_total = '', - clean_up = None, - error = None + clean_up = geoengine_openapi_client.models.clean_up.cleanUp(), + error = geoengine_openapi_client.models.error.error() ) else: return TaskStatus( @@ -56,8 +55,8 @@ def make_instance(self, include_optional) -> TaskStatus: task_type = '', time_started = '', time_total = '', - clean_up = None, - error = None, + clean_up = geoengine_openapi_client.models.clean_up.cleanUp(), + error = geoengine_openapi_client.models.error.error(), ) """ diff --git a/python/test/test_task_status_aborted.py b/python/test/test_task_status_aborted.py index 0cf42902..3340b36a 100644 --- a/python/test/test_task_status_aborted.py +++ b/python/test/test_task_status_aborted.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.task_status_aborted import TaskStatusAborted # noqa: E501 +from geoengine_openapi_client.models.task_status_aborted import TaskStatusAborted class TestTaskStatusAborted(unittest.TestCase): """TaskStatusAborted unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TaskStatusAborted: """Test TaskStatusAborted - include_option is a boolean, when False only required + include_optional 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 `TaskStatusAborted` """ - model = TaskStatusAborted() # noqa: E501 + model = TaskStatusAborted() if include_optional: return TaskStatusAborted( clean_up = None, diff --git a/python/test/test_task_status_completed.py b/python/test/test_task_status_completed.py index f9d41606..641cd787 100644 --- a/python/test/test_task_status_completed.py +++ b/python/test/test_task_status_completed.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.task_status_completed import TaskStatusCompleted # noqa: E501 +from geoengine_openapi_client.models.task_status_completed import TaskStatusCompleted class TestTaskStatusCompleted(unittest.TestCase): """TaskStatusCompleted unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TaskStatusCompleted: """Test TaskStatusCompleted - include_option is a boolean, when False only required + include_optional 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 `TaskStatusCompleted` """ - model = TaskStatusCompleted() # noqa: E501 + model = TaskStatusCompleted() if include_optional: return TaskStatusCompleted( description = '', diff --git a/python/test/test_task_status_failed.py b/python/test/test_task_status_failed.py index 40d3131d..1ce8d04f 100644 --- a/python/test/test_task_status_failed.py +++ b/python/test/test_task_status_failed.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.task_status_failed import TaskStatusFailed # noqa: E501 +from geoengine_openapi_client.models.task_status_failed import TaskStatusFailed class TestTaskStatusFailed(unittest.TestCase): """TaskStatusFailed unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TaskStatusFailed: """Test TaskStatusFailed - include_option is a boolean, when False only required + include_optional 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 `TaskStatusFailed` """ - model = TaskStatusFailed() # noqa: E501 + model = TaskStatusFailed() if include_optional: return TaskStatusFailed( clean_up = None, diff --git a/python/test/test_task_status_running.py b/python/test/test_task_status_running.py index 4f26fdc8..00739830 100644 --- a/python/test/test_task_status_running.py +++ b/python/test/test_task_status_running.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.task_status_running import TaskStatusRunning # noqa: E501 +from geoengine_openapi_client.models.task_status_running import TaskStatusRunning class TestTaskStatusRunning(unittest.TestCase): """TaskStatusRunning unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TaskStatusRunning: """Test TaskStatusRunning - include_option is a boolean, when False only required + include_optional 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 `TaskStatusRunning` """ - model = TaskStatusRunning() # noqa: E501 + model = TaskStatusRunning() if include_optional: return TaskStatusRunning( description = '', diff --git a/python/test/test_task_status_with_id.py b/python/test/test_task_status_with_id.py index 4114e961..dc075dd4 100644 --- a/python/test/test_task_status_with_id.py +++ b/python/test/test_task_status_with_id.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.task_status_with_id import TaskStatusWithId # noqa: E501 +from geoengine_openapi_client.models.task_status_with_id import TaskStatusWithId class TestTaskStatusWithId(unittest.TestCase): """TaskStatusWithId unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TaskStatusWithId: """Test TaskStatusWithId - include_option is a boolean, when False only required + include_optional 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 `TaskStatusWithId` """ - model = TaskStatusWithId() # noqa: E501 + model = TaskStatusWithId() if include_optional: return TaskStatusWithId( task_id = '' diff --git a/python/test/test_tasks_api.py b/python/test/test_tasks_api.py index 0d732241..c99b474e 100644 --- a/python/test/test_tasks_api.py +++ b/python/test/test_tasks_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.tasks_api import TasksApi # noqa: E501 +from geoengine_openapi_client.api.tasks_api import TasksApi class TestTasksApi(unittest.TestCase): """TasksApi unit test stubs""" def setUp(self) -> None: - self.api = TasksApi() # noqa: E501 + self.api = TasksApi() def tearDown(self) -> None: pass @@ -30,21 +30,21 @@ def tearDown(self) -> None: def test_abort_handler(self) -> None: """Test case for abort_handler - Abort a running task. # noqa: E501 + Abort a running task. """ pass def test_list_handler(self) -> None: """Test case for list_handler - Retrieve the status of all tasks. # noqa: E501 + Retrieve the status of all tasks. """ pass def test_status_handler(self) -> None: """Test case for status_handler - Retrieve the status of a task. # noqa: E501 + Retrieve the status of a task. """ pass diff --git a/python/test/test_text_symbology.py b/python/test/test_text_symbology.py index 8f90ff76..c2606320 100644 --- a/python/test/test_text_symbology.py +++ b/python/test/test_text_symbology.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.text_symbology import TextSymbology # noqa: E501 +from geoengine_openapi_client.models.text_symbology import TextSymbology class TestTextSymbology(unittest.TestCase): """TextSymbology unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TextSymbology: """Test TextSymbology - include_option is a boolean, when False only required + include_optional 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 `TextSymbology` """ - model = TextSymbology() # noqa: E501 + model = TextSymbology() if include_optional: return TextSymbology( attribute = '', diff --git a/python/test/test_time_granularity.py b/python/test/test_time_granularity.py index 9428c7ae..ffe13cae 100644 --- a/python/test/test_time_granularity.py +++ b/python/test/test_time_granularity.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.time_granularity import TimeGranularity # noqa: E501 +from geoengine_openapi_client.models.time_granularity import TimeGranularity class TestTimeGranularity(unittest.TestCase): """TimeGranularity unit test stubs""" diff --git a/python/test/test_time_interval.py b/python/test/test_time_interval.py index 90b54ad3..0654bfce 100644 --- a/python/test/test_time_interval.py +++ b/python/test/test_time_interval.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.time_interval import TimeInterval # noqa: E501 +from geoengine_openapi_client.models.time_interval import TimeInterval class TestTimeInterval(unittest.TestCase): """TimeInterval unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TimeInterval: """Test TimeInterval - include_option is a boolean, when False only required + include_optional 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 `TimeInterval` """ - model = TimeInterval() # noqa: E501 + model = TimeInterval() if include_optional: return TimeInterval( end = 56, diff --git a/python/test/test_time_reference.py b/python/test/test_time_reference.py index 015adede..547eefd2 100644 --- a/python/test/test_time_reference.py +++ b/python/test/test_time_reference.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.time_reference import TimeReference # noqa: E501 +from geoengine_openapi_client.models.time_reference import TimeReference class TestTimeReference(unittest.TestCase): """TimeReference unit test stubs""" diff --git a/python/test/test_time_step.py b/python/test/test_time_step.py index 4eeb13a4..1c311640 100644 --- a/python/test/test_time_step.py +++ b/python/test/test_time_step.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.time_step import TimeStep # noqa: E501 +from geoengine_openapi_client.models.time_step import TimeStep class TestTimeStep(unittest.TestCase): """TimeStep unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TimeStep: """Test TimeStep - include_option is a boolean, when False only required + include_optional 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 `TimeStep` """ - model = TimeStep() # noqa: E501 + model = TimeStep() if include_optional: return TimeStep( granularity = 'millis', diff --git a/python/test/test_typed_geometry.py b/python/test/test_typed_geometry.py index 7f7a4e23..512ef82a 100644 --- a/python/test/test_typed_geometry.py +++ b/python/test/test_typed_geometry.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.typed_geometry import TypedGeometry # noqa: E501 +from geoengine_openapi_client.models.typed_geometry import TypedGeometry class TestTypedGeometry(unittest.TestCase): """TypedGeometry unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TypedGeometry: """Test TypedGeometry - include_option is a boolean, when False only required + include_optional 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 `TypedGeometry` """ - model = TypedGeometry() # noqa: E501 + model = TypedGeometry() if include_optional: return TypedGeometry( data = None, diff --git a/python/test/test_typed_geometry_one_of.py b/python/test/test_typed_geometry_one_of.py index 11d99add..a5122a2c 100644 --- a/python/test/test_typed_geometry_one_of.py +++ b/python/test/test_typed_geometry_one_of.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.typed_geometry_one_of import TypedGeometryOneOf # noqa: E501 +from geoengine_openapi_client.models.typed_geometry_one_of import TypedGeometryOneOf class TestTypedGeometryOneOf(unittest.TestCase): """TypedGeometryOneOf unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TypedGeometryOneOf: """Test TypedGeometryOneOf - include_option is a boolean, when False only required + include_optional 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 `TypedGeometryOneOf` """ - model = TypedGeometryOneOf() # noqa: E501 + model = TypedGeometryOneOf() if include_optional: return TypedGeometryOneOf( data = None diff --git a/python/test/test_typed_geometry_one_of1.py b/python/test/test_typed_geometry_one_of1.py index 1d41e8fa..51b07391 100644 --- a/python/test/test_typed_geometry_one_of1.py +++ b/python/test/test_typed_geometry_one_of1.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.typed_geometry_one_of1 import TypedGeometryOneOf1 # noqa: E501 +from geoengine_openapi_client.models.typed_geometry_one_of1 import TypedGeometryOneOf1 class TestTypedGeometryOneOf1(unittest.TestCase): """TypedGeometryOneOf1 unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TypedGeometryOneOf1: """Test TypedGeometryOneOf1 - include_option is a boolean, when False only required + include_optional 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 `TypedGeometryOneOf1` """ - model = TypedGeometryOneOf1() # noqa: E501 + model = TypedGeometryOneOf1() if include_optional: return TypedGeometryOneOf1( multi_point = geoengine_openapi_client.models.multi_point.MultiPoint( diff --git a/python/test/test_typed_geometry_one_of2.py b/python/test/test_typed_geometry_one_of2.py index 9b367c04..c1c6b8cf 100644 --- a/python/test/test_typed_geometry_one_of2.py +++ b/python/test/test_typed_geometry_one_of2.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.typed_geometry_one_of2 import TypedGeometryOneOf2 # noqa: E501 +from geoengine_openapi_client.models.typed_geometry_one_of2 import TypedGeometryOneOf2 class TestTypedGeometryOneOf2(unittest.TestCase): """TypedGeometryOneOf2 unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TypedGeometryOneOf2: """Test TypedGeometryOneOf2 - include_option is a boolean, when False only required + include_optional 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 `TypedGeometryOneOf2` """ - model = TypedGeometryOneOf2() # noqa: E501 + model = TypedGeometryOneOf2() if include_optional: return TypedGeometryOneOf2( multi_line_string = geoengine_openapi_client.models.multi_line_string.MultiLineString( diff --git a/python/test/test_typed_geometry_one_of3.py b/python/test/test_typed_geometry_one_of3.py index 53949b8b..80797b07 100644 --- a/python/test/test_typed_geometry_one_of3.py +++ b/python/test/test_typed_geometry_one_of3.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.typed_geometry_one_of3 import TypedGeometryOneOf3 # noqa: E501 +from geoengine_openapi_client.models.typed_geometry_one_of3 import TypedGeometryOneOf3 class TestTypedGeometryOneOf3(unittest.TestCase): """TypedGeometryOneOf3 unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TypedGeometryOneOf3: """Test TypedGeometryOneOf3 - include_option is a boolean, when False only required + include_optional 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 `TypedGeometryOneOf3` """ - model = TypedGeometryOneOf3() # noqa: E501 + model = TypedGeometryOneOf3() if include_optional: return TypedGeometryOneOf3( multi_polygon = geoengine_openapi_client.models.multi_polygon.MultiPolygon( diff --git a/python/test/test_typed_operator.py b/python/test/test_typed_operator.py index 8292b549..b50075f2 100644 --- a/python/test/test_typed_operator.py +++ b/python/test/test_typed_operator.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.typed_operator import TypedOperator # noqa: E501 +from geoengine_openapi_client.models.typed_operator import TypedOperator class TestTypedOperator(unittest.TestCase): """TypedOperator unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TypedOperator: """Test TypedOperator - include_option is a boolean, when False only required + include_optional 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 `TypedOperator` """ - model = TypedOperator() # noqa: E501 + model = TypedOperator() if include_optional: return TypedOperator( operator = geoengine_openapi_client.models.typed_operator_operator.TypedOperator_operator( diff --git a/python/test/test_typed_operator_operator.py b/python/test/test_typed_operator_operator.py index 2083eb93..ff8fe13c 100644 --- a/python/test/test_typed_operator_operator.py +++ b/python/test/test_typed_operator_operator.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.typed_operator_operator import TypedOperatorOperator # noqa: E501 +from geoengine_openapi_client.models.typed_operator_operator import TypedOperatorOperator class TestTypedOperatorOperator(unittest.TestCase): """TypedOperatorOperator unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TypedOperatorOperator: """Test TypedOperatorOperator - include_option is a boolean, when False only required + include_optional 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 `TypedOperatorOperator` """ - model = TypedOperatorOperator() # noqa: E501 + model = TypedOperatorOperator() if include_optional: return TypedOperatorOperator( params = geoengine_openapi_client.models.params.params(), diff --git a/python/test/test_typed_plot_result_descriptor.py b/python/test/test_typed_plot_result_descriptor.py index 8344d178..7a2c8948 100644 --- a/python/test/test_typed_plot_result_descriptor.py +++ b/python/test/test_typed_plot_result_descriptor.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.typed_plot_result_descriptor import TypedPlotResultDescriptor # noqa: E501 +from geoengine_openapi_client.models.typed_plot_result_descriptor import TypedPlotResultDescriptor class TestTypedPlotResultDescriptor(unittest.TestCase): """TypedPlotResultDescriptor unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TypedPlotResultDescriptor: """Test TypedPlotResultDescriptor - include_option is a boolean, when False only required + include_optional 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 `TypedPlotResultDescriptor` """ - model = TypedPlotResultDescriptor() # noqa: E501 + model = TypedPlotResultDescriptor() if include_optional: return TypedPlotResultDescriptor( bbox = geoengine_openapi_client.models.bounding_box2_d.BoundingBox2D( diff --git a/python/test/test_typed_raster_result_descriptor.py b/python/test/test_typed_raster_result_descriptor.py index 259066f5..906e03b7 100644 --- a/python/test/test_typed_raster_result_descriptor.py +++ b/python/test/test_typed_raster_result_descriptor.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.typed_raster_result_descriptor import TypedRasterResultDescriptor # noqa: E501 +from geoengine_openapi_client.models.typed_raster_result_descriptor import TypedRasterResultDescriptor class TestTypedRasterResultDescriptor(unittest.TestCase): """TypedRasterResultDescriptor unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TypedRasterResultDescriptor: """Test TypedRasterResultDescriptor - include_option is a boolean, when False only required + include_optional 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 `TypedRasterResultDescriptor` """ - model = TypedRasterResultDescriptor() # noqa: E501 + model = TypedRasterResultDescriptor() if include_optional: return TypedRasterResultDescriptor( bands = [ diff --git a/python/test/test_typed_result_descriptor.py b/python/test/test_typed_result_descriptor.py index b04a9eb1..fe0f85a1 100644 --- a/python/test/test_typed_result_descriptor.py +++ b/python/test/test_typed_result_descriptor.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.typed_result_descriptor import TypedResultDescriptor # noqa: E501 +from geoengine_openapi_client.models.typed_result_descriptor import TypedResultDescriptor class TestTypedResultDescriptor(unittest.TestCase): """TypedResultDescriptor unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TypedResultDescriptor: """Test TypedResultDescriptor - include_option is a boolean, when False only required + include_optional 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 `TypedResultDescriptor` """ - model = TypedResultDescriptor() # noqa: E501 + model = TypedResultDescriptor() if include_optional: return TypedResultDescriptor( bbox = geoengine_openapi_client.models.bounding_box2_d.BoundingBox2D( diff --git a/python/test/test_typed_vector_result_descriptor.py b/python/test/test_typed_vector_result_descriptor.py index 7afe41cc..e5b9a81b 100644 --- a/python/test/test_typed_vector_result_descriptor.py +++ b/python/test/test_typed_vector_result_descriptor.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.typed_vector_result_descriptor import TypedVectorResultDescriptor # noqa: E501 +from geoengine_openapi_client.models.typed_vector_result_descriptor import TypedVectorResultDescriptor class TestTypedVectorResultDescriptor(unittest.TestCase): """TypedVectorResultDescriptor unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> TypedVectorResultDescriptor: """Test TypedVectorResultDescriptor - include_option is a boolean, when False only required + include_optional 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 `TypedVectorResultDescriptor` """ - model = TypedVectorResultDescriptor() # noqa: E501 + model = TypedVectorResultDescriptor() if include_optional: return TypedVectorResultDescriptor( bbox = geoengine_openapi_client.models.bounding_box2_d.BoundingBox2D( diff --git a/python/test/test_unitless_measurement.py b/python/test/test_unitless_measurement.py index 7bdb8e7b..323e39cd 100644 --- a/python/test/test_unitless_measurement.py +++ b/python/test/test_unitless_measurement.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.unitless_measurement import UnitlessMeasurement # noqa: E501 +from geoengine_openapi_client.models.unitless_measurement import UnitlessMeasurement class TestUnitlessMeasurement(unittest.TestCase): """UnitlessMeasurement unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UnitlessMeasurement: """Test UnitlessMeasurement - include_option is a boolean, when False only required + include_optional 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 `UnitlessMeasurement` """ - model = UnitlessMeasurement() # noqa: E501 + model = UnitlessMeasurement() if include_optional: return UnitlessMeasurement( type = 'unitless' diff --git a/python/test/test_unix_time_stamp_type.py b/python/test/test_unix_time_stamp_type.py index 7a6d991e..370cb64e 100644 --- a/python/test/test_unix_time_stamp_type.py +++ b/python/test/test_unix_time_stamp_type.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.unix_time_stamp_type import UnixTimeStampType # noqa: E501 +from geoengine_openapi_client.models.unix_time_stamp_type import UnixTimeStampType class TestUnixTimeStampType(unittest.TestCase): """UnixTimeStampType unit test stubs""" diff --git a/python/test/test_update_dataset.py b/python/test/test_update_dataset.py index 9192c7fb..a5ede464 100644 --- a/python/test/test_update_dataset.py +++ b/python/test/test_update_dataset.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.update_dataset import UpdateDataset # noqa: E501 +from geoengine_openapi_client.models.update_dataset import UpdateDataset class TestUpdateDataset(unittest.TestCase): """UpdateDataset unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UpdateDataset: """Test UpdateDataset - include_option is a boolean, when False only required + include_optional 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 `UpdateDataset` """ - model = UpdateDataset() # noqa: E501 + model = UpdateDataset() if include_optional: return UpdateDataset( description = '', diff --git a/python/test/test_update_layer.py b/python/test/test_update_layer.py index dca8f20c..a201b89b 100644 --- a/python/test/test_update_layer.py +++ b/python/test/test_update_layer.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.update_layer import UpdateLayer # noqa: E501 +from geoengine_openapi_client.models.update_layer import UpdateLayer class TestUpdateLayer(unittest.TestCase): """UpdateLayer unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UpdateLayer: """Test UpdateLayer - include_option is a boolean, when False only required + include_optional 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 + model = UpdateLayer() if include_optional: return UpdateLayer( description = 'Example layer description', diff --git a/python/test/test_update_layer_collection.py b/python/test/test_update_layer_collection.py index ef07cd14..6a195e2a 100644 --- a/python/test/test_update_layer_collection.py +++ b/python/test/test_update_layer_collection.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.update_layer_collection import UpdateLayerCollection # noqa: E501 +from geoengine_openapi_client.models.update_layer_collection import UpdateLayerCollection class TestUpdateLayerCollection(unittest.TestCase): """UpdateLayerCollection unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UpdateLayerCollection: """Test UpdateLayerCollection - include_option is a boolean, when False only required + include_optional 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 `UpdateLayerCollection` """ - model = UpdateLayerCollection() # noqa: E501 + model = UpdateLayerCollection() if include_optional: return UpdateLayerCollection( description = 'A description for an example collection', diff --git a/python/test/test_update_project.py b/python/test/test_update_project.py index 6453dbc9..095948e8 100644 --- a/python/test/test_update_project.py +++ b/python/test/test_update_project.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.update_project import UpdateProject # noqa: E501 +from geoengine_openapi_client.models.update_project import UpdateProject class TestUpdateProject(unittest.TestCase): """UpdateProject unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UpdateProject: """Test UpdateProject - include_option is a boolean, when False only required + include_optional 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 `UpdateProject` """ - model = UpdateProject() # noqa: E501 + model = UpdateProject() if include_optional: return UpdateProject( bounds = geoengine_openapi_client.models.st_rectangle.STRectangle( diff --git a/python/test/test_update_quota.py b/python/test/test_update_quota.py index f793034d..2746eac8 100644 --- a/python/test/test_update_quota.py +++ b/python/test/test_update_quota.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.update_quota import UpdateQuota # noqa: E501 +from geoengine_openapi_client.models.update_quota import UpdateQuota class TestUpdateQuota(unittest.TestCase): """UpdateQuota unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UpdateQuota: """Test UpdateQuota - include_option is a boolean, when False only required + include_optional 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 `UpdateQuota` """ - model = UpdateQuota() # noqa: E501 + model = UpdateQuota() if include_optional: return UpdateQuota( available = 56 diff --git a/python/test/test_upload_file_layers_response.py b/python/test/test_upload_file_layers_response.py index 6ca2b139..b8c08759 100644 --- a/python/test/test_upload_file_layers_response.py +++ b/python/test/test_upload_file_layers_response.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.upload_file_layers_response import UploadFileLayersResponse # noqa: E501 +from geoengine_openapi_client.models.upload_file_layers_response import UploadFileLayersResponse class TestUploadFileLayersResponse(unittest.TestCase): """UploadFileLayersResponse unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UploadFileLayersResponse: """Test UploadFileLayersResponse - include_option is a boolean, when False only required + include_optional 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 `UploadFileLayersResponse` """ - model = UploadFileLayersResponse() # noqa: E501 + model = UploadFileLayersResponse() if include_optional: return UploadFileLayersResponse( layers = [ diff --git a/python/test/test_upload_files_response.py b/python/test/test_upload_files_response.py index 4e7218b5..385a4a79 100644 --- a/python/test/test_upload_files_response.py +++ b/python/test/test_upload_files_response.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.upload_files_response import UploadFilesResponse # noqa: E501 +from geoengine_openapi_client.models.upload_files_response import UploadFilesResponse class TestUploadFilesResponse(unittest.TestCase): """UploadFilesResponse unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UploadFilesResponse: """Test UploadFilesResponse - include_option is a boolean, when False only required + include_optional 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 `UploadFilesResponse` """ - model = UploadFilesResponse() # noqa: E501 + model = UploadFilesResponse() if include_optional: return UploadFilesResponse( files = [ diff --git a/python/test/test_uploads_api.py b/python/test/test_uploads_api.py index 19615ffb..e28b2df6 100644 --- a/python/test/test_uploads_api.py +++ b/python/test/test_uploads_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.uploads_api import UploadsApi # noqa: E501 +from geoengine_openapi_client.api.uploads_api import UploadsApi class TestUploadsApi(unittest.TestCase): """UploadsApi unit test stubs""" def setUp(self) -> None: - self.api = UploadsApi() # noqa: E501 + self.api = UploadsApi() def tearDown(self) -> None: pass @@ -30,21 +30,21 @@ def tearDown(self) -> None: def test_list_upload_file_layers_handler(self) -> None: """Test case for list_upload_file_layers_handler - List the layers of on uploaded file. # noqa: E501 + List the layers of on uploaded file. """ pass def test_list_upload_files_handler(self) -> None: """Test case for list_upload_files_handler - List the files of on upload. # noqa: E501 + List the files of on upload. """ pass def test_upload_handler(self) -> None: """Test case for upload_handler - Uploads files. # noqa: E501 + Uploads files. """ pass diff --git a/python/test/test_usage_summary_granularity.py b/python/test/test_usage_summary_granularity.py index 3ff79209..885691ef 100644 --- a/python/test/test_usage_summary_granularity.py +++ b/python/test/test_usage_summary_granularity.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.usage_summary_granularity import UsageSummaryGranularity # noqa: E501 +from geoengine_openapi_client.models.usage_summary_granularity import UsageSummaryGranularity class TestUsageSummaryGranularity(unittest.TestCase): """UsageSummaryGranularity unit test stubs""" diff --git a/python/test/test_user_api.py b/python/test/test_user_api.py index b6463b36..89f4c05e 100644 --- a/python/test/test_user_api.py +++ b/python/test/test_user_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.user_api import UserApi # noqa: E501 +from geoengine_openapi_client.api.user_api import UserApi class TestUserApi(unittest.TestCase): """UserApi unit test stubs""" def setUp(self) -> None: - self.api = UserApi() # noqa: E501 + self.api = UserApi() def tearDown(self) -> None: pass @@ -30,91 +30,91 @@ def tearDown(self) -> None: def test_add_role_handler(self) -> None: """Test case for add_role_handler - Add a new role. Requires admin privilige. # noqa: E501 + Add a new role. Requires admin privilige. """ pass def test_assign_role_handler(self) -> None: """Test case for assign_role_handler - Assign a role to a user. Requires admin privilige. # noqa: E501 + Assign a role to a user. Requires admin privilige. """ pass def test_computation_quota_handler(self) -> None: """Test case for computation_quota_handler - Retrieves the quota used by computation with the given computation id # noqa: E501 + Retrieves the quota used by computation with the given computation id """ pass def test_computations_quota_handler(self) -> None: """Test case for computations_quota_handler - Retrieves the quota used by computations # noqa: E501 + Retrieves the quota used by computations """ pass def test_data_usage_handler(self) -> None: """Test case for data_usage_handler - Retrieves the data usage # noqa: E501 + Retrieves the data usage """ pass def test_data_usage_summary_handler(self) -> None: """Test case for data_usage_summary_handler - Retrieves the data usage summary # noqa: E501 + Retrieves the data usage summary """ pass def test_get_role_by_name_handler(self) -> None: """Test case for get_role_by_name_handler - Get role by name # noqa: E501 + Get role by name """ pass def test_get_role_descriptions(self) -> None: """Test case for get_role_descriptions - Query roles for the current user. # noqa: E501 + Query roles for the current user. """ pass def test_get_user_quota_handler(self) -> None: """Test case for get_user_quota_handler - Retrieves the available and used quota of a specific user. # noqa: E501 + Retrieves the available and used quota of a specific user. """ pass def test_quota_handler(self) -> None: """Test case for quota_handler - Retrieves the available and used quota of the current user. # noqa: E501 + Retrieves the available and used quota of the current user. """ pass def test_remove_role_handler(self) -> None: """Test case for remove_role_handler - Remove a role. Requires admin privilige. # noqa: E501 + Remove a role. Requires admin privilige. """ pass def test_revoke_role_handler(self) -> None: """Test case for revoke_role_handler - Revoke a role from a user. Requires admin privilige. # noqa: E501 + Revoke a role from a user. Requires admin privilige. """ pass def test_update_user_quota_handler(self) -> None: """Test case for update_user_quota_handler - Update the available quota of a specific user. # noqa: E501 + Update the available quota of a specific user. """ pass diff --git a/python/test/test_user_credentials.py b/python/test/test_user_credentials.py index 870e7d7d..7b3c0dc4 100644 --- a/python/test/test_user_credentials.py +++ b/python/test/test_user_credentials.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.user_credentials import UserCredentials # noqa: E501 +from geoengine_openapi_client.models.user_credentials import UserCredentials class TestUserCredentials(unittest.TestCase): """UserCredentials unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UserCredentials: """Test UserCredentials - include_option is a boolean, when False only required + include_optional 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 `UserCredentials` """ - model = UserCredentials() # noqa: E501 + model = UserCredentials() if include_optional: return UserCredentials( email = '', diff --git a/python/test/test_user_info.py b/python/test/test_user_info.py index 55fc4d74..89800932 100644 --- a/python/test/test_user_info.py +++ b/python/test/test_user_info.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.user_info import UserInfo # noqa: E501 +from geoengine_openapi_client.models.user_info import UserInfo class TestUserInfo(unittest.TestCase): """UserInfo unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UserInfo: """Test UserInfo - include_option is a boolean, when False only required + include_optional 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 `UserInfo` """ - model = UserInfo() # noqa: E501 + model = UserInfo() if include_optional: return UserInfo( email = '', diff --git a/python/test/test_user_registration.py b/python/test/test_user_registration.py index 14248155..640869ba 100644 --- a/python/test/test_user_registration.py +++ b/python/test/test_user_registration.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.user_registration import UserRegistration # noqa: E501 +from geoengine_openapi_client.models.user_registration import UserRegistration class TestUserRegistration(unittest.TestCase): """UserRegistration unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UserRegistration: """Test UserRegistration - include_option is a boolean, when False only required + include_optional 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 `UserRegistration` """ - model = UserRegistration() # noqa: E501 + model = UserRegistration() if include_optional: return UserRegistration( email = '', diff --git a/python/test/test_user_session.py b/python/test/test_user_session.py index d17c4dc6..1f2ec33b 100644 --- a/python/test/test_user_session.py +++ b/python/test/test_user_session.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.user_session import UserSession # noqa: E501 +from geoengine_openapi_client.models.user_session import UserSession class TestUserSession(unittest.TestCase): """UserSession unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> UserSession: """Test UserSession - include_option is a boolean, when False only required + include_optional 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 `UserSession` """ - model = UserSession() # noqa: E501 + model = UserSession() if include_optional: return UserSession( created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), diff --git a/python/test/test_vector_column_info.py b/python/test/test_vector_column_info.py index a24a3ae7..1868cf7d 100644 --- a/python/test/test_vector_column_info.py +++ b/python/test/test_vector_column_info.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.vector_column_info import VectorColumnInfo # noqa: E501 +from geoengine_openapi_client.models.vector_column_info import VectorColumnInfo class TestVectorColumnInfo(unittest.TestCase): """VectorColumnInfo unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> VectorColumnInfo: """Test VectorColumnInfo - include_option is a boolean, when False only required + include_optional 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 `VectorColumnInfo` """ - model = VectorColumnInfo() # noqa: E501 + model = VectorColumnInfo() if include_optional: return VectorColumnInfo( data_type = 'category', diff --git a/python/test/test_vector_data_type.py b/python/test/test_vector_data_type.py index 5858c17f..85b30254 100644 --- a/python/test/test_vector_data_type.py +++ b/python/test/test_vector_data_type.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.vector_data_type import VectorDataType # noqa: E501 +from geoengine_openapi_client.models.vector_data_type import VectorDataType class TestVectorDataType(unittest.TestCase): """VectorDataType unit test stubs""" diff --git a/python/test/test_vector_query_rectangle.py b/python/test/test_vector_query_rectangle.py index 49a2e3a9..ab67ac7a 100644 --- a/python/test/test_vector_query_rectangle.py +++ b/python/test/test_vector_query_rectangle.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.vector_query_rectangle import VectorQueryRectangle # noqa: E501 +from geoengine_openapi_client.models.vector_query_rectangle import VectorQueryRectangle class TestVectorQueryRectangle(unittest.TestCase): """VectorQueryRectangle unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> VectorQueryRectangle: """Test VectorQueryRectangle - include_option is a boolean, when False only required + include_optional 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 `VectorQueryRectangle` """ - model = VectorQueryRectangle() # noqa: E501 + model = VectorQueryRectangle() if include_optional: return VectorQueryRectangle( spatial_bounds = geoengine_openapi_client.models.bounding_box2_d.BoundingBox2D( diff --git a/python/test/test_vector_result_descriptor.py b/python/test/test_vector_result_descriptor.py index b850e4d9..3b2ee847 100644 --- a/python/test/test_vector_result_descriptor.py +++ b/python/test/test_vector_result_descriptor.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.vector_result_descriptor import VectorResultDescriptor # noqa: E501 +from geoengine_openapi_client.models.vector_result_descriptor import VectorResultDescriptor class TestVectorResultDescriptor(unittest.TestCase): """VectorResultDescriptor unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> VectorResultDescriptor: """Test VectorResultDescriptor - include_option is a boolean, when False only required + include_optional 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 `VectorResultDescriptor` """ - model = VectorResultDescriptor() # noqa: E501 + model = VectorResultDescriptor() if include_optional: return VectorResultDescriptor( bbox = geoengine_openapi_client.models.bounding_box2_d.BoundingBox2D( diff --git a/python/test/test_volume.py b/python/test/test_volume.py index a202f8f9..441d041f 100644 --- a/python/test/test_volume.py +++ b/python/test/test_volume.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.volume import Volume # noqa: E501 +from geoengine_openapi_client.models.volume import Volume class TestVolume(unittest.TestCase): """Volume unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Volume: """Test Volume - include_option is a boolean, when False only required + include_optional 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 `Volume` """ - model = Volume() # noqa: E501 + model = Volume() if include_optional: return Volume( name = '', diff --git a/python/test/test_volume_file_layers_response.py b/python/test/test_volume_file_layers_response.py index 1519ef81..a1f8f1d1 100644 --- a/python/test/test_volume_file_layers_response.py +++ b/python/test/test_volume_file_layers_response.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.volume_file_layers_response import VolumeFileLayersResponse # noqa: E501 +from geoengine_openapi_client.models.volume_file_layers_response import VolumeFileLayersResponse class TestVolumeFileLayersResponse(unittest.TestCase): """VolumeFileLayersResponse unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> VolumeFileLayersResponse: """Test VolumeFileLayersResponse - include_option is a boolean, when False only required + include_optional 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 `VolumeFileLayersResponse` """ - model = VolumeFileLayersResponse() # noqa: E501 + model = VolumeFileLayersResponse() if include_optional: return VolumeFileLayersResponse( layers = [ diff --git a/python/test/test_wcs_boundingbox.py b/python/test/test_wcs_boundingbox.py index 5d0e40e8..140c39da 100644 --- a/python/test/test_wcs_boundingbox.py +++ b/python/test/test_wcs_boundingbox.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.wcs_boundingbox import WcsBoundingbox # noqa: E501 +from geoengine_openapi_client.models.wcs_boundingbox import WcsBoundingbox class TestWcsBoundingbox(unittest.TestCase): """WcsBoundingbox unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> WcsBoundingbox: """Test WcsBoundingbox - include_option is a boolean, when False only required + include_optional 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 `WcsBoundingbox` """ - model = WcsBoundingbox() # noqa: E501 + model = WcsBoundingbox() if include_optional: return WcsBoundingbox( bbox = [ diff --git a/python/test/test_wcs_service.py b/python/test/test_wcs_service.py index c9328602..a674a633 100644 --- a/python/test/test_wcs_service.py +++ b/python/test/test_wcs_service.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.wcs_service import WcsService # noqa: E501 +from geoengine_openapi_client.models.wcs_service import WcsService class TestWcsService(unittest.TestCase): """WcsService unit test stubs""" diff --git a/python/test/test_wcs_version.py b/python/test/test_wcs_version.py index 2d5802ff..43a8e08f 100644 --- a/python/test/test_wcs_version.py +++ b/python/test/test_wcs_version.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.wcs_version import WcsVersion # noqa: E501 +from geoengine_openapi_client.models.wcs_version import WcsVersion class TestWcsVersion(unittest.TestCase): """WcsVersion unit test stubs""" diff --git a/python/test/test_wfs_service.py b/python/test/test_wfs_service.py index b8619dbb..94297d93 100644 --- a/python/test/test_wfs_service.py +++ b/python/test/test_wfs_service.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.wfs_service import WfsService # noqa: E501 +from geoengine_openapi_client.models.wfs_service import WfsService class TestWfsService(unittest.TestCase): """WfsService unit test stubs""" diff --git a/python/test/test_wfs_version.py b/python/test/test_wfs_version.py index a9df7529..377dcabd 100644 --- a/python/test/test_wfs_version.py +++ b/python/test/test_wfs_version.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.wfs_version import WfsVersion # noqa: E501 +from geoengine_openapi_client.models.wfs_version import WfsVersion class TestWfsVersion(unittest.TestCase): """WfsVersion unit test stubs""" diff --git a/python/test/test_wms_service.py b/python/test/test_wms_service.py index bbb5e126..9e94c03e 100644 --- a/python/test/test_wms_service.py +++ b/python/test/test_wms_service.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.wms_service import WmsService # noqa: E501 +from geoengine_openapi_client.models.wms_service import WmsService class TestWmsService(unittest.TestCase): """WmsService unit test stubs""" diff --git a/python/test/test_wms_version.py b/python/test/test_wms_version.py index eb3b5189..d53cd4bf 100644 --- a/python/test/test_wms_version.py +++ b/python/test/test_wms_version.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.wms_version import WmsVersion # noqa: E501 +from geoengine_openapi_client.models.wms_version import WmsVersion class TestWmsVersion(unittest.TestCase): """WmsVersion unit test stubs""" diff --git a/python/test/test_workflow.py b/python/test/test_workflow.py index 50293e40..848700de 100644 --- a/python/test/test_workflow.py +++ b/python/test/test_workflow.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.workflow import Workflow # noqa: E501 +from geoengine_openapi_client.models.workflow import Workflow class TestWorkflow(unittest.TestCase): """Workflow unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> Workflow: """Test Workflow - include_option is a boolean, when False only required + include_optional 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 `Workflow` """ - model = Workflow() # noqa: E501 + model = Workflow() if include_optional: return Workflow( operator = geoengine_openapi_client.models.typed_operator_operator.TypedOperator_operator( diff --git a/python/test/test_workflows_api.py b/python/test/test_workflows_api.py index fbdd0236..5f1d59cd 100644 --- a/python/test/test_workflows_api.py +++ b/python/test/test_workflows_api.py @@ -15,14 +15,14 @@ import unittest -from geoengine_openapi_client.api.workflows_api import WorkflowsApi # noqa: E501 +from geoengine_openapi_client.api.workflows_api import WorkflowsApi class TestWorkflowsApi(unittest.TestCase): """WorkflowsApi unit test stubs""" def setUp(self) -> None: - self.api = WorkflowsApi() # noqa: E501 + self.api = WorkflowsApi() def tearDown(self) -> None: pass @@ -30,49 +30,49 @@ def tearDown(self) -> None: def test_dataset_from_workflow_handler(self) -> None: """Test case for dataset_from_workflow_handler - Create a task for creating a new dataset from the result of the workflow given by its `id` and the dataset parameters in the request body. # noqa: E501 + Create a task for creating a new dataset from the result of the workflow given by its `id` and the dataset parameters in the request body. """ pass def test_get_workflow_all_metadata_zip_handler(self) -> None: """Test case for get_workflow_all_metadata_zip_handler - Gets a ZIP archive of the worklow, its provenance and the output metadata. # noqa: E501 + Gets a ZIP archive of the worklow, its provenance and the output metadata. """ pass def test_get_workflow_metadata_handler(self) -> None: """Test case for get_workflow_metadata_handler - Gets the metadata of a workflow # noqa: E501 + Gets the metadata of a workflow """ pass def test_get_workflow_provenance_handler(self) -> None: """Test case for get_workflow_provenance_handler - Gets the provenance of all datasets used in a workflow. # noqa: E501 + Gets the provenance of all datasets used in a workflow. """ pass def test_load_workflow_handler(self) -> None: """Test case for load_workflow_handler - Retrieves an existing Workflow. # noqa: E501 + Retrieves an existing Workflow. """ pass def test_raster_stream_websocket(self) -> None: """Test case for raster_stream_websocket - Query a workflow raster result as a stream of tiles via a websocket connection. # noqa: E501 + Query a workflow raster result as a stream of tiles via a websocket connection. """ pass def test_register_workflow_handler(self) -> None: """Test case for register_workflow_handler - Registers a new Workflow. # noqa: E501 + Registers a new Workflow. """ pass diff --git a/python/test/test_wrapped_plot_output.py b/python/test/test_wrapped_plot_output.py index 9ff6d690..a798da80 100644 --- a/python/test/test_wrapped_plot_output.py +++ b/python/test/test_wrapped_plot_output.py @@ -14,9 +14,8 @@ import unittest -import datetime -from geoengine_openapi_client.models.wrapped_plot_output import WrappedPlotOutput # noqa: E501 +from geoengine_openapi_client.models.wrapped_plot_output import WrappedPlotOutput class TestWrappedPlotOutput(unittest.TestCase): """WrappedPlotOutput unit test stubs""" @@ -29,12 +28,12 @@ def tearDown(self): def make_instance(self, include_optional) -> WrappedPlotOutput: """Test WrappedPlotOutput - include_option is a boolean, when False only required + include_optional 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 `WrappedPlotOutput` """ - model = WrappedPlotOutput() # noqa: E501 + model = WrappedPlotOutput() if include_optional: return WrappedPlotOutput( data = None, diff --git a/typescript/README.md b/typescript/README.md index 5e314056..25abd680 100644 --- a/typescript/README.md +++ b/typescript/README.md @@ -1,4 +1,4 @@ -## @geoengine/openapi-client@0.0.20 +## @geoengine/openapi-client@0.0.21 This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: @@ -15,7 +15,7 @@ Module system * CommonJS * ES6 module system -It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) +It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)) ### Building @@ -27,7 +27,7 @@ npm run build ### Publishing -First build the package then run ```npm publish``` +First build the package then run `npm publish` ### Consuming @@ -36,10 +36,11 @@ navigate to the folder of your consuming project and run one of the following co _published:_ ``` -npm install @geoengine/openapi-client@0.0.20 --save +npm install @geoengine/openapi-client@0.0.21 --save ``` _unPublished (not recommended):_ ``` npm install PATH_TO_GENERATED_PACKAGE --save +``` diff --git a/typescript/dist/apis/DatasetsApi.js b/typescript/dist/apis/DatasetsApi.js index 23fac7ea..3711af98 100644 --- a/typescript/dist/apis/DatasetsApi.js +++ b/typescript/dist/apis/DatasetsApi.js @@ -35,8 +35,8 @@ class DatasetsApi extends runtime.BaseAPI { */ autoCreateDatasetHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.autoCreateDataset === null || requestParameters.autoCreateDataset === undefined) { - throw new runtime.RequiredError('autoCreateDataset', 'Required parameter requestParameters.autoCreateDataset was null or undefined when calling autoCreateDatasetHandler.'); + if (requestParameters['autoCreateDataset'] == null) { + throw new runtime.RequiredError('autoCreateDataset', 'Required parameter "autoCreateDataset" was null or undefined when calling autoCreateDatasetHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -53,7 +53,7 @@ class DatasetsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.AutoCreateDatasetToJSON)(requestParameters.autoCreateDataset), + body: (0, index_1.AutoCreateDatasetToJSON)(requestParameters['autoCreateDataset']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateDatasetHandler200ResponseFromJSON)(jsonValue)); }); @@ -74,8 +74,8 @@ class DatasetsApi extends runtime.BaseAPI { */ createDatasetHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.createDataset === null || requestParameters.createDataset === undefined) { - throw new runtime.RequiredError('createDataset', 'Required parameter requestParameters.createDataset was null or undefined when calling createDatasetHandler.'); + if (requestParameters['createDataset'] == null) { + throw new runtime.RequiredError('createDataset', 'Required parameter "createDataset" was null or undefined when calling createDatasetHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -92,7 +92,7 @@ class DatasetsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.CreateDatasetToJSON)(requestParameters.createDataset), + body: (0, index_1.CreateDatasetToJSON)(requestParameters['createDataset']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateDatasetHandler200ResponseFromJSON)(jsonValue)); }); @@ -112,8 +112,8 @@ class DatasetsApi extends runtime.BaseAPI { */ deleteDatasetHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling deleteDatasetHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling deleteDatasetHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -125,7 +125,7 @@ class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -146,8 +146,8 @@ class DatasetsApi extends runtime.BaseAPI { */ getDatasetHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling getDatasetHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling getDatasetHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -159,7 +159,7 @@ class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -181,8 +181,8 @@ class DatasetsApi extends runtime.BaseAPI { */ getLoadingInfoHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling getLoadingInfoHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling getLoadingInfoHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -194,7 +194,7 @@ class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -216,30 +216,30 @@ class DatasetsApi extends runtime.BaseAPI { */ listDatasetsHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.order === null || requestParameters.order === undefined) { - throw new runtime.RequiredError('order', 'Required parameter requestParameters.order was null or undefined when calling listDatasetsHandler.'); + if (requestParameters['order'] == null) { + throw new runtime.RequiredError('order', 'Required parameter "order" was null or undefined when calling listDatasetsHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling listDatasetsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling listDatasetsHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling listDatasetsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling listDatasetsHandler().'); } const queryParameters = {}; - if (requestParameters.filter !== undefined) { - queryParameters['filter'] = requestParameters.filter; + if (requestParameters['filter'] != null) { + queryParameters['filter'] = requestParameters['filter']; } - if (requestParameters.order !== undefined) { - queryParameters['order'] = requestParameters.order; + if (requestParameters['order'] != null) { + queryParameters['order'] = requestParameters['order']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.tags) { - queryParameters['tags'] = requestParameters.tags; + if (requestParameters['tags'] != null) { + queryParameters['tags'] = requestParameters['tags']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -272,11 +272,11 @@ class DatasetsApi extends runtime.BaseAPI { */ listVolumeFileLayersHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.volumeName === null || requestParameters.volumeName === undefined) { - throw new runtime.RequiredError('volumeName', 'Required parameter requestParameters.volumeName was null or undefined when calling listVolumeFileLayersHandler.'); + if (requestParameters['volumeName'] == null) { + throw new runtime.RequiredError('volumeName', 'Required parameter "volumeName" was null or undefined when calling listVolumeFileLayersHandler().'); } - if (requestParameters.fileName === null || requestParameters.fileName === undefined) { - throw new runtime.RequiredError('fileName', 'Required parameter requestParameters.fileName was null or undefined when calling listVolumeFileLayersHandler.'); + if (requestParameters['fileName'] == null) { + throw new runtime.RequiredError('fileName', 'Required parameter "fileName" was null or undefined when calling listVolumeFileLayersHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -288,7 +288,7 @@ class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/volumes/{volume_name}/files/{file_name}/layers`.replace(`{${"volume_name"}}`, encodeURIComponent(String(requestParameters.volumeName))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters.fileName))), + path: `/dataset/volumes/{volume_name}/files/{file_name}/layers`.replace(`{${"volume_name"}}`, encodeURIComponent(String(requestParameters['volumeName']))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters['fileName']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -343,8 +343,8 @@ class DatasetsApi extends runtime.BaseAPI { */ suggestMetaDataHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.suggestMetaData === null || requestParameters.suggestMetaData === undefined) { - throw new runtime.RequiredError('suggestMetaData', 'Required parameter requestParameters.suggestMetaData was null or undefined when calling suggestMetaDataHandler.'); + if (requestParameters['suggestMetaData'] == null) { + throw new runtime.RequiredError('suggestMetaData', 'Required parameter "suggestMetaData" was null or undefined when calling suggestMetaDataHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -361,7 +361,7 @@ class DatasetsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.SuggestMetaDataToJSON)(requestParameters.suggestMetaData), + body: (0, index_1.SuggestMetaDataToJSON)(requestParameters['suggestMetaData']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.MetaDataSuggestionFromJSON)(jsonValue)); }); @@ -381,11 +381,11 @@ class DatasetsApi extends runtime.BaseAPI { */ updateDatasetHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling updateDatasetHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling updateDatasetHandler().'); } - if (requestParameters.updateDataset === null || requestParameters.updateDataset === undefined) { - throw new runtime.RequiredError('updateDataset', 'Required parameter requestParameters.updateDataset was null or undefined when calling updateDatasetHandler.'); + if (requestParameters['updateDataset'] == null) { + throw new runtime.RequiredError('updateDataset', 'Required parameter "updateDataset" was null or undefined when calling updateDatasetHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -398,11 +398,11 @@ class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.UpdateDatasetToJSON)(requestParameters.updateDataset), + body: (0, index_1.UpdateDatasetToJSON)(requestParameters['updateDataset']), }, initOverrides); return new runtime.VoidApiResponse(response); }); @@ -419,11 +419,11 @@ class DatasetsApi extends runtime.BaseAPI { */ updateDatasetProvenanceHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling updateDatasetProvenanceHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling updateDatasetProvenanceHandler().'); } - if (requestParameters.provenances === null || requestParameters.provenances === undefined) { - throw new runtime.RequiredError('provenances', 'Required parameter requestParameters.provenances was null or undefined when calling updateDatasetProvenanceHandler.'); + if (requestParameters['provenances'] == null) { + throw new runtime.RequiredError('provenances', 'Required parameter "provenances" was null or undefined when calling updateDatasetProvenanceHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -436,11 +436,11 @@ class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}/provenance`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/provenance`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: (0, index_1.ProvenancesToJSON)(requestParameters.provenances), + body: (0, index_1.ProvenancesToJSON)(requestParameters['provenances']), }, initOverrides); return new runtime.VoidApiResponse(response); }); @@ -457,11 +457,11 @@ class DatasetsApi extends runtime.BaseAPI { */ updateDatasetSymbologyHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling updateDatasetSymbologyHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling updateDatasetSymbologyHandler().'); } - if (requestParameters.symbology === null || requestParameters.symbology === undefined) { - throw new runtime.RequiredError('symbology', 'Required parameter requestParameters.symbology was null or undefined when calling updateDatasetSymbologyHandler.'); + if (requestParameters['symbology'] == null) { + throw new runtime.RequiredError('symbology', 'Required parameter "symbology" was null or undefined when calling updateDatasetSymbologyHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -474,11 +474,11 @@ class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: (0, index_1.SymbologyToJSON)(requestParameters.symbology), + body: (0, index_1.SymbologyToJSON)(requestParameters['symbology']), }, initOverrides); return new runtime.VoidApiResponse(response); }); @@ -496,11 +496,11 @@ class DatasetsApi extends runtime.BaseAPI { */ updateLoadingInfoHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling updateLoadingInfoHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling updateLoadingInfoHandler().'); } - if (requestParameters.metaDataDefinition === null || requestParameters.metaDataDefinition === undefined) { - throw new runtime.RequiredError('metaDataDefinition', 'Required parameter requestParameters.metaDataDefinition was null or undefined when calling updateLoadingInfoHandler.'); + if (requestParameters['metaDataDefinition'] == null) { + throw new runtime.RequiredError('metaDataDefinition', 'Required parameter "metaDataDefinition" was null or undefined when calling updateLoadingInfoHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -513,11 +513,11 @@ class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: (0, index_1.MetaDataDefinitionToJSON)(requestParameters.metaDataDefinition), + body: (0, index_1.MetaDataDefinitionToJSON)(requestParameters['metaDataDefinition']), }, initOverrides); return new runtime.VoidApiResponse(response); }); diff --git a/typescript/dist/apis/LayersApi.js b/typescript/dist/apis/LayersApi.js index 8dc0068f..98960280 100644 --- a/typescript/dist/apis/LayersApi.js +++ b/typescript/dist/apis/LayersApi.js @@ -34,11 +34,11 @@ class LayersApi extends runtime.BaseAPI { */ addCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling addCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling addCollection().'); } - if (requestParameters.addLayerCollection === null || requestParameters.addLayerCollection === undefined) { - throw new runtime.RequiredError('addLayerCollection', 'Required parameter requestParameters.addLayerCollection was null or undefined when calling addCollection.'); + if (requestParameters['addLayerCollection'] == null) { + throw new runtime.RequiredError('addLayerCollection', 'Required parameter "addLayerCollection" was null or undefined when calling addCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -51,11 +51,11 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}/collections`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}/collections`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.AddLayerCollectionToJSON)(requestParameters.addLayerCollection), + body: (0, index_1.AddLayerCollectionToJSON)(requestParameters['addLayerCollection']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AddCollection200ResponseFromJSON)(jsonValue)); }); @@ -74,11 +74,11 @@ class LayersApi extends runtime.BaseAPI { */ addExistingCollectionToCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.parent === null || requestParameters.parent === undefined) { - throw new runtime.RequiredError('parent', 'Required parameter requestParameters.parent was null or undefined when calling addExistingCollectionToCollection.'); + if (requestParameters['parent'] == null) { + throw new runtime.RequiredError('parent', 'Required parameter "parent" was null or undefined when calling addExistingCollectionToCollection().'); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling addExistingCollectionToCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling addExistingCollectionToCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -90,7 +90,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters.parent))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters['parent']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -111,11 +111,11 @@ class LayersApi extends runtime.BaseAPI { */ addExistingLayerToCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling addExistingLayerToCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling addExistingLayerToCollection().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling addExistingLayerToCollection.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling addExistingLayerToCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -127,7 +127,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -148,11 +148,11 @@ class LayersApi extends runtime.BaseAPI { */ addLayerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling addLayer.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling addLayer().'); } - if (requestParameters.addLayer === null || requestParameters.addLayer === undefined) { - throw new runtime.RequiredError('addLayer', 'Required parameter requestParameters.addLayer was null or undefined when calling addLayer.'); + if (requestParameters['addLayer'] == null) { + throw new runtime.RequiredError('addLayer', 'Required parameter "addLayer" was null or undefined when calling addLayer().'); } const queryParameters = {}; const headerParameters = {}; @@ -165,11 +165,11 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}/layers`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}/layers`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.AddLayerToJSON)(requestParameters.addLayer), + body: (0, index_1.AddLayerToJSON)(requestParameters['addLayer']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AddCollection200ResponseFromJSON)(jsonValue)); }); @@ -188,36 +188,36 @@ class LayersApi extends runtime.BaseAPI { */ autocompleteHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling autocompleteHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling autocompleteHandler().'); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling autocompleteHandler.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling autocompleteHandler().'); } - if (requestParameters.searchType === null || requestParameters.searchType === undefined) { - throw new runtime.RequiredError('searchType', 'Required parameter requestParameters.searchType was null or undefined when calling autocompleteHandler.'); + if (requestParameters['searchType'] == null) { + throw new runtime.RequiredError('searchType', 'Required parameter "searchType" was null or undefined when calling autocompleteHandler().'); } - if (requestParameters.searchString === null || requestParameters.searchString === undefined) { - throw new runtime.RequiredError('searchString', 'Required parameter requestParameters.searchString was null or undefined when calling autocompleteHandler.'); + if (requestParameters['searchString'] == null) { + throw new runtime.RequiredError('searchString', 'Required parameter "searchString" was null or undefined when calling autocompleteHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling autocompleteHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling autocompleteHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling autocompleteHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling autocompleteHandler().'); } const queryParameters = {}; - if (requestParameters.searchType !== undefined) { - queryParameters['searchType'] = requestParameters.searchType; + if (requestParameters['searchType'] != null) { + queryParameters['searchType'] = requestParameters['searchType']; } - if (requestParameters.searchString !== undefined) { - queryParameters['searchString'] = requestParameters.searchString; + if (requestParameters['searchString'] != null) { + queryParameters['searchString'] = requestParameters['searchString']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -228,7 +228,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/collections/search/autocomplete/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layers/collections/search/autocomplete/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -250,11 +250,11 @@ class LayersApi extends runtime.BaseAPI { */ layerHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling layerHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling layerHandler().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling layerHandler.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling layerHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -266,7 +266,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/{provider}/{layer}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layers/{provider}/{layer}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -288,11 +288,11 @@ class LayersApi extends runtime.BaseAPI { */ layerToDatasetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling layerToDataset.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling layerToDataset().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling layerToDataset.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling layerToDataset().'); } const queryParameters = {}; const headerParameters = {}; @@ -304,7 +304,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/{provider}/{layer}/dataset`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layers/{provider}/{layer}/dataset`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -326,11 +326,11 @@ class LayersApi extends runtime.BaseAPI { */ layerToWorkflowIdHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling layerToWorkflowIdHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling layerToWorkflowIdHandler().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling layerToWorkflowIdHandler.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling layerToWorkflowIdHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -342,7 +342,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/{provider}/{layer}/workflowId`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layers/{provider}/{layer}/workflowId`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -364,24 +364,24 @@ class LayersApi extends runtime.BaseAPI { */ listCollectionHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling listCollectionHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling listCollectionHandler().'); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling listCollectionHandler.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling listCollectionHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling listCollectionHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling listCollectionHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling listCollectionHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling listCollectionHandler().'); } const queryParameters = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -392,7 +392,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/collections/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layers/collections/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -414,18 +414,18 @@ class LayersApi extends runtime.BaseAPI { */ listRootCollectionsHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling listRootCollectionsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling listRootCollectionsHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling listRootCollectionsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling listRootCollectionsHandler().'); } const queryParameters = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -457,8 +457,8 @@ class LayersApi extends runtime.BaseAPI { */ providerCapabilitiesHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling providerCapabilitiesHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling providerCapabilitiesHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -470,7 +470,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/{provider}/capabilities`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))), + path: `/layers/{provider}/capabilities`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -491,8 +491,8 @@ class LayersApi extends runtime.BaseAPI { */ removeCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling removeCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling removeCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -504,7 +504,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -525,11 +525,11 @@ class LayersApi extends runtime.BaseAPI { */ removeCollectionFromCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.parent === null || requestParameters.parent === undefined) { - throw new runtime.RequiredError('parent', 'Required parameter requestParameters.parent was null or undefined when calling removeCollectionFromCollection.'); + if (requestParameters['parent'] == null) { + throw new runtime.RequiredError('parent', 'Required parameter "parent" was null or undefined when calling removeCollectionFromCollection().'); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling removeCollectionFromCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling removeCollectionFromCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -541,7 +541,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters.parent))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters['parent']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -562,8 +562,8 @@ class LayersApi extends runtime.BaseAPI { */ removeLayerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling removeLayer.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling removeLayer().'); } const queryParameters = {}; const headerParameters = {}; @@ -575,7 +575,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -596,11 +596,11 @@ class LayersApi extends runtime.BaseAPI { */ removeLayerFromCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling removeLayerFromCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling removeLayerFromCollection().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling removeLayerFromCollection.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling removeLayerFromCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -612,7 +612,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -633,36 +633,36 @@ class LayersApi extends runtime.BaseAPI { */ searchHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling searchHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling searchHandler().'); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling searchHandler.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling searchHandler().'); } - if (requestParameters.searchType === null || requestParameters.searchType === undefined) { - throw new runtime.RequiredError('searchType', 'Required parameter requestParameters.searchType was null or undefined when calling searchHandler.'); + if (requestParameters['searchType'] == null) { + throw new runtime.RequiredError('searchType', 'Required parameter "searchType" was null or undefined when calling searchHandler().'); } - if (requestParameters.searchString === null || requestParameters.searchString === undefined) { - throw new runtime.RequiredError('searchString', 'Required parameter requestParameters.searchString was null or undefined when calling searchHandler.'); + if (requestParameters['searchString'] == null) { + throw new runtime.RequiredError('searchString', 'Required parameter "searchString" was null or undefined when calling searchHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling searchHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling searchHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling searchHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling searchHandler().'); } const queryParameters = {}; - if (requestParameters.searchType !== undefined) { - queryParameters['searchType'] = requestParameters.searchType; + if (requestParameters['searchType'] != null) { + queryParameters['searchType'] = requestParameters['searchType']; } - if (requestParameters.searchString !== undefined) { - queryParameters['searchString'] = requestParameters.searchString; + if (requestParameters['searchString'] != null) { + queryParameters['searchString'] = requestParameters['searchString']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -673,7 +673,7 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/collections/search/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layers/collections/search/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -695,11 +695,11 @@ class LayersApi extends runtime.BaseAPI { */ updateCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling updateCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling updateCollection().'); } - if (requestParameters.updateLayerCollection === null || requestParameters.updateLayerCollection === undefined) { - throw new runtime.RequiredError('updateLayerCollection', 'Required parameter requestParameters.updateLayerCollection was null or undefined when calling updateCollection.'); + if (requestParameters['updateLayerCollection'] == null) { + throw new runtime.RequiredError('updateLayerCollection', 'Required parameter "updateLayerCollection" was null or undefined when calling updateCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -712,11 +712,11 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: (0, index_1.UpdateLayerCollectionToJSON)(requestParameters.updateLayerCollection), + body: (0, index_1.UpdateLayerCollectionToJSON)(requestParameters['updateLayerCollection']), }, initOverrides); return new runtime.VoidApiResponse(response); }); @@ -734,11 +734,11 @@ class LayersApi extends runtime.BaseAPI { */ updateLayerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling updateLayer.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling updateLayer().'); } - if (requestParameters.updateLayer === null || requestParameters.updateLayer === undefined) { - throw new runtime.RequiredError('updateLayer', 'Required parameter requestParameters.updateLayer was null or undefined when calling updateLayer.'); + if (requestParameters['updateLayer'] == null) { + throw new runtime.RequiredError('updateLayer', 'Required parameter "updateLayer" was null or undefined when calling updateLayer().'); } const queryParameters = {}; const headerParameters = {}; @@ -751,11 +751,11 @@ class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: (0, index_1.UpdateLayerToJSON)(requestParameters.updateLayer), + body: (0, index_1.UpdateLayerToJSON)(requestParameters['updateLayer']), }, initOverrides); return new runtime.VoidApiResponse(response); }); diff --git a/typescript/dist/apis/MLApi.js b/typescript/dist/apis/MLApi.js index 8dde57d7..688dce93 100644 --- a/typescript/dist/apis/MLApi.js +++ b/typescript/dist/apis/MLApi.js @@ -34,8 +34,8 @@ class MLApi extends runtime.BaseAPI { */ addMlModelRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.mlModel === null || requestParameters.mlModel === undefined) { - throw new runtime.RequiredError('mlModel', 'Required parameter requestParameters.mlModel was null or undefined when calling addMlModel.'); + if (requestParameters['mlModel'] == null) { + throw new runtime.RequiredError('mlModel', 'Required parameter "mlModel" was null or undefined when calling addMlModel().'); } const queryParameters = {}; const headerParameters = {}; @@ -52,7 +52,7 @@ class MLApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.MlModelToJSON)(requestParameters.mlModel), + body: (0, index_1.MlModelToJSON)(requestParameters['mlModel']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.MlModelNameResponseFromJSON)(jsonValue)); }); @@ -71,8 +71,8 @@ class MLApi extends runtime.BaseAPI { */ getMlModelRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.modelName === null || requestParameters.modelName === undefined) { - throw new runtime.RequiredError('modelName', 'Required parameter requestParameters.modelName was null or undefined when calling getMlModel.'); + if (requestParameters['modelName'] == null) { + throw new runtime.RequiredError('modelName', 'Required parameter "modelName" was null or undefined when calling getMlModel().'); } const queryParameters = {}; const headerParameters = {}; @@ -84,7 +84,7 @@ class MLApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/ml/models/{model_name}`.replace(`{${"model_name"}}`, encodeURIComponent(String(requestParameters.modelName))), + path: `/ml/models/{model_name}`.replace(`{${"model_name"}}`, encodeURIComponent(String(requestParameters['modelName']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/apis/OGCWCSApi.js b/typescript/dist/apis/OGCWCSApi.js index c5aaa034..a88dd58d 100644 --- a/typescript/dist/apis/OGCWCSApi.js +++ b/typescript/dist/apis/OGCWCSApi.js @@ -33,24 +33,24 @@ class OGCWCSApi extends runtime.BaseAPI { */ wcsCapabilitiesHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wcsCapabilitiesHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wcsCapabilitiesHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wcsCapabilitiesHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wcsCapabilitiesHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wcsCapabilitiesHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wcsCapabilitiesHandler().'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -61,7 +61,7 @@ class OGCWCSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wcs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wcs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -88,33 +88,33 @@ class OGCWCSApi extends runtime.BaseAPI { */ wcsDescribeCoverageHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wcsDescribeCoverageHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wcsDescribeCoverageHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wcsDescribeCoverageHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wcsDescribeCoverageHandler().'); } - if (requestParameters.identifiers === null || requestParameters.identifiers === undefined) { - throw new runtime.RequiredError('identifiers', 'Required parameter requestParameters.identifiers was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['identifiers'] == null) { + throw new runtime.RequiredError('identifiers', 'Required parameter "identifiers" was null or undefined when calling wcsDescribeCoverageHandler().'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.identifiers !== undefined) { - queryParameters['identifiers'] = requestParameters.identifiers; + if (requestParameters['identifiers'] != null) { + queryParameters['identifiers'] = requestParameters['identifiers']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -125,7 +125,7 @@ class OGCWCSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wcs/{workflow}?request=DescribeCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wcs/{workflow}?request=DescribeCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -152,69 +152,69 @@ class OGCWCSApi extends runtime.BaseAPI { */ wcsGetCoverageHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.format === null || requestParameters.format === undefined) { - throw new runtime.RequiredError('format', 'Required parameter requestParameters.format was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['format'] == null) { + throw new runtime.RequiredError('format', 'Required parameter "format" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.identifier === null || requestParameters.identifier === undefined) { - throw new runtime.RequiredError('identifier', 'Required parameter requestParameters.identifier was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['identifier'] == null) { + throw new runtime.RequiredError('identifier', 'Required parameter "identifier" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.boundingbox === null || requestParameters.boundingbox === undefined) { - throw new runtime.RequiredError('boundingbox', 'Required parameter requestParameters.boundingbox was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['boundingbox'] == null) { + throw new runtime.RequiredError('boundingbox', 'Required parameter "boundingbox" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.gridbasecrs === null || requestParameters.gridbasecrs === undefined) { - throw new runtime.RequiredError('gridbasecrs', 'Required parameter requestParameters.gridbasecrs was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['gridbasecrs'] == null) { + throw new runtime.RequiredError('gridbasecrs', 'Required parameter "gridbasecrs" was null or undefined when calling wcsGetCoverageHandler().'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.format !== undefined) { - queryParameters['format'] = requestParameters.format; + if (requestParameters['format'] != null) { + queryParameters['format'] = requestParameters['format']; } - if (requestParameters.identifier !== undefined) { - queryParameters['identifier'] = requestParameters.identifier; + if (requestParameters['identifier'] != null) { + queryParameters['identifier'] = requestParameters['identifier']; } - if (requestParameters.boundingbox !== undefined) { - queryParameters['boundingbox'] = requestParameters.boundingbox; + if (requestParameters['boundingbox'] != null) { + queryParameters['boundingbox'] = requestParameters['boundingbox']; } - if (requestParameters.gridbasecrs !== undefined) { - queryParameters['gridbasecrs'] = requestParameters.gridbasecrs; + if (requestParameters['gridbasecrs'] != null) { + queryParameters['gridbasecrs'] = requestParameters['gridbasecrs']; } - if (requestParameters.gridorigin !== undefined) { - queryParameters['gridorigin'] = requestParameters.gridorigin; + if (requestParameters['gridorigin'] != null) { + queryParameters['gridorigin'] = requestParameters['gridorigin']; } - if (requestParameters.gridoffsets !== undefined) { - queryParameters['gridoffsets'] = requestParameters.gridoffsets; + if (requestParameters['gridoffsets'] != null) { + queryParameters['gridoffsets'] = requestParameters['gridoffsets']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.resx !== undefined) { - queryParameters['resx'] = requestParameters.resx; + if (requestParameters['resx'] != null) { + queryParameters['resx'] = requestParameters['resx']; } - if (requestParameters.resy !== undefined) { - queryParameters['resy'] = requestParameters.resy; + if (requestParameters['resy'] != null) { + queryParameters['resy'] = requestParameters['resy']; } - if (requestParameters.nodatavalue !== undefined) { - queryParameters['nodatavalue'] = requestParameters.nodatavalue; + if (requestParameters['nodatavalue'] != null) { + queryParameters['nodatavalue'] = requestParameters['nodatavalue']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -225,7 +225,7 @@ class OGCWCSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wcs/{workflow}?request=GetCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wcs/{workflow}?request=GetCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/apis/OGCWFSApi.js b/typescript/dist/apis/OGCWFSApi.js index fb4544ea..ba07c8dd 100644 --- a/typescript/dist/apis/OGCWFSApi.js +++ b/typescript/dist/apis/OGCWFSApi.js @@ -34,17 +34,17 @@ class OGCWFSApi extends runtime.BaseAPI { */ wfsCapabilitiesHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wfsCapabilitiesHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wfsCapabilitiesHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wfsCapabilitiesHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wfsCapabilitiesHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -56,7 +56,7 @@ class OGCWFSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))), + path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters['service']))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters['request']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -83,63 +83,63 @@ class OGCWFSApi extends runtime.BaseAPI { */ wfsFeatureHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wfsFeatureHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wfsFeatureHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wfsFeatureHandler().'); } - if (requestParameters.typeNames === null || requestParameters.typeNames === undefined) { - throw new runtime.RequiredError('typeNames', 'Required parameter requestParameters.typeNames was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['typeNames'] == null) { + throw new runtime.RequiredError('typeNames', 'Required parameter "typeNames" was null or undefined when calling wfsFeatureHandler().'); } - if (requestParameters.bbox === null || requestParameters.bbox === undefined) { - throw new runtime.RequiredError('bbox', 'Required parameter requestParameters.bbox was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['bbox'] == null) { + throw new runtime.RequiredError('bbox', 'Required parameter "bbox" was null or undefined when calling wfsFeatureHandler().'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.typeNames !== undefined) { - queryParameters['typeNames'] = requestParameters.typeNames; + if (requestParameters['typeNames'] != null) { + queryParameters['typeNames'] = requestParameters['typeNames']; } - if (requestParameters.bbox !== undefined) { - queryParameters['bbox'] = requestParameters.bbox; + if (requestParameters['bbox'] != null) { + queryParameters['bbox'] = requestParameters['bbox']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.srsName !== undefined) { - queryParameters['srsName'] = requestParameters.srsName; + if (requestParameters['srsName'] != null) { + queryParameters['srsName'] = requestParameters['srsName']; } - if (requestParameters.namespaces !== undefined) { - queryParameters['namespaces'] = requestParameters.namespaces; + if (requestParameters['namespaces'] != null) { + queryParameters['namespaces'] = requestParameters['namespaces']; } - if (requestParameters.count !== undefined) { - queryParameters['count'] = requestParameters.count; + if (requestParameters['count'] != null) { + queryParameters['count'] = requestParameters['count']; } - if (requestParameters.sortBy !== undefined) { - queryParameters['sortBy'] = requestParameters.sortBy; + if (requestParameters['sortBy'] != null) { + queryParameters['sortBy'] = requestParameters['sortBy']; } - if (requestParameters.resultType !== undefined) { - queryParameters['resultType'] = requestParameters.resultType; + if (requestParameters['resultType'] != null) { + queryParameters['resultType'] = requestParameters['resultType']; } - if (requestParameters.filter !== undefined) { - queryParameters['filter'] = requestParameters.filter; + if (requestParameters['filter'] != null) { + queryParameters['filter'] = requestParameters['filter']; } - if (requestParameters.propertyName !== undefined) { - queryParameters['propertyName'] = requestParameters.propertyName; + if (requestParameters['propertyName'] != null) { + queryParameters['propertyName'] = requestParameters['propertyName']; } - if (requestParameters.queryResolution !== undefined) { - queryParameters['queryResolution'] = requestParameters.queryResolution; + if (requestParameters['queryResolution'] != null) { + queryParameters['queryResolution'] = requestParameters['queryResolution']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -150,7 +150,7 @@ class OGCWFSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wfs/{workflow}?request=GetFeature`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wfs/{workflow}?request=GetFeature`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/apis/OGCWMSApi.js b/typescript/dist/apis/OGCWMSApi.js index 3fb0b8b8..432dbf62 100644 --- a/typescript/dist/apis/OGCWMSApi.js +++ b/typescript/dist/apis/OGCWMSApi.js @@ -33,20 +33,20 @@ class OGCWMSApi extends runtime.BaseAPI { */ wmsCapabilitiesHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wmsCapabilitiesHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wmsCapabilitiesHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wmsCapabilitiesHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wmsCapabilitiesHandler().'); } - if (requestParameters.format === null || requestParameters.format === undefined) { - throw new runtime.RequiredError('format', 'Required parameter requestParameters.format was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['format'] == null) { + throw new runtime.RequiredError('format', 'Required parameter "format" was null or undefined when calling wmsCapabilitiesHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -58,7 +58,7 @@ class OGCWMSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"format"}}`, encodeURIComponent(String(requestParameters.format))), + path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters['service']))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters['request']))).replace(`{${"format"}}`, encodeURIComponent(String(requestParameters['format']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -85,20 +85,20 @@ class OGCWMSApi extends runtime.BaseAPI { */ wmsLegendGraphicHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wmsLegendGraphicHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wmsLegendGraphicHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wmsLegendGraphicHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wmsLegendGraphicHandler().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling wmsLegendGraphicHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -110,7 +110,7 @@ class OGCWMSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters['service']))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters['request']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -131,87 +131,87 @@ class OGCWMSApi extends runtime.BaseAPI { */ wmsMapHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wmsMapHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wmsMapHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wmsMapHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wmsMapHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.width === null || requestParameters.width === undefined) { - throw new runtime.RequiredError('width', 'Required parameter requestParameters.width was null or undefined when calling wmsMapHandler.'); + if (requestParameters['width'] == null) { + throw new runtime.RequiredError('width', 'Required parameter "width" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.height === null || requestParameters.height === undefined) { - throw new runtime.RequiredError('height', 'Required parameter requestParameters.height was null or undefined when calling wmsMapHandler.'); + if (requestParameters['height'] == null) { + throw new runtime.RequiredError('height', 'Required parameter "height" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.bbox === null || requestParameters.bbox === undefined) { - throw new runtime.RequiredError('bbox', 'Required parameter requestParameters.bbox was null or undefined when calling wmsMapHandler.'); + if (requestParameters['bbox'] == null) { + throw new runtime.RequiredError('bbox', 'Required parameter "bbox" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.format === null || requestParameters.format === undefined) { - throw new runtime.RequiredError('format', 'Required parameter requestParameters.format was null or undefined when calling wmsMapHandler.'); + if (requestParameters['format'] == null) { + throw new runtime.RequiredError('format', 'Required parameter "format" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.layers === null || requestParameters.layers === undefined) { - throw new runtime.RequiredError('layers', 'Required parameter requestParameters.layers was null or undefined when calling wmsMapHandler.'); + if (requestParameters['layers'] == null) { + throw new runtime.RequiredError('layers', 'Required parameter "layers" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.styles === null || requestParameters.styles === undefined) { - throw new runtime.RequiredError('styles', 'Required parameter requestParameters.styles was null or undefined when calling wmsMapHandler.'); + if (requestParameters['styles'] == null) { + throw new runtime.RequiredError('styles', 'Required parameter "styles" was null or undefined when calling wmsMapHandler().'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.width !== undefined) { - queryParameters['width'] = requestParameters.width; + if (requestParameters['width'] != null) { + queryParameters['width'] = requestParameters['width']; } - if (requestParameters.height !== undefined) { - queryParameters['height'] = requestParameters.height; + if (requestParameters['height'] != null) { + queryParameters['height'] = requestParameters['height']; } - if (requestParameters.bbox !== undefined) { - queryParameters['bbox'] = requestParameters.bbox; + if (requestParameters['bbox'] != null) { + queryParameters['bbox'] = requestParameters['bbox']; } - if (requestParameters.format !== undefined) { - queryParameters['format'] = requestParameters.format; + if (requestParameters['format'] != null) { + queryParameters['format'] = requestParameters['format']; } - if (requestParameters.layers !== undefined) { - queryParameters['layers'] = requestParameters.layers; + if (requestParameters['layers'] != null) { + queryParameters['layers'] = requestParameters['layers']; } - if (requestParameters.crs !== undefined) { - queryParameters['crs'] = requestParameters.crs; + if (requestParameters['crs'] != null) { + queryParameters['crs'] = requestParameters['crs']; } - if (requestParameters.styles !== undefined) { - queryParameters['styles'] = requestParameters.styles; + if (requestParameters['styles'] != null) { + queryParameters['styles'] = requestParameters['styles']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.transparent !== undefined) { - queryParameters['transparent'] = requestParameters.transparent; + if (requestParameters['transparent'] != null) { + queryParameters['transparent'] = requestParameters['transparent']; } - if (requestParameters.bgcolor !== undefined) { - queryParameters['bgcolor'] = requestParameters.bgcolor; + if (requestParameters['bgcolor'] != null) { + queryParameters['bgcolor'] = requestParameters['bgcolor']; } - if (requestParameters.sld !== undefined) { - queryParameters['sld'] = requestParameters.sld; + if (requestParameters['sld'] != null) { + queryParameters['sld'] = requestParameters['sld']; } - if (requestParameters.sldBody !== undefined) { - queryParameters['sld_body'] = requestParameters.sldBody; + if (requestParameters['sldBody'] != null) { + queryParameters['sld_body'] = requestParameters['sldBody']; } - if (requestParameters.elevation !== undefined) { - queryParameters['elevation'] = requestParameters.elevation; + if (requestParameters['elevation'] != null) { + queryParameters['elevation'] = requestParameters['elevation']; } - if (requestParameters.exceptions !== undefined) { - queryParameters['exceptions'] = requestParameters.exceptions; + if (requestParameters['exceptions'] != null) { + queryParameters['exceptions'] = requestParameters['exceptions']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -222,7 +222,7 @@ class OGCWMSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wms/{workflow}?request=GetMap`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wms/{workflow}?request=GetMap`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/apis/PermissionsApi.js b/typescript/dist/apis/PermissionsApi.js index b9914e4d..9f7c2573 100644 --- a/typescript/dist/apis/PermissionsApi.js +++ b/typescript/dist/apis/PermissionsApi.js @@ -34,8 +34,8 @@ class PermissionsApi extends runtime.BaseAPI { */ addPermissionHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.permissionRequest === null || requestParameters.permissionRequest === undefined) { - throw new runtime.RequiredError('permissionRequest', 'Required parameter requestParameters.permissionRequest was null or undefined when calling addPermissionHandler.'); + if (requestParameters['permissionRequest'] == null) { + throw new runtime.RequiredError('permissionRequest', 'Required parameter "permissionRequest" was null or undefined when calling addPermissionHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -52,7 +52,7 @@ class PermissionsApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: (0, index_1.PermissionRequestToJSON)(requestParameters.permissionRequest), + body: (0, index_1.PermissionRequestToJSON)(requestParameters['permissionRequest']), }, initOverrides); return new runtime.VoidApiResponse(response); }); @@ -70,24 +70,24 @@ class PermissionsApi extends runtime.BaseAPI { */ getResourcePermissionsHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.resourceType === null || requestParameters.resourceType === undefined) { - throw new runtime.RequiredError('resourceType', 'Required parameter requestParameters.resourceType was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['resourceType'] == null) { + throw new runtime.RequiredError('resourceType', 'Required parameter "resourceType" was null or undefined when calling getResourcePermissionsHandler().'); } - if (requestParameters.resourceId === null || requestParameters.resourceId === undefined) { - throw new runtime.RequiredError('resourceId', 'Required parameter requestParameters.resourceId was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['resourceId'] == null) { + throw new runtime.RequiredError('resourceId', 'Required parameter "resourceId" was null or undefined when calling getResourcePermissionsHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling getResourcePermissionsHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling getResourcePermissionsHandler().'); } const queryParameters = {}; - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -98,7 +98,7 @@ class PermissionsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/permissions/resources/{resource_type}/{resource_id}`.replace(`{${"resource_type"}}`, encodeURIComponent(String(requestParameters.resourceType))).replace(`{${"resource_id"}}`, encodeURIComponent(String(requestParameters.resourceId))), + path: `/permissions/resources/{resource_type}/{resource_id}`.replace(`{${"resource_type"}}`, encodeURIComponent(String(requestParameters['resourceType']))).replace(`{${"resource_id"}}`, encodeURIComponent(String(requestParameters['resourceId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -120,8 +120,8 @@ class PermissionsApi extends runtime.BaseAPI { */ removePermissionHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.permissionRequest === null || requestParameters.permissionRequest === undefined) { - throw new runtime.RequiredError('permissionRequest', 'Required parameter requestParameters.permissionRequest was null or undefined when calling removePermissionHandler.'); + if (requestParameters['permissionRequest'] == null) { + throw new runtime.RequiredError('permissionRequest', 'Required parameter "permissionRequest" was null or undefined when calling removePermissionHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -138,7 +138,7 @@ class PermissionsApi extends runtime.BaseAPI { method: 'DELETE', headers: headerParameters, query: queryParameters, - body: (0, index_1.PermissionRequestToJSON)(requestParameters.permissionRequest), + body: (0, index_1.PermissionRequestToJSON)(requestParameters['permissionRequest']), }, initOverrides); return new runtime.VoidApiResponse(response); }); diff --git a/typescript/dist/apis/PlotsApi.js b/typescript/dist/apis/PlotsApi.js index 1f7c538a..512e7bbe 100644 --- a/typescript/dist/apis/PlotsApi.js +++ b/typescript/dist/apis/PlotsApi.js @@ -35,30 +35,30 @@ class PlotsApi extends runtime.BaseAPI { */ getPlotHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.bbox === null || requestParameters.bbox === undefined) { - throw new runtime.RequiredError('bbox', 'Required parameter requestParameters.bbox was null or undefined when calling getPlotHandler.'); + if (requestParameters['bbox'] == null) { + throw new runtime.RequiredError('bbox', 'Required parameter "bbox" was null or undefined when calling getPlotHandler().'); } - if (requestParameters.time === null || requestParameters.time === undefined) { - throw new runtime.RequiredError('time', 'Required parameter requestParameters.time was null or undefined when calling getPlotHandler.'); + if (requestParameters['time'] == null) { + throw new runtime.RequiredError('time', 'Required parameter "time" was null or undefined when calling getPlotHandler().'); } - if (requestParameters.spatialResolution === null || requestParameters.spatialResolution === undefined) { - throw new runtime.RequiredError('spatialResolution', 'Required parameter requestParameters.spatialResolution was null or undefined when calling getPlotHandler.'); + if (requestParameters['spatialResolution'] == null) { + throw new runtime.RequiredError('spatialResolution', 'Required parameter "spatialResolution" was null or undefined when calling getPlotHandler().'); } - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling getPlotHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getPlotHandler().'); } const queryParameters = {}; - if (requestParameters.bbox !== undefined) { - queryParameters['bbox'] = requestParameters.bbox; + if (requestParameters['bbox'] != null) { + queryParameters['bbox'] = requestParameters['bbox']; } - if (requestParameters.crs !== undefined) { - queryParameters['crs'] = requestParameters.crs; + if (requestParameters['crs'] != null) { + queryParameters['crs'] = requestParameters['crs']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.spatialResolution !== undefined) { - queryParameters['spatialResolution'] = requestParameters.spatialResolution; + if (requestParameters['spatialResolution'] != null) { + queryParameters['spatialResolution'] = requestParameters['spatialResolution']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -69,7 +69,7 @@ class PlotsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/plot/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/plot/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/apis/ProjectsApi.js b/typescript/dist/apis/ProjectsApi.js index e00fdc70..0de6245e 100644 --- a/typescript/dist/apis/ProjectsApi.js +++ b/typescript/dist/apis/ProjectsApi.js @@ -34,8 +34,8 @@ class ProjectsApi extends runtime.BaseAPI { */ createProjectHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.createProject === null || requestParameters.createProject === undefined) { - throw new runtime.RequiredError('createProject', 'Required parameter requestParameters.createProject was null or undefined when calling createProjectHandler.'); + if (requestParameters['createProject'] == null) { + throw new runtime.RequiredError('createProject', 'Required parameter "createProject" was null or undefined when calling createProjectHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -52,7 +52,7 @@ class ProjectsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.CreateProjectToJSON)(requestParameters.createProject), + body: (0, index_1.CreateProjectToJSON)(requestParameters['createProject']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AddCollection200ResponseFromJSON)(jsonValue)); }); @@ -71,8 +71,8 @@ class ProjectsApi extends runtime.BaseAPI { */ deleteProjectHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling deleteProjectHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError('project', 'Required parameter "project" was null or undefined when calling deleteProjectHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -84,7 +84,7 @@ class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -105,14 +105,14 @@ class ProjectsApi extends runtime.BaseAPI { */ listProjectsHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.order === null || requestParameters.order === undefined) { - throw new runtime.RequiredError('order', 'Required parameter requestParameters.order was null or undefined when calling listProjectsHandler.'); + if (requestParameters['order'] == null) { + throw new runtime.RequiredError('order', 'Required parameter "order" was null or undefined when calling listProjectsHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling listProjectsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling listProjectsHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling listProjectsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling listProjectsHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -124,7 +124,7 @@ class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/projects`.replace(`{${"order"}}`, encodeURIComponent(String(requestParameters.order))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters.offset))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters.limit))), + path: `/projects`.replace(`{${"order"}}`, encodeURIComponent(String(requestParameters['order']))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters['offset']))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters['limit']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -146,8 +146,8 @@ class ProjectsApi extends runtime.BaseAPI { */ loadProjectLatestHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling loadProjectLatestHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError('project', 'Required parameter "project" was null or undefined when calling loadProjectLatestHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -159,7 +159,7 @@ class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -181,11 +181,11 @@ class ProjectsApi extends runtime.BaseAPI { */ loadProjectVersionHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling loadProjectVersionHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError('project', 'Required parameter "project" was null or undefined when calling loadProjectVersionHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling loadProjectVersionHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling loadProjectVersionHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -197,7 +197,7 @@ class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/project/{project}/{version}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))), + path: `/project/{project}/{version}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -219,8 +219,8 @@ class ProjectsApi extends runtime.BaseAPI { */ projectVersionsHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling projectVersionsHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError('project', 'Required parameter "project" was null or undefined when calling projectVersionsHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -232,7 +232,7 @@ class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/project/{project}/versions`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}/versions`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -255,11 +255,11 @@ class ProjectsApi extends runtime.BaseAPI { */ updateProjectHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling updateProjectHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError('project', 'Required parameter "project" was null or undefined when calling updateProjectHandler().'); } - if (requestParameters.updateProject === null || requestParameters.updateProject === undefined) { - throw new runtime.RequiredError('updateProject', 'Required parameter requestParameters.updateProject was null or undefined when calling updateProjectHandler.'); + if (requestParameters['updateProject'] == null) { + throw new runtime.RequiredError('updateProject', 'Required parameter "updateProject" was null or undefined when calling updateProjectHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -272,11 +272,11 @@ class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'PATCH', headers: headerParameters, query: queryParameters, - body: (0, index_1.UpdateProjectToJSON)(requestParameters.updateProject), + body: (0, index_1.UpdateProjectToJSON)(requestParameters['updateProject']), }, initOverrides); return new runtime.VoidApiResponse(response); }); diff --git a/typescript/dist/apis/SessionApi.js b/typescript/dist/apis/SessionApi.js index e12f83f8..8668ba13 100644 --- a/typescript/dist/apis/SessionApi.js +++ b/typescript/dist/apis/SessionApi.js @@ -59,8 +59,8 @@ class SessionApi extends runtime.BaseAPI { */ loginHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.userCredentials === null || requestParameters.userCredentials === undefined) { - throw new runtime.RequiredError('userCredentials', 'Required parameter requestParameters.userCredentials was null or undefined when calling loginHandler.'); + if (requestParameters['userCredentials'] == null) { + throw new runtime.RequiredError('userCredentials', 'Required parameter "userCredentials" was null or undefined when calling loginHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -70,7 +70,7 @@ class SessionApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.UserCredentialsToJSON)(requestParameters.userCredentials), + body: (0, index_1.UserCredentialsToJSON)(requestParameters['userCredentials']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UserSessionFromJSON)(jsonValue)); }); @@ -121,12 +121,12 @@ class SessionApi extends runtime.BaseAPI { */ oidcInitRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.redirectUri === null || requestParameters.redirectUri === undefined) { - throw new runtime.RequiredError('redirectUri', 'Required parameter requestParameters.redirectUri was null or undefined when calling oidcInit.'); + if (requestParameters['redirectUri'] == null) { + throw new runtime.RequiredError('redirectUri', 'Required parameter "redirectUri" was null or undefined when calling oidcInit().'); } const queryParameters = {}; - if (requestParameters.redirectUri !== undefined) { - queryParameters['redirectUri'] = requestParameters.redirectUri; + if (requestParameters['redirectUri'] != null) { + queryParameters['redirectUri'] = requestParameters['redirectUri']; } const headerParameters = {}; const response = yield this.request({ @@ -154,15 +154,15 @@ class SessionApi extends runtime.BaseAPI { */ oidcLoginRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.redirectUri === null || requestParameters.redirectUri === undefined) { - throw new runtime.RequiredError('redirectUri', 'Required parameter requestParameters.redirectUri was null or undefined when calling oidcLogin.'); + if (requestParameters['redirectUri'] == null) { + throw new runtime.RequiredError('redirectUri', 'Required parameter "redirectUri" was null or undefined when calling oidcLogin().'); } - if (requestParameters.authCodeResponse === null || requestParameters.authCodeResponse === undefined) { - throw new runtime.RequiredError('authCodeResponse', 'Required parameter requestParameters.authCodeResponse was null or undefined when calling oidcLogin.'); + if (requestParameters['authCodeResponse'] == null) { + throw new runtime.RequiredError('authCodeResponse', 'Required parameter "authCodeResponse" was null or undefined when calling oidcLogin().'); } const queryParameters = {}; - if (requestParameters.redirectUri !== undefined) { - queryParameters['redirectUri'] = requestParameters.redirectUri; + if (requestParameters['redirectUri'] != null) { + queryParameters['redirectUri'] = requestParameters['redirectUri']; } const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; @@ -171,7 +171,7 @@ class SessionApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.AuthCodeResponseToJSON)(requestParameters.authCodeResponse), + body: (0, index_1.AuthCodeResponseToJSON)(requestParameters['authCodeResponse']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UserSessionFromJSON)(jsonValue)); }); @@ -191,8 +191,8 @@ class SessionApi extends runtime.BaseAPI { */ registerUserHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.userRegistration === null || requestParameters.userRegistration === undefined) { - throw new runtime.RequiredError('userRegistration', 'Required parameter requestParameters.userRegistration was null or undefined when calling registerUserHandler.'); + if (requestParameters['userRegistration'] == null) { + throw new runtime.RequiredError('userRegistration', 'Required parameter "userRegistration" was null or undefined when calling registerUserHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -202,7 +202,7 @@ class SessionApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.UserRegistrationToJSON)(requestParameters.userRegistration), + body: (0, index_1.UserRegistrationToJSON)(requestParameters['userRegistration']), }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); diff --git a/typescript/dist/apis/SpatialReferencesApi.js b/typescript/dist/apis/SpatialReferencesApi.js index 69dfc01a..f37797e1 100644 --- a/typescript/dist/apis/SpatialReferencesApi.js +++ b/typescript/dist/apis/SpatialReferencesApi.js @@ -33,8 +33,8 @@ class SpatialReferencesApi extends runtime.BaseAPI { */ getSpatialReferenceSpecificationHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.srsString === null || requestParameters.srsString === undefined) { - throw new runtime.RequiredError('srsString', 'Required parameter requestParameters.srsString was null or undefined when calling getSpatialReferenceSpecificationHandler.'); + if (requestParameters['srsString'] == null) { + throw new runtime.RequiredError('srsString', 'Required parameter "srsString" was null or undefined when calling getSpatialReferenceSpecificationHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -46,7 +46,7 @@ class SpatialReferencesApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/spatialReferenceSpecification/{srsString}`.replace(`{${"srsString"}}`, encodeURIComponent(String(requestParameters.srsString))), + path: `/spatialReferenceSpecification/{srsString}`.replace(`{${"srsString"}}`, encodeURIComponent(String(requestParameters['srsString']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/apis/TasksApi.js b/typescript/dist/apis/TasksApi.js index 0bc1ac99..1aac35e6 100644 --- a/typescript/dist/apis/TasksApi.js +++ b/typescript/dist/apis/TasksApi.js @@ -35,12 +35,12 @@ class TasksApi extends runtime.BaseAPI { */ abortHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling abortHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling abortHandler().'); } const queryParameters = {}; - if (requestParameters.force !== undefined) { - queryParameters['force'] = requestParameters.force; + if (requestParameters['force'] != null) { + queryParameters['force'] = requestParameters['force']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -51,7 +51,7 @@ class TasksApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/tasks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/tasks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -73,14 +73,14 @@ class TasksApi extends runtime.BaseAPI { */ listHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.filter === null || requestParameters.filter === undefined) { - throw new runtime.RequiredError('filter', 'Required parameter requestParameters.filter was null or undefined when calling listHandler.'); + if (requestParameters['filter'] == null) { + throw new runtime.RequiredError('filter', 'Required parameter "filter" was null or undefined when calling listHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling listHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling listHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling listHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling listHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -92,7 +92,7 @@ class TasksApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/tasks/list`.replace(`{${"filter"}}`, encodeURIComponent(String(requestParameters.filter))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters.offset))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters.limit))), + path: `/tasks/list`.replace(`{${"filter"}}`, encodeURIComponent(String(requestParameters['filter']))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters['offset']))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters['limit']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -114,8 +114,8 @@ class TasksApi extends runtime.BaseAPI { */ statusHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling statusHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling statusHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -127,7 +127,7 @@ class TasksApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/tasks/{id}/status`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/tasks/{id}/status`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/apis/UploadsApi.js b/typescript/dist/apis/UploadsApi.js index 530e03b7..18be0c4d 100644 --- a/typescript/dist/apis/UploadsApi.js +++ b/typescript/dist/apis/UploadsApi.js @@ -34,11 +34,11 @@ class UploadsApi extends runtime.BaseAPI { */ listUploadFileLayersHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) { - throw new runtime.RequiredError('uploadId', 'Required parameter requestParameters.uploadId was null or undefined when calling listUploadFileLayersHandler.'); + if (requestParameters['uploadId'] == null) { + throw new runtime.RequiredError('uploadId', 'Required parameter "uploadId" was null or undefined when calling listUploadFileLayersHandler().'); } - if (requestParameters.fileName === null || requestParameters.fileName === undefined) { - throw new runtime.RequiredError('fileName', 'Required parameter requestParameters.fileName was null or undefined when calling listUploadFileLayersHandler.'); + if (requestParameters['fileName'] == null) { + throw new runtime.RequiredError('fileName', 'Required parameter "fileName" was null or undefined when calling listUploadFileLayersHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -50,7 +50,7 @@ class UploadsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/uploads/{upload_id}/files/{file_name}/layers`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters.uploadId))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters.fileName))), + path: `/uploads/{upload_id}/files/{file_name}/layers`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters['uploadId']))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters['fileName']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -72,8 +72,8 @@ class UploadsApi extends runtime.BaseAPI { */ listUploadFilesHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) { - throw new runtime.RequiredError('uploadId', 'Required parameter requestParameters.uploadId was null or undefined when calling listUploadFilesHandler.'); + if (requestParameters['uploadId'] == null) { + throw new runtime.RequiredError('uploadId', 'Required parameter "uploadId" was null or undefined when calling listUploadFilesHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -85,7 +85,7 @@ class UploadsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/uploads/{upload_id}/files`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters.uploadId))), + path: `/uploads/{upload_id}/files`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters['uploadId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -107,8 +107,8 @@ class UploadsApi extends runtime.BaseAPI { */ uploadHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.files === null || requestParameters.files === undefined) { - throw new runtime.RequiredError('files', 'Required parameter requestParameters.files was null or undefined when calling uploadHandler.'); + if (requestParameters['files'] == null) { + throw new runtime.RequiredError('files', 'Required parameter "files" was null or undefined when calling uploadHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -134,8 +134,8 @@ class UploadsApi extends runtime.BaseAPI { else { formParams = new URLSearchParams(); } - if (requestParameters.files) { - requestParameters.files.forEach((element) => { + if (requestParameters['files'] != null) { + requestParameters['files'].forEach((element) => { formParams.append('files[]', element); }); } diff --git a/typescript/dist/apis/UserApi.js b/typescript/dist/apis/UserApi.js index 0c9da609..c35c2a8d 100644 --- a/typescript/dist/apis/UserApi.js +++ b/typescript/dist/apis/UserApi.js @@ -34,8 +34,8 @@ class UserApi extends runtime.BaseAPI { */ addRoleHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.addRole === null || requestParameters.addRole === undefined) { - throw new runtime.RequiredError('addRole', 'Required parameter requestParameters.addRole was null or undefined when calling addRoleHandler.'); + if (requestParameters['addRole'] == null) { + throw new runtime.RequiredError('addRole', 'Required parameter "addRole" was null or undefined when calling addRoleHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -52,7 +52,7 @@ class UserApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: (0, index_1.AddRoleToJSON)(requestParameters.addRole), + body: (0, index_1.AddRoleToJSON)(requestParameters['addRole']), }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); @@ -76,11 +76,11 @@ class UserApi extends runtime.BaseAPI { */ assignRoleHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling assignRoleHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling assignRoleHandler().'); } - if (requestParameters.role === null || requestParameters.role === undefined) { - throw new runtime.RequiredError('role', 'Required parameter requestParameters.role was null or undefined when calling assignRoleHandler.'); + if (requestParameters['role'] == null) { + throw new runtime.RequiredError('role', 'Required parameter "role" was null or undefined when calling assignRoleHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -92,7 +92,7 @@ class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters.role))), + path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters['role']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -113,8 +113,8 @@ class UserApi extends runtime.BaseAPI { */ computationQuotaHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.computation === null || requestParameters.computation === undefined) { - throw new runtime.RequiredError('computation', 'Required parameter requestParameters.computation was null or undefined when calling computationQuotaHandler.'); + if (requestParameters['computation'] == null) { + throw new runtime.RequiredError('computation', 'Required parameter "computation" was null or undefined when calling computationQuotaHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -126,7 +126,7 @@ class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/quota/computations/{computation}`.replace(`{${"computation"}}`, encodeURIComponent(String(requestParameters.computation))), + path: `/quota/computations/{computation}`.replace(`{${"computation"}}`, encodeURIComponent(String(requestParameters['computation']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -148,18 +148,18 @@ class UserApi extends runtime.BaseAPI { */ computationsQuotaHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling computationsQuotaHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling computationsQuotaHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling computationsQuotaHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling computationsQuotaHandler().'); } const queryParameters = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -192,18 +192,18 @@ class UserApi extends runtime.BaseAPI { */ dataUsageHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling dataUsageHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling dataUsageHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling dataUsageHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling dataUsageHandler().'); } const queryParameters = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -236,27 +236,27 @@ class UserApi extends runtime.BaseAPI { */ dataUsageSummaryHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.granularity === null || requestParameters.granularity === undefined) { - throw new runtime.RequiredError('granularity', 'Required parameter requestParameters.granularity was null or undefined when calling dataUsageSummaryHandler.'); + if (requestParameters['granularity'] == null) { + throw new runtime.RequiredError('granularity', 'Required parameter "granularity" was null or undefined when calling dataUsageSummaryHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling dataUsageSummaryHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling dataUsageSummaryHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling dataUsageSummaryHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling dataUsageSummaryHandler().'); } const queryParameters = {}; - if (requestParameters.granularity !== undefined) { - queryParameters['granularity'] = requestParameters.granularity; + if (requestParameters['granularity'] != null) { + queryParameters['granularity'] = requestParameters['granularity']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.dataset !== undefined) { - queryParameters['dataset'] = requestParameters.dataset; + if (requestParameters['dataset'] != null) { + queryParameters['dataset'] = requestParameters['dataset']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -289,8 +289,8 @@ class UserApi extends runtime.BaseAPI { */ getRoleByNameHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name', 'Required parameter requestParameters.name was null or undefined when calling getRoleByNameHandler.'); + if (requestParameters['name'] == null) { + throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling getRoleByNameHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -302,7 +302,7 @@ class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/roles/byName/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + path: `/roles/byName/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters['name']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -356,8 +356,8 @@ class UserApi extends runtime.BaseAPI { */ getUserQuotaHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling getUserQuotaHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling getUserQuotaHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -369,7 +369,7 @@ class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))), + path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -423,8 +423,8 @@ class UserApi extends runtime.BaseAPI { */ removeRoleHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.role === null || requestParameters.role === undefined) { - throw new runtime.RequiredError('role', 'Required parameter requestParameters.role was null or undefined when calling removeRoleHandler.'); + if (requestParameters['role'] == null) { + throw new runtime.RequiredError('role', 'Required parameter "role" was null or undefined when calling removeRoleHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -436,7 +436,7 @@ class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/roles/{role}`.replace(`{${"role"}}`, encodeURIComponent(String(requestParameters.role))), + path: `/roles/{role}`.replace(`{${"role"}}`, encodeURIComponent(String(requestParameters['role']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -457,11 +457,11 @@ class UserApi extends runtime.BaseAPI { */ revokeRoleHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling revokeRoleHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling revokeRoleHandler().'); } - if (requestParameters.role === null || requestParameters.role === undefined) { - throw new runtime.RequiredError('role', 'Required parameter requestParameters.role was null or undefined when calling revokeRoleHandler.'); + if (requestParameters['role'] == null) { + throw new runtime.RequiredError('role', 'Required parameter "role" was null or undefined when calling revokeRoleHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -473,7 +473,7 @@ class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters.role))), + path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters['role']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -494,11 +494,11 @@ class UserApi extends runtime.BaseAPI { */ updateUserQuotaHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling updateUserQuotaHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling updateUserQuotaHandler().'); } - if (requestParameters.updateQuota === null || requestParameters.updateQuota === undefined) { - throw new runtime.RequiredError('updateQuota', 'Required parameter requestParameters.updateQuota was null or undefined when calling updateUserQuotaHandler.'); + if (requestParameters['updateQuota'] == null) { + throw new runtime.RequiredError('updateQuota', 'Required parameter "updateQuota" was null or undefined when calling updateUserQuotaHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -511,11 +511,11 @@ class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))), + path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.UpdateQuotaToJSON)(requestParameters.updateQuota), + body: (0, index_1.UpdateQuotaToJSON)(requestParameters['updateQuota']), }, initOverrides); return new runtime.VoidApiResponse(response); }); diff --git a/typescript/dist/apis/WorkflowsApi.js b/typescript/dist/apis/WorkflowsApi.js index 3596953a..4ae4674a 100644 --- a/typescript/dist/apis/WorkflowsApi.js +++ b/typescript/dist/apis/WorkflowsApi.js @@ -35,11 +35,11 @@ class WorkflowsApi extends runtime.BaseAPI { */ datasetFromWorkflowHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling datasetFromWorkflowHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling datasetFromWorkflowHandler().'); } - if (requestParameters.rasterDatasetFromWorkflow === null || requestParameters.rasterDatasetFromWorkflow === undefined) { - throw new runtime.RequiredError('rasterDatasetFromWorkflow', 'Required parameter requestParameters.rasterDatasetFromWorkflow was null or undefined when calling datasetFromWorkflowHandler.'); + if (requestParameters['rasterDatasetFromWorkflow'] == null) { + throw new runtime.RequiredError('rasterDatasetFromWorkflow', 'Required parameter "rasterDatasetFromWorkflow" was null or undefined when calling datasetFromWorkflowHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -52,11 +52,11 @@ class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/datasetFromWorkflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/datasetFromWorkflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.RasterDatasetFromWorkflowToJSON)(requestParameters.rasterDatasetFromWorkflow), + body: (0, index_1.RasterDatasetFromWorkflowToJSON)(requestParameters['rasterDatasetFromWorkflow']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TaskResponseFromJSON)(jsonValue)); }); @@ -76,8 +76,8 @@ class WorkflowsApi extends runtime.BaseAPI { */ getWorkflowAllMetadataZipHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling getWorkflowAllMetadataZipHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getWorkflowAllMetadataZipHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -89,7 +89,7 @@ class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/workflow/{id}/allMetadata/zip`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/allMetadata/zip`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -111,8 +111,8 @@ class WorkflowsApi extends runtime.BaseAPI { */ getWorkflowMetadataHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling getWorkflowMetadataHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getWorkflowMetadataHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -124,7 +124,7 @@ class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/workflow/{id}/metadata`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/metadata`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -146,8 +146,8 @@ class WorkflowsApi extends runtime.BaseAPI { */ getWorkflowProvenanceHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling getWorkflowProvenanceHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getWorkflowProvenanceHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -159,7 +159,7 @@ class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/workflow/{id}/provenance`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/provenance`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -181,8 +181,8 @@ class WorkflowsApi extends runtime.BaseAPI { */ loadWorkflowHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling loadWorkflowHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling loadWorkflowHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -194,7 +194,7 @@ class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/workflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -216,39 +216,39 @@ class WorkflowsApi extends runtime.BaseAPI { */ rasterStreamWebsocketRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling rasterStreamWebsocket().'); } - if (requestParameters.spatialBounds === null || requestParameters.spatialBounds === undefined) { - throw new runtime.RequiredError('spatialBounds', 'Required parameter requestParameters.spatialBounds was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['spatialBounds'] == null) { + throw new runtime.RequiredError('spatialBounds', 'Required parameter "spatialBounds" was null or undefined when calling rasterStreamWebsocket().'); } - if (requestParameters.timeInterval === null || requestParameters.timeInterval === undefined) { - throw new runtime.RequiredError('timeInterval', 'Required parameter requestParameters.timeInterval was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['timeInterval'] == null) { + throw new runtime.RequiredError('timeInterval', 'Required parameter "timeInterval" was null or undefined when calling rasterStreamWebsocket().'); } - if (requestParameters.spatialResolution === null || requestParameters.spatialResolution === undefined) { - throw new runtime.RequiredError('spatialResolution', 'Required parameter requestParameters.spatialResolution was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['spatialResolution'] == null) { + throw new runtime.RequiredError('spatialResolution', 'Required parameter "spatialResolution" was null or undefined when calling rasterStreamWebsocket().'); } - if (requestParameters.attributes === null || requestParameters.attributes === undefined) { - throw new runtime.RequiredError('attributes', 'Required parameter requestParameters.attributes was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['attributes'] == null) { + throw new runtime.RequiredError('attributes', 'Required parameter "attributes" was null or undefined when calling rasterStreamWebsocket().'); } - if (requestParameters.resultType === null || requestParameters.resultType === undefined) { - throw new runtime.RequiredError('resultType', 'Required parameter requestParameters.resultType was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['resultType'] == null) { + throw new runtime.RequiredError('resultType', 'Required parameter "resultType" was null or undefined when calling rasterStreamWebsocket().'); } const queryParameters = {}; - if (requestParameters.spatialBounds !== undefined) { - queryParameters['spatialBounds'] = requestParameters.spatialBounds; + if (requestParameters['spatialBounds'] != null) { + queryParameters['spatialBounds'] = requestParameters['spatialBounds']; } - if (requestParameters.timeInterval !== undefined) { - queryParameters['timeInterval'] = requestParameters.timeInterval; + if (requestParameters['timeInterval'] != null) { + queryParameters['timeInterval'] = requestParameters['timeInterval']; } - if (requestParameters.spatialResolution !== undefined) { - queryParameters['spatialResolution'] = requestParameters.spatialResolution; + if (requestParameters['spatialResolution'] != null) { + queryParameters['spatialResolution'] = requestParameters['spatialResolution']; } - if (requestParameters.attributes !== undefined) { - queryParameters['attributes'] = requestParameters.attributes; + if (requestParameters['attributes'] != null) { + queryParameters['attributes'] = requestParameters['attributes']; } - if (requestParameters.resultType !== undefined) { - queryParameters['resultType'] = requestParameters.resultType; + if (requestParameters['resultType'] != null) { + queryParameters['resultType'] = requestParameters['resultType']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -259,7 +259,7 @@ class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/workflow/{id}/rasterStream`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/rasterStream`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -280,8 +280,8 @@ class WorkflowsApi extends runtime.BaseAPI { */ registerWorkflowHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling registerWorkflowHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling registerWorkflowHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -298,7 +298,7 @@ class WorkflowsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: (0, index_1.WorkflowToJSON)(requestParameters.workflow), + body: (0, index_1.WorkflowToJSON)(requestParameters['workflow']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AddCollection200ResponseFromJSON)(jsonValue)); }); diff --git a/typescript/dist/esm/apis/DatasetsApi.js b/typescript/dist/esm/apis/DatasetsApi.js index bbba6b04..dcf90159 100644 --- a/typescript/dist/esm/apis/DatasetsApi.js +++ b/typescript/dist/esm/apis/DatasetsApi.js @@ -32,8 +32,8 @@ export class DatasetsApi extends runtime.BaseAPI { */ autoCreateDatasetHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.autoCreateDataset === null || requestParameters.autoCreateDataset === undefined) { - throw new runtime.RequiredError('autoCreateDataset', 'Required parameter requestParameters.autoCreateDataset was null or undefined when calling autoCreateDatasetHandler.'); + if (requestParameters['autoCreateDataset'] == null) { + throw new runtime.RequiredError('autoCreateDataset', 'Required parameter "autoCreateDataset" was null or undefined when calling autoCreateDatasetHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -50,7 +50,7 @@ export class DatasetsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: AutoCreateDatasetToJSON(requestParameters.autoCreateDataset), + body: AutoCreateDatasetToJSON(requestParameters['autoCreateDataset']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => CreateDatasetHandler200ResponseFromJSON(jsonValue)); }); @@ -71,8 +71,8 @@ export class DatasetsApi extends runtime.BaseAPI { */ createDatasetHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.createDataset === null || requestParameters.createDataset === undefined) { - throw new runtime.RequiredError('createDataset', 'Required parameter requestParameters.createDataset was null or undefined when calling createDatasetHandler.'); + if (requestParameters['createDataset'] == null) { + throw new runtime.RequiredError('createDataset', 'Required parameter "createDataset" was null or undefined when calling createDatasetHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -89,7 +89,7 @@ export class DatasetsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: CreateDatasetToJSON(requestParameters.createDataset), + body: CreateDatasetToJSON(requestParameters['createDataset']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => CreateDatasetHandler200ResponseFromJSON(jsonValue)); }); @@ -109,8 +109,8 @@ export class DatasetsApi extends runtime.BaseAPI { */ deleteDatasetHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling deleteDatasetHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling deleteDatasetHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -122,7 +122,7 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -143,8 +143,8 @@ export class DatasetsApi extends runtime.BaseAPI { */ getDatasetHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling getDatasetHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling getDatasetHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -156,7 +156,7 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -178,8 +178,8 @@ export class DatasetsApi extends runtime.BaseAPI { */ getLoadingInfoHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling getLoadingInfoHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling getLoadingInfoHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -191,7 +191,7 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -213,30 +213,30 @@ export class DatasetsApi extends runtime.BaseAPI { */ listDatasetsHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.order === null || requestParameters.order === undefined) { - throw new runtime.RequiredError('order', 'Required parameter requestParameters.order was null or undefined when calling listDatasetsHandler.'); + if (requestParameters['order'] == null) { + throw new runtime.RequiredError('order', 'Required parameter "order" was null or undefined when calling listDatasetsHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling listDatasetsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling listDatasetsHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling listDatasetsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling listDatasetsHandler().'); } const queryParameters = {}; - if (requestParameters.filter !== undefined) { - queryParameters['filter'] = requestParameters.filter; + if (requestParameters['filter'] != null) { + queryParameters['filter'] = requestParameters['filter']; } - if (requestParameters.order !== undefined) { - queryParameters['order'] = requestParameters.order; + if (requestParameters['order'] != null) { + queryParameters['order'] = requestParameters['order']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.tags) { - queryParameters['tags'] = requestParameters.tags; + if (requestParameters['tags'] != null) { + queryParameters['tags'] = requestParameters['tags']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -269,11 +269,11 @@ export class DatasetsApi extends runtime.BaseAPI { */ listVolumeFileLayersHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.volumeName === null || requestParameters.volumeName === undefined) { - throw new runtime.RequiredError('volumeName', 'Required parameter requestParameters.volumeName was null or undefined when calling listVolumeFileLayersHandler.'); + if (requestParameters['volumeName'] == null) { + throw new runtime.RequiredError('volumeName', 'Required parameter "volumeName" was null or undefined when calling listVolumeFileLayersHandler().'); } - if (requestParameters.fileName === null || requestParameters.fileName === undefined) { - throw new runtime.RequiredError('fileName', 'Required parameter requestParameters.fileName was null or undefined when calling listVolumeFileLayersHandler.'); + if (requestParameters['fileName'] == null) { + throw new runtime.RequiredError('fileName', 'Required parameter "fileName" was null or undefined when calling listVolumeFileLayersHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -285,7 +285,7 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/volumes/{volume_name}/files/{file_name}/layers`.replace(`{${"volume_name"}}`, encodeURIComponent(String(requestParameters.volumeName))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters.fileName))), + path: `/dataset/volumes/{volume_name}/files/{file_name}/layers`.replace(`{${"volume_name"}}`, encodeURIComponent(String(requestParameters['volumeName']))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters['fileName']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -340,8 +340,8 @@ export class DatasetsApi extends runtime.BaseAPI { */ suggestMetaDataHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.suggestMetaData === null || requestParameters.suggestMetaData === undefined) { - throw new runtime.RequiredError('suggestMetaData', 'Required parameter requestParameters.suggestMetaData was null or undefined when calling suggestMetaDataHandler.'); + if (requestParameters['suggestMetaData'] == null) { + throw new runtime.RequiredError('suggestMetaData', 'Required parameter "suggestMetaData" was null or undefined when calling suggestMetaDataHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -358,7 +358,7 @@ export class DatasetsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: SuggestMetaDataToJSON(requestParameters.suggestMetaData), + body: SuggestMetaDataToJSON(requestParameters['suggestMetaData']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => MetaDataSuggestionFromJSON(jsonValue)); }); @@ -378,11 +378,11 @@ export class DatasetsApi extends runtime.BaseAPI { */ updateDatasetHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling updateDatasetHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling updateDatasetHandler().'); } - if (requestParameters.updateDataset === null || requestParameters.updateDataset === undefined) { - throw new runtime.RequiredError('updateDataset', 'Required parameter requestParameters.updateDataset was null or undefined when calling updateDatasetHandler.'); + if (requestParameters['updateDataset'] == null) { + throw new runtime.RequiredError('updateDataset', 'Required parameter "updateDataset" was null or undefined when calling updateDatasetHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -395,11 +395,11 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: UpdateDatasetToJSON(requestParameters.updateDataset), + body: UpdateDatasetToJSON(requestParameters['updateDataset']), }, initOverrides); return new runtime.VoidApiResponse(response); }); @@ -416,11 +416,11 @@ export class DatasetsApi extends runtime.BaseAPI { */ updateDatasetProvenanceHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling updateDatasetProvenanceHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling updateDatasetProvenanceHandler().'); } - if (requestParameters.provenances === null || requestParameters.provenances === undefined) { - throw new runtime.RequiredError('provenances', 'Required parameter requestParameters.provenances was null or undefined when calling updateDatasetProvenanceHandler.'); + if (requestParameters['provenances'] == null) { + throw new runtime.RequiredError('provenances', 'Required parameter "provenances" was null or undefined when calling updateDatasetProvenanceHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -433,11 +433,11 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}/provenance`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/provenance`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: ProvenancesToJSON(requestParameters.provenances), + body: ProvenancesToJSON(requestParameters['provenances']), }, initOverrides); return new runtime.VoidApiResponse(response); }); @@ -454,11 +454,11 @@ export class DatasetsApi extends runtime.BaseAPI { */ updateDatasetSymbologyHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling updateDatasetSymbologyHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling updateDatasetSymbologyHandler().'); } - if (requestParameters.symbology === null || requestParameters.symbology === undefined) { - throw new runtime.RequiredError('symbology', 'Required parameter requestParameters.symbology was null or undefined when calling updateDatasetSymbologyHandler.'); + if (requestParameters['symbology'] == null) { + throw new runtime.RequiredError('symbology', 'Required parameter "symbology" was null or undefined when calling updateDatasetSymbologyHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -471,11 +471,11 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: SymbologyToJSON(requestParameters.symbology), + body: SymbologyToJSON(requestParameters['symbology']), }, initOverrides); return new runtime.VoidApiResponse(response); }); @@ -493,11 +493,11 @@ export class DatasetsApi extends runtime.BaseAPI { */ updateLoadingInfoHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling updateLoadingInfoHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError('dataset', 'Required parameter "dataset" was null or undefined when calling updateLoadingInfoHandler().'); } - if (requestParameters.metaDataDefinition === null || requestParameters.metaDataDefinition === undefined) { - throw new runtime.RequiredError('metaDataDefinition', 'Required parameter requestParameters.metaDataDefinition was null or undefined when calling updateLoadingInfoHandler.'); + if (requestParameters['metaDataDefinition'] == null) { + throw new runtime.RequiredError('metaDataDefinition', 'Required parameter "metaDataDefinition" was null or undefined when calling updateLoadingInfoHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -510,11 +510,11 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: MetaDataDefinitionToJSON(requestParameters.metaDataDefinition), + body: MetaDataDefinitionToJSON(requestParameters['metaDataDefinition']), }, initOverrides); return new runtime.VoidApiResponse(response); }); diff --git a/typescript/dist/esm/apis/LayersApi.js b/typescript/dist/esm/apis/LayersApi.js index c3366bc5..21e714f1 100644 --- a/typescript/dist/esm/apis/LayersApi.js +++ b/typescript/dist/esm/apis/LayersApi.js @@ -31,11 +31,11 @@ export class LayersApi extends runtime.BaseAPI { */ addCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling addCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling addCollection().'); } - if (requestParameters.addLayerCollection === null || requestParameters.addLayerCollection === undefined) { - throw new runtime.RequiredError('addLayerCollection', 'Required parameter requestParameters.addLayerCollection was null or undefined when calling addCollection.'); + if (requestParameters['addLayerCollection'] == null) { + throw new runtime.RequiredError('addLayerCollection', 'Required parameter "addLayerCollection" was null or undefined when calling addCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -48,11 +48,11 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}/collections`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}/collections`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: AddLayerCollectionToJSON(requestParameters.addLayerCollection), + body: AddLayerCollectionToJSON(requestParameters['addLayerCollection']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AddCollection200ResponseFromJSON(jsonValue)); }); @@ -71,11 +71,11 @@ export class LayersApi extends runtime.BaseAPI { */ addExistingCollectionToCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.parent === null || requestParameters.parent === undefined) { - throw new runtime.RequiredError('parent', 'Required parameter requestParameters.parent was null or undefined when calling addExistingCollectionToCollection.'); + if (requestParameters['parent'] == null) { + throw new runtime.RequiredError('parent', 'Required parameter "parent" was null or undefined when calling addExistingCollectionToCollection().'); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling addExistingCollectionToCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling addExistingCollectionToCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -87,7 +87,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters.parent))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters['parent']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -108,11 +108,11 @@ export class LayersApi extends runtime.BaseAPI { */ addExistingLayerToCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling addExistingLayerToCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling addExistingLayerToCollection().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling addExistingLayerToCollection.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling addExistingLayerToCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -124,7 +124,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -145,11 +145,11 @@ export class LayersApi extends runtime.BaseAPI { */ addLayerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling addLayer.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling addLayer().'); } - if (requestParameters.addLayer === null || requestParameters.addLayer === undefined) { - throw new runtime.RequiredError('addLayer', 'Required parameter requestParameters.addLayer was null or undefined when calling addLayer.'); + if (requestParameters['addLayer'] == null) { + throw new runtime.RequiredError('addLayer', 'Required parameter "addLayer" was null or undefined when calling addLayer().'); } const queryParameters = {}; const headerParameters = {}; @@ -162,11 +162,11 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}/layers`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}/layers`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: AddLayerToJSON(requestParameters.addLayer), + body: AddLayerToJSON(requestParameters['addLayer']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AddCollection200ResponseFromJSON(jsonValue)); }); @@ -185,36 +185,36 @@ export class LayersApi extends runtime.BaseAPI { */ autocompleteHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling autocompleteHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling autocompleteHandler().'); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling autocompleteHandler.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling autocompleteHandler().'); } - if (requestParameters.searchType === null || requestParameters.searchType === undefined) { - throw new runtime.RequiredError('searchType', 'Required parameter requestParameters.searchType was null or undefined when calling autocompleteHandler.'); + if (requestParameters['searchType'] == null) { + throw new runtime.RequiredError('searchType', 'Required parameter "searchType" was null or undefined when calling autocompleteHandler().'); } - if (requestParameters.searchString === null || requestParameters.searchString === undefined) { - throw new runtime.RequiredError('searchString', 'Required parameter requestParameters.searchString was null or undefined when calling autocompleteHandler.'); + if (requestParameters['searchString'] == null) { + throw new runtime.RequiredError('searchString', 'Required parameter "searchString" was null or undefined when calling autocompleteHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling autocompleteHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling autocompleteHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling autocompleteHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling autocompleteHandler().'); } const queryParameters = {}; - if (requestParameters.searchType !== undefined) { - queryParameters['searchType'] = requestParameters.searchType; + if (requestParameters['searchType'] != null) { + queryParameters['searchType'] = requestParameters['searchType']; } - if (requestParameters.searchString !== undefined) { - queryParameters['searchString'] = requestParameters.searchString; + if (requestParameters['searchString'] != null) { + queryParameters['searchString'] = requestParameters['searchString']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -225,7 +225,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/collections/search/autocomplete/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layers/collections/search/autocomplete/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -247,11 +247,11 @@ export class LayersApi extends runtime.BaseAPI { */ layerHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling layerHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling layerHandler().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling layerHandler.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling layerHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -263,7 +263,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/{provider}/{layer}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layers/{provider}/{layer}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -285,11 +285,11 @@ export class LayersApi extends runtime.BaseAPI { */ layerToDatasetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling layerToDataset.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling layerToDataset().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling layerToDataset.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling layerToDataset().'); } const queryParameters = {}; const headerParameters = {}; @@ -301,7 +301,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/{provider}/{layer}/dataset`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layers/{provider}/{layer}/dataset`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -323,11 +323,11 @@ export class LayersApi extends runtime.BaseAPI { */ layerToWorkflowIdHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling layerToWorkflowIdHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling layerToWorkflowIdHandler().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling layerToWorkflowIdHandler.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling layerToWorkflowIdHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -339,7 +339,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/{provider}/{layer}/workflowId`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layers/{provider}/{layer}/workflowId`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -361,24 +361,24 @@ export class LayersApi extends runtime.BaseAPI { */ listCollectionHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling listCollectionHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling listCollectionHandler().'); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling listCollectionHandler.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling listCollectionHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling listCollectionHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling listCollectionHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling listCollectionHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling listCollectionHandler().'); } const queryParameters = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -389,7 +389,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/collections/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layers/collections/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -411,18 +411,18 @@ export class LayersApi extends runtime.BaseAPI { */ listRootCollectionsHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling listRootCollectionsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling listRootCollectionsHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling listRootCollectionsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling listRootCollectionsHandler().'); } const queryParameters = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -454,8 +454,8 @@ export class LayersApi extends runtime.BaseAPI { */ providerCapabilitiesHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling providerCapabilitiesHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling providerCapabilitiesHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -467,7 +467,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/{provider}/capabilities`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))), + path: `/layers/{provider}/capabilities`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -488,8 +488,8 @@ export class LayersApi extends runtime.BaseAPI { */ removeCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling removeCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling removeCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -501,7 +501,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -522,11 +522,11 @@ export class LayersApi extends runtime.BaseAPI { */ removeCollectionFromCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.parent === null || requestParameters.parent === undefined) { - throw new runtime.RequiredError('parent', 'Required parameter requestParameters.parent was null or undefined when calling removeCollectionFromCollection.'); + if (requestParameters['parent'] == null) { + throw new runtime.RequiredError('parent', 'Required parameter "parent" was null or undefined when calling removeCollectionFromCollection().'); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling removeCollectionFromCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling removeCollectionFromCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -538,7 +538,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters.parent))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters['parent']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -559,8 +559,8 @@ export class LayersApi extends runtime.BaseAPI { */ removeLayerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling removeLayer.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling removeLayer().'); } const queryParameters = {}; const headerParameters = {}; @@ -572,7 +572,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -593,11 +593,11 @@ export class LayersApi extends runtime.BaseAPI { */ removeLayerFromCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling removeLayerFromCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling removeLayerFromCollection().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling removeLayerFromCollection.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling removeLayerFromCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -609,7 +609,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -630,36 +630,36 @@ export class LayersApi extends runtime.BaseAPI { */ searchHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider', 'Required parameter requestParameters.provider was null or undefined when calling searchHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling searchHandler().'); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling searchHandler.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling searchHandler().'); } - if (requestParameters.searchType === null || requestParameters.searchType === undefined) { - throw new runtime.RequiredError('searchType', 'Required parameter requestParameters.searchType was null or undefined when calling searchHandler.'); + if (requestParameters['searchType'] == null) { + throw new runtime.RequiredError('searchType', 'Required parameter "searchType" was null or undefined when calling searchHandler().'); } - if (requestParameters.searchString === null || requestParameters.searchString === undefined) { - throw new runtime.RequiredError('searchString', 'Required parameter requestParameters.searchString was null or undefined when calling searchHandler.'); + if (requestParameters['searchString'] == null) { + throw new runtime.RequiredError('searchString', 'Required parameter "searchString" was null or undefined when calling searchHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling searchHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling searchHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling searchHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling searchHandler().'); } const queryParameters = {}; - if (requestParameters.searchType !== undefined) { - queryParameters['searchType'] = requestParameters.searchType; + if (requestParameters['searchType'] != null) { + queryParameters['searchType'] = requestParameters['searchType']; } - if (requestParameters.searchString !== undefined) { - queryParameters['searchString'] = requestParameters.searchString; + if (requestParameters['searchString'] != null) { + queryParameters['searchString'] = requestParameters['searchString']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -670,7 +670,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layers/collections/search/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layers/collections/search/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -692,11 +692,11 @@ export class LayersApi extends runtime.BaseAPI { */ updateCollectionRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection', 'Required parameter requestParameters.collection was null or undefined when calling updateCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError('collection', 'Required parameter "collection" was null or undefined when calling updateCollection().'); } - if (requestParameters.updateLayerCollection === null || requestParameters.updateLayerCollection === undefined) { - throw new runtime.RequiredError('updateLayerCollection', 'Required parameter requestParameters.updateLayerCollection was null or undefined when calling updateCollection.'); + if (requestParameters['updateLayerCollection'] == null) { + throw new runtime.RequiredError('updateLayerCollection', 'Required parameter "updateLayerCollection" was null or undefined when calling updateCollection().'); } const queryParameters = {}; const headerParameters = {}; @@ -709,11 +709,11 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: UpdateLayerCollectionToJSON(requestParameters.updateLayerCollection), + body: UpdateLayerCollectionToJSON(requestParameters['updateLayerCollection']), }, initOverrides); return new runtime.VoidApiResponse(response); }); @@ -731,11 +731,11 @@ export class LayersApi extends runtime.BaseAPI { */ updateLayerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling updateLayer.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling updateLayer().'); } - if (requestParameters.updateLayer === null || requestParameters.updateLayer === undefined) { - throw new runtime.RequiredError('updateLayer', 'Required parameter requestParameters.updateLayer was null or undefined when calling updateLayer.'); + if (requestParameters['updateLayer'] == null) { + throw new runtime.RequiredError('updateLayer', 'Required parameter "updateLayer" was null or undefined when calling updateLayer().'); } const queryParameters = {}; const headerParameters = {}; @@ -748,11 +748,11 @@ export class LayersApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: UpdateLayerToJSON(requestParameters.updateLayer), + body: UpdateLayerToJSON(requestParameters['updateLayer']), }, initOverrides); return new runtime.VoidApiResponse(response); }); diff --git a/typescript/dist/esm/apis/MLApi.js b/typescript/dist/esm/apis/MLApi.js index 23e4d460..e27fc276 100644 --- a/typescript/dist/esm/apis/MLApi.js +++ b/typescript/dist/esm/apis/MLApi.js @@ -31,8 +31,8 @@ export class MLApi extends runtime.BaseAPI { */ addMlModelRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.mlModel === null || requestParameters.mlModel === undefined) { - throw new runtime.RequiredError('mlModel', 'Required parameter requestParameters.mlModel was null or undefined when calling addMlModel.'); + if (requestParameters['mlModel'] == null) { + throw new runtime.RequiredError('mlModel', 'Required parameter "mlModel" was null or undefined when calling addMlModel().'); } const queryParameters = {}; const headerParameters = {}; @@ -49,7 +49,7 @@ export class MLApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: MlModelToJSON(requestParameters.mlModel), + body: MlModelToJSON(requestParameters['mlModel']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => MlModelNameResponseFromJSON(jsonValue)); }); @@ -68,8 +68,8 @@ export class MLApi extends runtime.BaseAPI { */ getMlModelRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.modelName === null || requestParameters.modelName === undefined) { - throw new runtime.RequiredError('modelName', 'Required parameter requestParameters.modelName was null or undefined when calling getMlModel.'); + if (requestParameters['modelName'] == null) { + throw new runtime.RequiredError('modelName', 'Required parameter "modelName" was null or undefined when calling getMlModel().'); } const queryParameters = {}; const headerParameters = {}; @@ -81,7 +81,7 @@ export class MLApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/ml/models/{model_name}`.replace(`{${"model_name"}}`, encodeURIComponent(String(requestParameters.modelName))), + path: `/ml/models/{model_name}`.replace(`{${"model_name"}}`, encodeURIComponent(String(requestParameters['modelName']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/esm/apis/OGCWCSApi.js b/typescript/dist/esm/apis/OGCWCSApi.js index 71b877d4..96f29831 100644 --- a/typescript/dist/esm/apis/OGCWCSApi.js +++ b/typescript/dist/esm/apis/OGCWCSApi.js @@ -30,24 +30,24 @@ export class OGCWCSApi extends runtime.BaseAPI { */ wcsCapabilitiesHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wcsCapabilitiesHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wcsCapabilitiesHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wcsCapabilitiesHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wcsCapabilitiesHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wcsCapabilitiesHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wcsCapabilitiesHandler().'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -58,7 +58,7 @@ export class OGCWCSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wcs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wcs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -85,33 +85,33 @@ export class OGCWCSApi extends runtime.BaseAPI { */ wcsDescribeCoverageHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wcsDescribeCoverageHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wcsDescribeCoverageHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wcsDescribeCoverageHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wcsDescribeCoverageHandler().'); } - if (requestParameters.identifiers === null || requestParameters.identifiers === undefined) { - throw new runtime.RequiredError('identifiers', 'Required parameter requestParameters.identifiers was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['identifiers'] == null) { + throw new runtime.RequiredError('identifiers', 'Required parameter "identifiers" was null or undefined when calling wcsDescribeCoverageHandler().'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.identifiers !== undefined) { - queryParameters['identifiers'] = requestParameters.identifiers; + if (requestParameters['identifiers'] != null) { + queryParameters['identifiers'] = requestParameters['identifiers']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -122,7 +122,7 @@ export class OGCWCSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wcs/{workflow}?request=DescribeCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wcs/{workflow}?request=DescribeCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -149,69 +149,69 @@ export class OGCWCSApi extends runtime.BaseAPI { */ wcsGetCoverageHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.format === null || requestParameters.format === undefined) { - throw new runtime.RequiredError('format', 'Required parameter requestParameters.format was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['format'] == null) { + throw new runtime.RequiredError('format', 'Required parameter "format" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.identifier === null || requestParameters.identifier === undefined) { - throw new runtime.RequiredError('identifier', 'Required parameter requestParameters.identifier was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['identifier'] == null) { + throw new runtime.RequiredError('identifier', 'Required parameter "identifier" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.boundingbox === null || requestParameters.boundingbox === undefined) { - throw new runtime.RequiredError('boundingbox', 'Required parameter requestParameters.boundingbox was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['boundingbox'] == null) { + throw new runtime.RequiredError('boundingbox', 'Required parameter "boundingbox" was null or undefined when calling wcsGetCoverageHandler().'); } - if (requestParameters.gridbasecrs === null || requestParameters.gridbasecrs === undefined) { - throw new runtime.RequiredError('gridbasecrs', 'Required parameter requestParameters.gridbasecrs was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['gridbasecrs'] == null) { + throw new runtime.RequiredError('gridbasecrs', 'Required parameter "gridbasecrs" was null or undefined when calling wcsGetCoverageHandler().'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.format !== undefined) { - queryParameters['format'] = requestParameters.format; + if (requestParameters['format'] != null) { + queryParameters['format'] = requestParameters['format']; } - if (requestParameters.identifier !== undefined) { - queryParameters['identifier'] = requestParameters.identifier; + if (requestParameters['identifier'] != null) { + queryParameters['identifier'] = requestParameters['identifier']; } - if (requestParameters.boundingbox !== undefined) { - queryParameters['boundingbox'] = requestParameters.boundingbox; + if (requestParameters['boundingbox'] != null) { + queryParameters['boundingbox'] = requestParameters['boundingbox']; } - if (requestParameters.gridbasecrs !== undefined) { - queryParameters['gridbasecrs'] = requestParameters.gridbasecrs; + if (requestParameters['gridbasecrs'] != null) { + queryParameters['gridbasecrs'] = requestParameters['gridbasecrs']; } - if (requestParameters.gridorigin !== undefined) { - queryParameters['gridorigin'] = requestParameters.gridorigin; + if (requestParameters['gridorigin'] != null) { + queryParameters['gridorigin'] = requestParameters['gridorigin']; } - if (requestParameters.gridoffsets !== undefined) { - queryParameters['gridoffsets'] = requestParameters.gridoffsets; + if (requestParameters['gridoffsets'] != null) { + queryParameters['gridoffsets'] = requestParameters['gridoffsets']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.resx !== undefined) { - queryParameters['resx'] = requestParameters.resx; + if (requestParameters['resx'] != null) { + queryParameters['resx'] = requestParameters['resx']; } - if (requestParameters.resy !== undefined) { - queryParameters['resy'] = requestParameters.resy; + if (requestParameters['resy'] != null) { + queryParameters['resy'] = requestParameters['resy']; } - if (requestParameters.nodatavalue !== undefined) { - queryParameters['nodatavalue'] = requestParameters.nodatavalue; + if (requestParameters['nodatavalue'] != null) { + queryParameters['nodatavalue'] = requestParameters['nodatavalue']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -222,7 +222,7 @@ export class OGCWCSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wcs/{workflow}?request=GetCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wcs/{workflow}?request=GetCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/esm/apis/OGCWFSApi.js b/typescript/dist/esm/apis/OGCWFSApi.js index dae797ed..cf5b3823 100644 --- a/typescript/dist/esm/apis/OGCWFSApi.js +++ b/typescript/dist/esm/apis/OGCWFSApi.js @@ -31,17 +31,17 @@ export class OGCWFSApi extends runtime.BaseAPI { */ wfsCapabilitiesHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wfsCapabilitiesHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wfsCapabilitiesHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wfsCapabilitiesHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wfsCapabilitiesHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -53,7 +53,7 @@ export class OGCWFSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))), + path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters['service']))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters['request']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -80,63 +80,63 @@ export class OGCWFSApi extends runtime.BaseAPI { */ wfsFeatureHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wfsFeatureHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wfsFeatureHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wfsFeatureHandler().'); } - if (requestParameters.typeNames === null || requestParameters.typeNames === undefined) { - throw new runtime.RequiredError('typeNames', 'Required parameter requestParameters.typeNames was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['typeNames'] == null) { + throw new runtime.RequiredError('typeNames', 'Required parameter "typeNames" was null or undefined when calling wfsFeatureHandler().'); } - if (requestParameters.bbox === null || requestParameters.bbox === undefined) { - throw new runtime.RequiredError('bbox', 'Required parameter requestParameters.bbox was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['bbox'] == null) { + throw new runtime.RequiredError('bbox', 'Required parameter "bbox" was null or undefined when calling wfsFeatureHandler().'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.typeNames !== undefined) { - queryParameters['typeNames'] = requestParameters.typeNames; + if (requestParameters['typeNames'] != null) { + queryParameters['typeNames'] = requestParameters['typeNames']; } - if (requestParameters.bbox !== undefined) { - queryParameters['bbox'] = requestParameters.bbox; + if (requestParameters['bbox'] != null) { + queryParameters['bbox'] = requestParameters['bbox']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.srsName !== undefined) { - queryParameters['srsName'] = requestParameters.srsName; + if (requestParameters['srsName'] != null) { + queryParameters['srsName'] = requestParameters['srsName']; } - if (requestParameters.namespaces !== undefined) { - queryParameters['namespaces'] = requestParameters.namespaces; + if (requestParameters['namespaces'] != null) { + queryParameters['namespaces'] = requestParameters['namespaces']; } - if (requestParameters.count !== undefined) { - queryParameters['count'] = requestParameters.count; + if (requestParameters['count'] != null) { + queryParameters['count'] = requestParameters['count']; } - if (requestParameters.sortBy !== undefined) { - queryParameters['sortBy'] = requestParameters.sortBy; + if (requestParameters['sortBy'] != null) { + queryParameters['sortBy'] = requestParameters['sortBy']; } - if (requestParameters.resultType !== undefined) { - queryParameters['resultType'] = requestParameters.resultType; + if (requestParameters['resultType'] != null) { + queryParameters['resultType'] = requestParameters['resultType']; } - if (requestParameters.filter !== undefined) { - queryParameters['filter'] = requestParameters.filter; + if (requestParameters['filter'] != null) { + queryParameters['filter'] = requestParameters['filter']; } - if (requestParameters.propertyName !== undefined) { - queryParameters['propertyName'] = requestParameters.propertyName; + if (requestParameters['propertyName'] != null) { + queryParameters['propertyName'] = requestParameters['propertyName']; } - if (requestParameters.queryResolution !== undefined) { - queryParameters['queryResolution'] = requestParameters.queryResolution; + if (requestParameters['queryResolution'] != null) { + queryParameters['queryResolution'] = requestParameters['queryResolution']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -147,7 +147,7 @@ export class OGCWFSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wfs/{workflow}?request=GetFeature`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wfs/{workflow}?request=GetFeature`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/esm/apis/OGCWMSApi.js b/typescript/dist/esm/apis/OGCWMSApi.js index 23d02073..791951bf 100644 --- a/typescript/dist/esm/apis/OGCWMSApi.js +++ b/typescript/dist/esm/apis/OGCWMSApi.js @@ -30,20 +30,20 @@ export class OGCWMSApi extends runtime.BaseAPI { */ wmsCapabilitiesHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wmsCapabilitiesHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wmsCapabilitiesHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wmsCapabilitiesHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wmsCapabilitiesHandler().'); } - if (requestParameters.format === null || requestParameters.format === undefined) { - throw new runtime.RequiredError('format', 'Required parameter requestParameters.format was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['format'] == null) { + throw new runtime.RequiredError('format', 'Required parameter "format" was null or undefined when calling wmsCapabilitiesHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -55,7 +55,7 @@ export class OGCWMSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"format"}}`, encodeURIComponent(String(requestParameters.format))), + path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters['service']))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters['request']))).replace(`{${"format"}}`, encodeURIComponent(String(requestParameters['format']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -82,20 +82,20 @@ export class OGCWMSApi extends runtime.BaseAPI { */ wmsLegendGraphicHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wmsLegendGraphicHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wmsLegendGraphicHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wmsLegendGraphicHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wmsLegendGraphicHandler().'); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError('layer', 'Required parameter "layer" was null or undefined when calling wmsLegendGraphicHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -107,7 +107,7 @@ export class OGCWMSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters['service']))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters['request']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -128,87 +128,87 @@ export class OGCWMSApi extends runtime.BaseAPI { */ wmsMapHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wmsMapHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wmsMapHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wmsMapHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wmsMapHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError('request', 'Required parameter "request" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.width === null || requestParameters.width === undefined) { - throw new runtime.RequiredError('width', 'Required parameter requestParameters.width was null or undefined when calling wmsMapHandler.'); + if (requestParameters['width'] == null) { + throw new runtime.RequiredError('width', 'Required parameter "width" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.height === null || requestParameters.height === undefined) { - throw new runtime.RequiredError('height', 'Required parameter requestParameters.height was null or undefined when calling wmsMapHandler.'); + if (requestParameters['height'] == null) { + throw new runtime.RequiredError('height', 'Required parameter "height" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.bbox === null || requestParameters.bbox === undefined) { - throw new runtime.RequiredError('bbox', 'Required parameter requestParameters.bbox was null or undefined when calling wmsMapHandler.'); + if (requestParameters['bbox'] == null) { + throw new runtime.RequiredError('bbox', 'Required parameter "bbox" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.format === null || requestParameters.format === undefined) { - throw new runtime.RequiredError('format', 'Required parameter requestParameters.format was null or undefined when calling wmsMapHandler.'); + if (requestParameters['format'] == null) { + throw new runtime.RequiredError('format', 'Required parameter "format" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.layers === null || requestParameters.layers === undefined) { - throw new runtime.RequiredError('layers', 'Required parameter requestParameters.layers was null or undefined when calling wmsMapHandler.'); + if (requestParameters['layers'] == null) { + throw new runtime.RequiredError('layers', 'Required parameter "layers" was null or undefined when calling wmsMapHandler().'); } - if (requestParameters.styles === null || requestParameters.styles === undefined) { - throw new runtime.RequiredError('styles', 'Required parameter requestParameters.styles was null or undefined when calling wmsMapHandler.'); + if (requestParameters['styles'] == null) { + throw new runtime.RequiredError('styles', 'Required parameter "styles" was null or undefined when calling wmsMapHandler().'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.width !== undefined) { - queryParameters['width'] = requestParameters.width; + if (requestParameters['width'] != null) { + queryParameters['width'] = requestParameters['width']; } - if (requestParameters.height !== undefined) { - queryParameters['height'] = requestParameters.height; + if (requestParameters['height'] != null) { + queryParameters['height'] = requestParameters['height']; } - if (requestParameters.bbox !== undefined) { - queryParameters['bbox'] = requestParameters.bbox; + if (requestParameters['bbox'] != null) { + queryParameters['bbox'] = requestParameters['bbox']; } - if (requestParameters.format !== undefined) { - queryParameters['format'] = requestParameters.format; + if (requestParameters['format'] != null) { + queryParameters['format'] = requestParameters['format']; } - if (requestParameters.layers !== undefined) { - queryParameters['layers'] = requestParameters.layers; + if (requestParameters['layers'] != null) { + queryParameters['layers'] = requestParameters['layers']; } - if (requestParameters.crs !== undefined) { - queryParameters['crs'] = requestParameters.crs; + if (requestParameters['crs'] != null) { + queryParameters['crs'] = requestParameters['crs']; } - if (requestParameters.styles !== undefined) { - queryParameters['styles'] = requestParameters.styles; + if (requestParameters['styles'] != null) { + queryParameters['styles'] = requestParameters['styles']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.transparent !== undefined) { - queryParameters['transparent'] = requestParameters.transparent; + if (requestParameters['transparent'] != null) { + queryParameters['transparent'] = requestParameters['transparent']; } - if (requestParameters.bgcolor !== undefined) { - queryParameters['bgcolor'] = requestParameters.bgcolor; + if (requestParameters['bgcolor'] != null) { + queryParameters['bgcolor'] = requestParameters['bgcolor']; } - if (requestParameters.sld !== undefined) { - queryParameters['sld'] = requestParameters.sld; + if (requestParameters['sld'] != null) { + queryParameters['sld'] = requestParameters['sld']; } - if (requestParameters.sldBody !== undefined) { - queryParameters['sld_body'] = requestParameters.sldBody; + if (requestParameters['sldBody'] != null) { + queryParameters['sld_body'] = requestParameters['sldBody']; } - if (requestParameters.elevation !== undefined) { - queryParameters['elevation'] = requestParameters.elevation; + if (requestParameters['elevation'] != null) { + queryParameters['elevation'] = requestParameters['elevation']; } - if (requestParameters.exceptions !== undefined) { - queryParameters['exceptions'] = requestParameters.exceptions; + if (requestParameters['exceptions'] != null) { + queryParameters['exceptions'] = requestParameters['exceptions']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -219,7 +219,7 @@ export class OGCWMSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wms/{workflow}?request=GetMap`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wms/{workflow}?request=GetMap`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/esm/apis/PermissionsApi.js b/typescript/dist/esm/apis/PermissionsApi.js index 539dd213..0217a126 100644 --- a/typescript/dist/esm/apis/PermissionsApi.js +++ b/typescript/dist/esm/apis/PermissionsApi.js @@ -31,8 +31,8 @@ export class PermissionsApi extends runtime.BaseAPI { */ addPermissionHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.permissionRequest === null || requestParameters.permissionRequest === undefined) { - throw new runtime.RequiredError('permissionRequest', 'Required parameter requestParameters.permissionRequest was null or undefined when calling addPermissionHandler.'); + if (requestParameters['permissionRequest'] == null) { + throw new runtime.RequiredError('permissionRequest', 'Required parameter "permissionRequest" was null or undefined when calling addPermissionHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -49,7 +49,7 @@ export class PermissionsApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: PermissionRequestToJSON(requestParameters.permissionRequest), + body: PermissionRequestToJSON(requestParameters['permissionRequest']), }, initOverrides); return new runtime.VoidApiResponse(response); }); @@ -67,24 +67,24 @@ export class PermissionsApi extends runtime.BaseAPI { */ getResourcePermissionsHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.resourceType === null || requestParameters.resourceType === undefined) { - throw new runtime.RequiredError('resourceType', 'Required parameter requestParameters.resourceType was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['resourceType'] == null) { + throw new runtime.RequiredError('resourceType', 'Required parameter "resourceType" was null or undefined when calling getResourcePermissionsHandler().'); } - if (requestParameters.resourceId === null || requestParameters.resourceId === undefined) { - throw new runtime.RequiredError('resourceId', 'Required parameter requestParameters.resourceId was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['resourceId'] == null) { + throw new runtime.RequiredError('resourceId', 'Required parameter "resourceId" was null or undefined when calling getResourcePermissionsHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling getResourcePermissionsHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling getResourcePermissionsHandler().'); } const queryParameters = {}; - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -95,7 +95,7 @@ export class PermissionsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/permissions/resources/{resource_type}/{resource_id}`.replace(`{${"resource_type"}}`, encodeURIComponent(String(requestParameters.resourceType))).replace(`{${"resource_id"}}`, encodeURIComponent(String(requestParameters.resourceId))), + path: `/permissions/resources/{resource_type}/{resource_id}`.replace(`{${"resource_type"}}`, encodeURIComponent(String(requestParameters['resourceType']))).replace(`{${"resource_id"}}`, encodeURIComponent(String(requestParameters['resourceId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -117,8 +117,8 @@ export class PermissionsApi extends runtime.BaseAPI { */ removePermissionHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.permissionRequest === null || requestParameters.permissionRequest === undefined) { - throw new runtime.RequiredError('permissionRequest', 'Required parameter requestParameters.permissionRequest was null or undefined when calling removePermissionHandler.'); + if (requestParameters['permissionRequest'] == null) { + throw new runtime.RequiredError('permissionRequest', 'Required parameter "permissionRequest" was null or undefined when calling removePermissionHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -135,7 +135,7 @@ export class PermissionsApi extends runtime.BaseAPI { method: 'DELETE', headers: headerParameters, query: queryParameters, - body: PermissionRequestToJSON(requestParameters.permissionRequest), + body: PermissionRequestToJSON(requestParameters['permissionRequest']), }, initOverrides); return new runtime.VoidApiResponse(response); }); diff --git a/typescript/dist/esm/apis/PlotsApi.js b/typescript/dist/esm/apis/PlotsApi.js index 941d550a..5fda9ec1 100644 --- a/typescript/dist/esm/apis/PlotsApi.js +++ b/typescript/dist/esm/apis/PlotsApi.js @@ -32,30 +32,30 @@ export class PlotsApi extends runtime.BaseAPI { */ getPlotHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.bbox === null || requestParameters.bbox === undefined) { - throw new runtime.RequiredError('bbox', 'Required parameter requestParameters.bbox was null or undefined when calling getPlotHandler.'); + if (requestParameters['bbox'] == null) { + throw new runtime.RequiredError('bbox', 'Required parameter "bbox" was null or undefined when calling getPlotHandler().'); } - if (requestParameters.time === null || requestParameters.time === undefined) { - throw new runtime.RequiredError('time', 'Required parameter requestParameters.time was null or undefined when calling getPlotHandler.'); + if (requestParameters['time'] == null) { + throw new runtime.RequiredError('time', 'Required parameter "time" was null or undefined when calling getPlotHandler().'); } - if (requestParameters.spatialResolution === null || requestParameters.spatialResolution === undefined) { - throw new runtime.RequiredError('spatialResolution', 'Required parameter requestParameters.spatialResolution was null or undefined when calling getPlotHandler.'); + if (requestParameters['spatialResolution'] == null) { + throw new runtime.RequiredError('spatialResolution', 'Required parameter "spatialResolution" was null or undefined when calling getPlotHandler().'); } - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling getPlotHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getPlotHandler().'); } const queryParameters = {}; - if (requestParameters.bbox !== undefined) { - queryParameters['bbox'] = requestParameters.bbox; + if (requestParameters['bbox'] != null) { + queryParameters['bbox'] = requestParameters['bbox']; } - if (requestParameters.crs !== undefined) { - queryParameters['crs'] = requestParameters.crs; + if (requestParameters['crs'] != null) { + queryParameters['crs'] = requestParameters['crs']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.spatialResolution !== undefined) { - queryParameters['spatialResolution'] = requestParameters.spatialResolution; + if (requestParameters['spatialResolution'] != null) { + queryParameters['spatialResolution'] = requestParameters['spatialResolution']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -66,7 +66,7 @@ export class PlotsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/plot/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/plot/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/esm/apis/ProjectsApi.js b/typescript/dist/esm/apis/ProjectsApi.js index 3b551245..16aad0ea 100644 --- a/typescript/dist/esm/apis/ProjectsApi.js +++ b/typescript/dist/esm/apis/ProjectsApi.js @@ -31,8 +31,8 @@ export class ProjectsApi extends runtime.BaseAPI { */ createProjectHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.createProject === null || requestParameters.createProject === undefined) { - throw new runtime.RequiredError('createProject', 'Required parameter requestParameters.createProject was null or undefined when calling createProjectHandler.'); + if (requestParameters['createProject'] == null) { + throw new runtime.RequiredError('createProject', 'Required parameter "createProject" was null or undefined when calling createProjectHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -49,7 +49,7 @@ export class ProjectsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: CreateProjectToJSON(requestParameters.createProject), + body: CreateProjectToJSON(requestParameters['createProject']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AddCollection200ResponseFromJSON(jsonValue)); }); @@ -68,8 +68,8 @@ export class ProjectsApi extends runtime.BaseAPI { */ deleteProjectHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling deleteProjectHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError('project', 'Required parameter "project" was null or undefined when calling deleteProjectHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -81,7 +81,7 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -102,14 +102,14 @@ export class ProjectsApi extends runtime.BaseAPI { */ listProjectsHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.order === null || requestParameters.order === undefined) { - throw new runtime.RequiredError('order', 'Required parameter requestParameters.order was null or undefined when calling listProjectsHandler.'); + if (requestParameters['order'] == null) { + throw new runtime.RequiredError('order', 'Required parameter "order" was null or undefined when calling listProjectsHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling listProjectsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling listProjectsHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling listProjectsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling listProjectsHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -121,7 +121,7 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/projects`.replace(`{${"order"}}`, encodeURIComponent(String(requestParameters.order))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters.offset))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters.limit))), + path: `/projects`.replace(`{${"order"}}`, encodeURIComponent(String(requestParameters['order']))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters['offset']))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters['limit']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -143,8 +143,8 @@ export class ProjectsApi extends runtime.BaseAPI { */ loadProjectLatestHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling loadProjectLatestHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError('project', 'Required parameter "project" was null or undefined when calling loadProjectLatestHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -156,7 +156,7 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -178,11 +178,11 @@ export class ProjectsApi extends runtime.BaseAPI { */ loadProjectVersionHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling loadProjectVersionHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError('project', 'Required parameter "project" was null or undefined when calling loadProjectVersionHandler().'); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling loadProjectVersionHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError('version', 'Required parameter "version" was null or undefined when calling loadProjectVersionHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -194,7 +194,7 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/project/{project}/{version}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))), + path: `/project/{project}/{version}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -216,8 +216,8 @@ export class ProjectsApi extends runtime.BaseAPI { */ projectVersionsHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling projectVersionsHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError('project', 'Required parameter "project" was null or undefined when calling projectVersionsHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -229,7 +229,7 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/project/{project}/versions`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}/versions`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -252,11 +252,11 @@ export class ProjectsApi extends runtime.BaseAPI { */ updateProjectHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling updateProjectHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError('project', 'Required parameter "project" was null or undefined when calling updateProjectHandler().'); } - if (requestParameters.updateProject === null || requestParameters.updateProject === undefined) { - throw new runtime.RequiredError('updateProject', 'Required parameter requestParameters.updateProject was null or undefined when calling updateProjectHandler.'); + if (requestParameters['updateProject'] == null) { + throw new runtime.RequiredError('updateProject', 'Required parameter "updateProject" was null or undefined when calling updateProjectHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -269,11 +269,11 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'PATCH', headers: headerParameters, query: queryParameters, - body: UpdateProjectToJSON(requestParameters.updateProject), + body: UpdateProjectToJSON(requestParameters['updateProject']), }, initOverrides); return new runtime.VoidApiResponse(response); }); diff --git a/typescript/dist/esm/apis/SessionApi.js b/typescript/dist/esm/apis/SessionApi.js index 30984b77..7315e233 100644 --- a/typescript/dist/esm/apis/SessionApi.js +++ b/typescript/dist/esm/apis/SessionApi.js @@ -56,8 +56,8 @@ export class SessionApi extends runtime.BaseAPI { */ loginHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.userCredentials === null || requestParameters.userCredentials === undefined) { - throw new runtime.RequiredError('userCredentials', 'Required parameter requestParameters.userCredentials was null or undefined when calling loginHandler.'); + if (requestParameters['userCredentials'] == null) { + throw new runtime.RequiredError('userCredentials', 'Required parameter "userCredentials" was null or undefined when calling loginHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -67,7 +67,7 @@ export class SessionApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: UserCredentialsToJSON(requestParameters.userCredentials), + body: UserCredentialsToJSON(requestParameters['userCredentials']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => UserSessionFromJSON(jsonValue)); }); @@ -118,12 +118,12 @@ export class SessionApi extends runtime.BaseAPI { */ oidcInitRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.redirectUri === null || requestParameters.redirectUri === undefined) { - throw new runtime.RequiredError('redirectUri', 'Required parameter requestParameters.redirectUri was null or undefined when calling oidcInit.'); + if (requestParameters['redirectUri'] == null) { + throw new runtime.RequiredError('redirectUri', 'Required parameter "redirectUri" was null or undefined when calling oidcInit().'); } const queryParameters = {}; - if (requestParameters.redirectUri !== undefined) { - queryParameters['redirectUri'] = requestParameters.redirectUri; + if (requestParameters['redirectUri'] != null) { + queryParameters['redirectUri'] = requestParameters['redirectUri']; } const headerParameters = {}; const response = yield this.request({ @@ -151,15 +151,15 @@ export class SessionApi extends runtime.BaseAPI { */ oidcLoginRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.redirectUri === null || requestParameters.redirectUri === undefined) { - throw new runtime.RequiredError('redirectUri', 'Required parameter requestParameters.redirectUri was null or undefined when calling oidcLogin.'); + if (requestParameters['redirectUri'] == null) { + throw new runtime.RequiredError('redirectUri', 'Required parameter "redirectUri" was null or undefined when calling oidcLogin().'); } - if (requestParameters.authCodeResponse === null || requestParameters.authCodeResponse === undefined) { - throw new runtime.RequiredError('authCodeResponse', 'Required parameter requestParameters.authCodeResponse was null or undefined when calling oidcLogin.'); + if (requestParameters['authCodeResponse'] == null) { + throw new runtime.RequiredError('authCodeResponse', 'Required parameter "authCodeResponse" was null or undefined when calling oidcLogin().'); } const queryParameters = {}; - if (requestParameters.redirectUri !== undefined) { - queryParameters['redirectUri'] = requestParameters.redirectUri; + if (requestParameters['redirectUri'] != null) { + queryParameters['redirectUri'] = requestParameters['redirectUri']; } const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; @@ -168,7 +168,7 @@ export class SessionApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: AuthCodeResponseToJSON(requestParameters.authCodeResponse), + body: AuthCodeResponseToJSON(requestParameters['authCodeResponse']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => UserSessionFromJSON(jsonValue)); }); @@ -188,8 +188,8 @@ export class SessionApi extends runtime.BaseAPI { */ registerUserHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.userRegistration === null || requestParameters.userRegistration === undefined) { - throw new runtime.RequiredError('userRegistration', 'Required parameter requestParameters.userRegistration was null or undefined when calling registerUserHandler.'); + if (requestParameters['userRegistration'] == null) { + throw new runtime.RequiredError('userRegistration', 'Required parameter "userRegistration" was null or undefined when calling registerUserHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -199,7 +199,7 @@ export class SessionApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: UserRegistrationToJSON(requestParameters.userRegistration), + body: UserRegistrationToJSON(requestParameters['userRegistration']), }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); diff --git a/typescript/dist/esm/apis/SpatialReferencesApi.js b/typescript/dist/esm/apis/SpatialReferencesApi.js index 54c305a2..e43f07de 100644 --- a/typescript/dist/esm/apis/SpatialReferencesApi.js +++ b/typescript/dist/esm/apis/SpatialReferencesApi.js @@ -30,8 +30,8 @@ export class SpatialReferencesApi extends runtime.BaseAPI { */ getSpatialReferenceSpecificationHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.srsString === null || requestParameters.srsString === undefined) { - throw new runtime.RequiredError('srsString', 'Required parameter requestParameters.srsString was null or undefined when calling getSpatialReferenceSpecificationHandler.'); + if (requestParameters['srsString'] == null) { + throw new runtime.RequiredError('srsString', 'Required parameter "srsString" was null or undefined when calling getSpatialReferenceSpecificationHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -43,7 +43,7 @@ export class SpatialReferencesApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/spatialReferenceSpecification/{srsString}`.replace(`{${"srsString"}}`, encodeURIComponent(String(requestParameters.srsString))), + path: `/spatialReferenceSpecification/{srsString}`.replace(`{${"srsString"}}`, encodeURIComponent(String(requestParameters['srsString']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/esm/apis/TasksApi.js b/typescript/dist/esm/apis/TasksApi.js index a4282b34..6cab1673 100644 --- a/typescript/dist/esm/apis/TasksApi.js +++ b/typescript/dist/esm/apis/TasksApi.js @@ -32,12 +32,12 @@ export class TasksApi extends runtime.BaseAPI { */ abortHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling abortHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling abortHandler().'); } const queryParameters = {}; - if (requestParameters.force !== undefined) { - queryParameters['force'] = requestParameters.force; + if (requestParameters['force'] != null) { + queryParameters['force'] = requestParameters['force']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -48,7 +48,7 @@ export class TasksApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/tasks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/tasks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -70,14 +70,14 @@ export class TasksApi extends runtime.BaseAPI { */ listHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.filter === null || requestParameters.filter === undefined) { - throw new runtime.RequiredError('filter', 'Required parameter requestParameters.filter was null or undefined when calling listHandler.'); + if (requestParameters['filter'] == null) { + throw new runtime.RequiredError('filter', 'Required parameter "filter" was null or undefined when calling listHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling listHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling listHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling listHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling listHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -89,7 +89,7 @@ export class TasksApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/tasks/list`.replace(`{${"filter"}}`, encodeURIComponent(String(requestParameters.filter))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters.offset))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters.limit))), + path: `/tasks/list`.replace(`{${"filter"}}`, encodeURIComponent(String(requestParameters['filter']))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters['offset']))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters['limit']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -111,8 +111,8 @@ export class TasksApi extends runtime.BaseAPI { */ statusHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling statusHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling statusHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -124,7 +124,7 @@ export class TasksApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/tasks/{id}/status`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/tasks/{id}/status`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/esm/apis/UploadsApi.js b/typescript/dist/esm/apis/UploadsApi.js index d8de0a28..637758c6 100644 --- a/typescript/dist/esm/apis/UploadsApi.js +++ b/typescript/dist/esm/apis/UploadsApi.js @@ -31,11 +31,11 @@ export class UploadsApi extends runtime.BaseAPI { */ listUploadFileLayersHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) { - throw new runtime.RequiredError('uploadId', 'Required parameter requestParameters.uploadId was null or undefined when calling listUploadFileLayersHandler.'); + if (requestParameters['uploadId'] == null) { + throw new runtime.RequiredError('uploadId', 'Required parameter "uploadId" was null or undefined when calling listUploadFileLayersHandler().'); } - if (requestParameters.fileName === null || requestParameters.fileName === undefined) { - throw new runtime.RequiredError('fileName', 'Required parameter requestParameters.fileName was null or undefined when calling listUploadFileLayersHandler.'); + if (requestParameters['fileName'] == null) { + throw new runtime.RequiredError('fileName', 'Required parameter "fileName" was null or undefined when calling listUploadFileLayersHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -47,7 +47,7 @@ export class UploadsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/uploads/{upload_id}/files/{file_name}/layers`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters.uploadId))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters.fileName))), + path: `/uploads/{upload_id}/files/{file_name}/layers`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters['uploadId']))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters['fileName']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -69,8 +69,8 @@ export class UploadsApi extends runtime.BaseAPI { */ listUploadFilesHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) { - throw new runtime.RequiredError('uploadId', 'Required parameter requestParameters.uploadId was null or undefined when calling listUploadFilesHandler.'); + if (requestParameters['uploadId'] == null) { + throw new runtime.RequiredError('uploadId', 'Required parameter "uploadId" was null or undefined when calling listUploadFilesHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -82,7 +82,7 @@ export class UploadsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/uploads/{upload_id}/files`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters.uploadId))), + path: `/uploads/{upload_id}/files`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters['uploadId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -104,8 +104,8 @@ export class UploadsApi extends runtime.BaseAPI { */ uploadHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.files === null || requestParameters.files === undefined) { - throw new runtime.RequiredError('files', 'Required parameter requestParameters.files was null or undefined when calling uploadHandler.'); + if (requestParameters['files'] == null) { + throw new runtime.RequiredError('files', 'Required parameter "files" was null or undefined when calling uploadHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -131,8 +131,8 @@ export class UploadsApi extends runtime.BaseAPI { else { formParams = new URLSearchParams(); } - if (requestParameters.files) { - requestParameters.files.forEach((element) => { + if (requestParameters['files'] != null) { + requestParameters['files'].forEach((element) => { formParams.append('files[]', element); }); } diff --git a/typescript/dist/esm/apis/UserApi.js b/typescript/dist/esm/apis/UserApi.js index b4fb61d4..676ac3ec 100644 --- a/typescript/dist/esm/apis/UserApi.js +++ b/typescript/dist/esm/apis/UserApi.js @@ -31,8 +31,8 @@ export class UserApi extends runtime.BaseAPI { */ addRoleHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.addRole === null || requestParameters.addRole === undefined) { - throw new runtime.RequiredError('addRole', 'Required parameter requestParameters.addRole was null or undefined when calling addRoleHandler.'); + if (requestParameters['addRole'] == null) { + throw new runtime.RequiredError('addRole', 'Required parameter "addRole" was null or undefined when calling addRoleHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -49,7 +49,7 @@ export class UserApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: AddRoleToJSON(requestParameters.addRole), + body: AddRoleToJSON(requestParameters['addRole']), }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); @@ -73,11 +73,11 @@ export class UserApi extends runtime.BaseAPI { */ assignRoleHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling assignRoleHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling assignRoleHandler().'); } - if (requestParameters.role === null || requestParameters.role === undefined) { - throw new runtime.RequiredError('role', 'Required parameter requestParameters.role was null or undefined when calling assignRoleHandler.'); + if (requestParameters['role'] == null) { + throw new runtime.RequiredError('role', 'Required parameter "role" was null or undefined when calling assignRoleHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -89,7 +89,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters.role))), + path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters['role']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -110,8 +110,8 @@ export class UserApi extends runtime.BaseAPI { */ computationQuotaHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.computation === null || requestParameters.computation === undefined) { - throw new runtime.RequiredError('computation', 'Required parameter requestParameters.computation was null or undefined when calling computationQuotaHandler.'); + if (requestParameters['computation'] == null) { + throw new runtime.RequiredError('computation', 'Required parameter "computation" was null or undefined when calling computationQuotaHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -123,7 +123,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/quota/computations/{computation}`.replace(`{${"computation"}}`, encodeURIComponent(String(requestParameters.computation))), + path: `/quota/computations/{computation}`.replace(`{${"computation"}}`, encodeURIComponent(String(requestParameters['computation']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -145,18 +145,18 @@ export class UserApi extends runtime.BaseAPI { */ computationsQuotaHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling computationsQuotaHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling computationsQuotaHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling computationsQuotaHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling computationsQuotaHandler().'); } const queryParameters = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -189,18 +189,18 @@ export class UserApi extends runtime.BaseAPI { */ dataUsageHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling dataUsageHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling dataUsageHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling dataUsageHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling dataUsageHandler().'); } const queryParameters = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -233,27 +233,27 @@ export class UserApi extends runtime.BaseAPI { */ dataUsageSummaryHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.granularity === null || requestParameters.granularity === undefined) { - throw new runtime.RequiredError('granularity', 'Required parameter requestParameters.granularity was null or undefined when calling dataUsageSummaryHandler.'); + if (requestParameters['granularity'] == null) { + throw new runtime.RequiredError('granularity', 'Required parameter "granularity" was null or undefined when calling dataUsageSummaryHandler().'); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset', 'Required parameter requestParameters.offset was null or undefined when calling dataUsageSummaryHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError('offset', 'Required parameter "offset" was null or undefined when calling dataUsageSummaryHandler().'); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit', 'Required parameter requestParameters.limit was null or undefined when calling dataUsageSummaryHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError('limit', 'Required parameter "limit" was null or undefined when calling dataUsageSummaryHandler().'); } const queryParameters = {}; - if (requestParameters.granularity !== undefined) { - queryParameters['granularity'] = requestParameters.granularity; + if (requestParameters['granularity'] != null) { + queryParameters['granularity'] = requestParameters['granularity']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.dataset !== undefined) { - queryParameters['dataset'] = requestParameters.dataset; + if (requestParameters['dataset'] != null) { + queryParameters['dataset'] = requestParameters['dataset']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -286,8 +286,8 @@ export class UserApi extends runtime.BaseAPI { */ getRoleByNameHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name', 'Required parameter requestParameters.name was null or undefined when calling getRoleByNameHandler.'); + if (requestParameters['name'] == null) { + throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling getRoleByNameHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -299,7 +299,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/roles/byName/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + path: `/roles/byName/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters['name']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -353,8 +353,8 @@ export class UserApi extends runtime.BaseAPI { */ getUserQuotaHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling getUserQuotaHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling getUserQuotaHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -366,7 +366,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))), + path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -420,8 +420,8 @@ export class UserApi extends runtime.BaseAPI { */ removeRoleHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.role === null || requestParameters.role === undefined) { - throw new runtime.RequiredError('role', 'Required parameter requestParameters.role was null or undefined when calling removeRoleHandler.'); + if (requestParameters['role'] == null) { + throw new runtime.RequiredError('role', 'Required parameter "role" was null or undefined when calling removeRoleHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -433,7 +433,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/roles/{role}`.replace(`{${"role"}}`, encodeURIComponent(String(requestParameters.role))), + path: `/roles/{role}`.replace(`{${"role"}}`, encodeURIComponent(String(requestParameters['role']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -454,11 +454,11 @@ export class UserApi extends runtime.BaseAPI { */ revokeRoleHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling revokeRoleHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling revokeRoleHandler().'); } - if (requestParameters.role === null || requestParameters.role === undefined) { - throw new runtime.RequiredError('role', 'Required parameter requestParameters.role was null or undefined when calling revokeRoleHandler.'); + if (requestParameters['role'] == null) { + throw new runtime.RequiredError('role', 'Required parameter "role" was null or undefined when calling revokeRoleHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -470,7 +470,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters.role))), + path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters['role']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -491,11 +491,11 @@ export class UserApi extends runtime.BaseAPI { */ updateUserQuotaHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user', 'Required parameter requestParameters.user was null or undefined when calling updateUserQuotaHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError('user', 'Required parameter "user" was null or undefined when calling updateUserQuotaHandler().'); } - if (requestParameters.updateQuota === null || requestParameters.updateQuota === undefined) { - throw new runtime.RequiredError('updateQuota', 'Required parameter requestParameters.updateQuota was null or undefined when calling updateUserQuotaHandler.'); + if (requestParameters['updateQuota'] == null) { + throw new runtime.RequiredError('updateQuota', 'Required parameter "updateQuota" was null or undefined when calling updateUserQuotaHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -508,11 +508,11 @@ export class UserApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))), + path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: UpdateQuotaToJSON(requestParameters.updateQuota), + body: UpdateQuotaToJSON(requestParameters['updateQuota']), }, initOverrides); return new runtime.VoidApiResponse(response); }); diff --git a/typescript/dist/esm/apis/WorkflowsApi.js b/typescript/dist/esm/apis/WorkflowsApi.js index aef70003..325a86d8 100644 --- a/typescript/dist/esm/apis/WorkflowsApi.js +++ b/typescript/dist/esm/apis/WorkflowsApi.js @@ -32,11 +32,11 @@ export class WorkflowsApi extends runtime.BaseAPI { */ datasetFromWorkflowHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling datasetFromWorkflowHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling datasetFromWorkflowHandler().'); } - if (requestParameters.rasterDatasetFromWorkflow === null || requestParameters.rasterDatasetFromWorkflow === undefined) { - throw new runtime.RequiredError('rasterDatasetFromWorkflow', 'Required parameter requestParameters.rasterDatasetFromWorkflow was null or undefined when calling datasetFromWorkflowHandler.'); + if (requestParameters['rasterDatasetFromWorkflow'] == null) { + throw new runtime.RequiredError('rasterDatasetFromWorkflow', 'Required parameter "rasterDatasetFromWorkflow" was null or undefined when calling datasetFromWorkflowHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -49,11 +49,11 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/datasetFromWorkflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/datasetFromWorkflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: RasterDatasetFromWorkflowToJSON(requestParameters.rasterDatasetFromWorkflow), + body: RasterDatasetFromWorkflowToJSON(requestParameters['rasterDatasetFromWorkflow']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => TaskResponseFromJSON(jsonValue)); }); @@ -73,8 +73,8 @@ export class WorkflowsApi extends runtime.BaseAPI { */ getWorkflowAllMetadataZipHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling getWorkflowAllMetadataZipHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getWorkflowAllMetadataZipHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -86,7 +86,7 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/workflow/{id}/allMetadata/zip`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/allMetadata/zip`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -108,8 +108,8 @@ export class WorkflowsApi extends runtime.BaseAPI { */ getWorkflowMetadataHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling getWorkflowMetadataHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getWorkflowMetadataHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -121,7 +121,7 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/workflow/{id}/metadata`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/metadata`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -143,8 +143,8 @@ export class WorkflowsApi extends runtime.BaseAPI { */ getWorkflowProvenanceHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling getWorkflowProvenanceHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getWorkflowProvenanceHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -156,7 +156,7 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/workflow/{id}/provenance`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/provenance`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -178,8 +178,8 @@ export class WorkflowsApi extends runtime.BaseAPI { */ loadWorkflowHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling loadWorkflowHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling loadWorkflowHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -191,7 +191,7 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/workflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -213,39 +213,39 @@ export class WorkflowsApi extends runtime.BaseAPI { */ rasterStreamWebsocketRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling rasterStreamWebsocket().'); } - if (requestParameters.spatialBounds === null || requestParameters.spatialBounds === undefined) { - throw new runtime.RequiredError('spatialBounds', 'Required parameter requestParameters.spatialBounds was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['spatialBounds'] == null) { + throw new runtime.RequiredError('spatialBounds', 'Required parameter "spatialBounds" was null or undefined when calling rasterStreamWebsocket().'); } - if (requestParameters.timeInterval === null || requestParameters.timeInterval === undefined) { - throw new runtime.RequiredError('timeInterval', 'Required parameter requestParameters.timeInterval was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['timeInterval'] == null) { + throw new runtime.RequiredError('timeInterval', 'Required parameter "timeInterval" was null or undefined when calling rasterStreamWebsocket().'); } - if (requestParameters.spatialResolution === null || requestParameters.spatialResolution === undefined) { - throw new runtime.RequiredError('spatialResolution', 'Required parameter requestParameters.spatialResolution was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['spatialResolution'] == null) { + throw new runtime.RequiredError('spatialResolution', 'Required parameter "spatialResolution" was null or undefined when calling rasterStreamWebsocket().'); } - if (requestParameters.attributes === null || requestParameters.attributes === undefined) { - throw new runtime.RequiredError('attributes', 'Required parameter requestParameters.attributes was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['attributes'] == null) { + throw new runtime.RequiredError('attributes', 'Required parameter "attributes" was null or undefined when calling rasterStreamWebsocket().'); } - if (requestParameters.resultType === null || requestParameters.resultType === undefined) { - throw new runtime.RequiredError('resultType', 'Required parameter requestParameters.resultType was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['resultType'] == null) { + throw new runtime.RequiredError('resultType', 'Required parameter "resultType" was null or undefined when calling rasterStreamWebsocket().'); } const queryParameters = {}; - if (requestParameters.spatialBounds !== undefined) { - queryParameters['spatialBounds'] = requestParameters.spatialBounds; + if (requestParameters['spatialBounds'] != null) { + queryParameters['spatialBounds'] = requestParameters['spatialBounds']; } - if (requestParameters.timeInterval !== undefined) { - queryParameters['timeInterval'] = requestParameters.timeInterval; + if (requestParameters['timeInterval'] != null) { + queryParameters['timeInterval'] = requestParameters['timeInterval']; } - if (requestParameters.spatialResolution !== undefined) { - queryParameters['spatialResolution'] = requestParameters.spatialResolution; + if (requestParameters['spatialResolution'] != null) { + queryParameters['spatialResolution'] = requestParameters['spatialResolution']; } - if (requestParameters.attributes !== undefined) { - queryParameters['attributes'] = requestParameters.attributes; + if (requestParameters['attributes'] != null) { + queryParameters['attributes'] = requestParameters['attributes']; } - if (requestParameters.resultType !== undefined) { - queryParameters['resultType'] = requestParameters.resultType; + if (requestParameters['resultType'] != null) { + queryParameters['resultType'] = requestParameters['resultType']; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { @@ -256,7 +256,7 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/workflow/{id}/rasterStream`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/rasterStream`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -277,8 +277,8 @@ export class WorkflowsApi extends runtime.BaseAPI { */ registerWorkflowHandlerRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling registerWorkflowHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError('workflow', 'Required parameter "workflow" was null or undefined when calling registerWorkflowHandler().'); } const queryParameters = {}; const headerParameters = {}; @@ -295,7 +295,7 @@ export class WorkflowsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: WorkflowToJSON(requestParameters.workflow), + body: WorkflowToJSON(requestParameters['workflow']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AddCollection200ResponseFromJSON(jsonValue)); }); diff --git a/typescript/dist/esm/models/AddCollection200Response.d.ts b/typescript/dist/esm/models/AddCollection200Response.d.ts index 88f8e1b0..539cbe7d 100644 --- a/typescript/dist/esm/models/AddCollection200Response.d.ts +++ b/typescript/dist/esm/models/AddCollection200Response.d.ts @@ -25,7 +25,8 @@ export interface AddCollection200Response { /** * Check if a given object implements the AddCollection200Response interface. */ -export declare function instanceOfAddCollection200Response(value: object): boolean; +export declare function instanceOfAddCollection200Response(value: object): value is AddCollection200Response; export declare function AddCollection200ResponseFromJSON(json: any): AddCollection200Response; export declare function AddCollection200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddCollection200Response; -export declare function AddCollection200ResponseToJSON(value?: AddCollection200Response | null): any; +export declare function AddCollection200ResponseToJSON(json: any): AddCollection200Response; +export declare function AddCollection200ResponseToJSONTyped(value?: AddCollection200Response | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/AddCollection200Response.js b/typescript/dist/esm/models/AddCollection200Response.js index d3a44c1b..a3a51abe 100644 --- a/typescript/dist/esm/models/AddCollection200Response.js +++ b/typescript/dist/esm/models/AddCollection200Response.js @@ -15,29 +15,29 @@ * Check if a given object implements the AddCollection200Response interface. */ export function instanceOfAddCollection200Response(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + return true; } export function AddCollection200ResponseFromJSON(json) { return AddCollection200ResponseFromJSONTyped(json, false); } export function AddCollection200ResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'id': json['id'], }; } -export function AddCollection200ResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AddCollection200ResponseToJSON(json) { + return AddCollection200ResponseToJSONTyped(json, false); +} +export function AddCollection200ResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, + 'id': value['id'], }; } diff --git a/typescript/dist/esm/models/AddDataset.d.ts b/typescript/dist/esm/models/AddDataset.d.ts index 4e6ef7b6..56b75997 100644 --- a/typescript/dist/esm/models/AddDataset.d.ts +++ b/typescript/dist/esm/models/AddDataset.d.ts @@ -63,7 +63,8 @@ export interface AddDataset { /** * Check if a given object implements the AddDataset interface. */ -export declare function instanceOfAddDataset(value: object): boolean; +export declare function instanceOfAddDataset(value: object): value is AddDataset; export declare function AddDatasetFromJSON(json: any): AddDataset; export declare function AddDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddDataset; -export declare function AddDatasetToJSON(value?: AddDataset | null): any; +export declare function AddDatasetToJSON(json: any): AddDataset; +export declare function AddDatasetToJSONTyped(value?: AddDataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/AddDataset.js b/typescript/dist/esm/models/AddDataset.js index ccb7c110..dad77311 100644 --- a/typescript/dist/esm/models/AddDataset.js +++ b/typescript/dist/esm/models/AddDataset.js @@ -11,50 +11,51 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { ProvenanceFromJSON, ProvenanceToJSON, } from './Provenance'; import { SymbologyFromJSON, SymbologyToJSON, } from './Symbology'; /** * Check if a given object implements the AddDataset interface. */ export function instanceOfAddDataset(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "sourceOperator" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('sourceOperator' in value) || value['sourceOperator'] === undefined) + return false; + return true; } export function AddDatasetFromJSON(json) { return AddDatasetFromJSONTyped(json, false); } export function AddDatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'displayName': json['displayName'], - 'name': !exists(json, 'name') ? undefined : json['name'], - 'provenance': !exists(json, 'provenance') ? undefined : (json['provenance'] === null ? null : json['provenance'].map(ProvenanceFromJSON)), + 'name': json['name'] == null ? undefined : json['name'], + 'provenance': json['provenance'] == null ? undefined : (json['provenance'].map(ProvenanceFromJSON)), 'sourceOperator': json['sourceOperator'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), - 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), + 'tags': json['tags'] == null ? undefined : json['tags'], }; } -export function AddDatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AddDatasetToJSON(json) { + return AddDatasetToJSONTyped(json, false); +} +export function AddDatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'displayName': value.displayName, - 'name': value.name, - 'provenance': value.provenance === undefined ? undefined : (value.provenance === null ? null : value.provenance.map(ProvenanceToJSON)), - 'sourceOperator': value.sourceOperator, - 'symbology': SymbologyToJSON(value.symbology), - 'tags': value.tags, + 'description': value['description'], + 'displayName': value['displayName'], + 'name': value['name'], + 'provenance': value['provenance'] == null ? undefined : (value['provenance'].map(ProvenanceToJSON)), + 'sourceOperator': value['sourceOperator'], + 'symbology': SymbologyToJSON(value['symbology']), + 'tags': value['tags'], }; } diff --git a/typescript/dist/esm/models/AddLayer.d.ts b/typescript/dist/esm/models/AddLayer.d.ts index 340739e6..7801eab1 100644 --- a/typescript/dist/esm/models/AddLayer.d.ts +++ b/typescript/dist/esm/models/AddLayer.d.ts @@ -59,7 +59,8 @@ export interface AddLayer { /** * Check if a given object implements the AddLayer interface. */ -export declare function instanceOfAddLayer(value: object): boolean; +export declare function instanceOfAddLayer(value: object): value is AddLayer; export declare function AddLayerFromJSON(json: any): AddLayer; export declare function AddLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddLayer; -export declare function AddLayerToJSON(value?: AddLayer | null): any; +export declare function AddLayerToJSON(json: any): AddLayer; +export declare function AddLayerToJSONTyped(value?: AddLayer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/AddLayer.js b/typescript/dist/esm/models/AddLayer.js index 034bef96..d7a1441c 100644 --- a/typescript/dist/esm/models/AddLayer.js +++ b/typescript/dist/esm/models/AddLayer.js @@ -11,48 +11,49 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { SymbologyFromJSON, SymbologyToJSON, } from './Symbology'; import { WorkflowFromJSON, WorkflowToJSON, } from './Workflow'; /** * Check if a given object implements the AddLayer interface. */ export function instanceOfAddLayer(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('workflow' in value) || value['workflow'] === undefined) + return false; + return true; } export function AddLayerFromJSON(json) { return AddLayerFromJSONTyped(json, false); } export function AddLayerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], - 'metadata': !exists(json, 'metadata') ? undefined : json['metadata'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), + 'properties': json['properties'] == null ? undefined : json['properties'], + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), 'workflow': WorkflowFromJSON(json['workflow']), }; } -export function AddLayerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AddLayerToJSON(json) { + return AddLayerToJSONTyped(json, false); +} +export function AddLayerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'metadata': value.metadata, - 'name': value.name, - 'properties': value.properties, - 'symbology': SymbologyToJSON(value.symbology), - 'workflow': WorkflowToJSON(value.workflow), + 'description': value['description'], + 'metadata': value['metadata'], + 'name': value['name'], + 'properties': value['properties'], + 'symbology': SymbologyToJSON(value['symbology']), + 'workflow': WorkflowToJSON(value['workflow']), }; } diff --git a/typescript/dist/esm/models/AddLayerCollection.d.ts b/typescript/dist/esm/models/AddLayerCollection.d.ts index b3656b4a..475a5dd4 100644 --- a/typescript/dist/esm/models/AddLayerCollection.d.ts +++ b/typescript/dist/esm/models/AddLayerCollection.d.ts @@ -37,7 +37,8 @@ export interface AddLayerCollection { /** * Check if a given object implements the AddLayerCollection interface. */ -export declare function instanceOfAddLayerCollection(value: object): boolean; +export declare function instanceOfAddLayerCollection(value: object): value is AddLayerCollection; export declare function AddLayerCollectionFromJSON(json: any): AddLayerCollection; export declare function AddLayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddLayerCollection; -export declare function AddLayerCollectionToJSON(value?: AddLayerCollection | null): any; +export declare function AddLayerCollectionToJSON(json: any): AddLayerCollection; +export declare function AddLayerCollectionToJSONTyped(value?: AddLayerCollection | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/AddLayerCollection.js b/typescript/dist/esm/models/AddLayerCollection.js index cac34ee2..bdee694d 100644 --- a/typescript/dist/esm/models/AddLayerCollection.js +++ b/typescript/dist/esm/models/AddLayerCollection.js @@ -11,39 +11,39 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * Check if a given object implements the AddLayerCollection interface. */ export function instanceOfAddLayerCollection(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } export function AddLayerCollectionFromJSON(json) { return AddLayerCollectionFromJSONTyped(json, false); } export function AddLayerCollectionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], }; } -export function AddLayerCollectionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AddLayerCollectionToJSON(json) { + return AddLayerCollectionToJSONTyped(json, false); +} +export function AddLayerCollectionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'name': value.name, - 'properties': value.properties, + 'description': value['description'], + 'name': value['name'], + 'properties': value['properties'], }; } diff --git a/typescript/dist/esm/models/AddRole.d.ts b/typescript/dist/esm/models/AddRole.d.ts index 6a61c006..ba12ddac 100644 --- a/typescript/dist/esm/models/AddRole.d.ts +++ b/typescript/dist/esm/models/AddRole.d.ts @@ -25,7 +25,8 @@ export interface AddRole { /** * Check if a given object implements the AddRole interface. */ -export declare function instanceOfAddRole(value: object): boolean; +export declare function instanceOfAddRole(value: object): value is AddRole; export declare function AddRoleFromJSON(json: any): AddRole; export declare function AddRoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddRole; -export declare function AddRoleToJSON(value?: AddRole | null): any; +export declare function AddRoleToJSON(json: any): AddRole; +export declare function AddRoleToJSONTyped(value?: AddRole | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/AddRole.js b/typescript/dist/esm/models/AddRole.js index 4c51a32a..7656bd9d 100644 --- a/typescript/dist/esm/models/AddRole.js +++ b/typescript/dist/esm/models/AddRole.js @@ -15,29 +15,29 @@ * Check if a given object implements the AddRole interface. */ export function instanceOfAddRole(value) { - let isInstance = true; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } export function AddRoleFromJSON(json) { return AddRoleFromJSONTyped(json, false); } export function AddRoleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'name': json['name'], }; } -export function AddRoleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AddRoleToJSON(json) { + return AddRoleToJSONTyped(json, false); +} +export function AddRoleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'name': value.name, + 'name': value['name'], }; } diff --git a/typescript/dist/esm/models/AuthCodeRequestURL.d.ts b/typescript/dist/esm/models/AuthCodeRequestURL.d.ts index 646b5413..448be092 100644 --- a/typescript/dist/esm/models/AuthCodeRequestURL.d.ts +++ b/typescript/dist/esm/models/AuthCodeRequestURL.d.ts @@ -25,7 +25,8 @@ export interface AuthCodeRequestURL { /** * Check if a given object implements the AuthCodeRequestURL interface. */ -export declare function instanceOfAuthCodeRequestURL(value: object): boolean; +export declare function instanceOfAuthCodeRequestURL(value: object): value is AuthCodeRequestURL; export declare function AuthCodeRequestURLFromJSON(json: any): AuthCodeRequestURL; export declare function AuthCodeRequestURLFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthCodeRequestURL; -export declare function AuthCodeRequestURLToJSON(value?: AuthCodeRequestURL | null): any; +export declare function AuthCodeRequestURLToJSON(json: any): AuthCodeRequestURL; +export declare function AuthCodeRequestURLToJSONTyped(value?: AuthCodeRequestURL | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/AuthCodeRequestURL.js b/typescript/dist/esm/models/AuthCodeRequestURL.js index b81de2eb..b4ad20f6 100644 --- a/typescript/dist/esm/models/AuthCodeRequestURL.js +++ b/typescript/dist/esm/models/AuthCodeRequestURL.js @@ -15,29 +15,29 @@ * Check if a given object implements the AuthCodeRequestURL interface. */ export function instanceOfAuthCodeRequestURL(value) { - let isInstance = true; - isInstance = isInstance && "url" in value; - return isInstance; + if (!('url' in value) || value['url'] === undefined) + return false; + return true; } export function AuthCodeRequestURLFromJSON(json) { return AuthCodeRequestURLFromJSONTyped(json, false); } export function AuthCodeRequestURLFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'url': json['url'], }; } -export function AuthCodeRequestURLToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AuthCodeRequestURLToJSON(json) { + return AuthCodeRequestURLToJSONTyped(json, false); +} +export function AuthCodeRequestURLToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'url': value.url, + 'url': value['url'], }; } diff --git a/typescript/dist/esm/models/AuthCodeResponse.d.ts b/typescript/dist/esm/models/AuthCodeResponse.d.ts index bbcabaa8..6a31af14 100644 --- a/typescript/dist/esm/models/AuthCodeResponse.d.ts +++ b/typescript/dist/esm/models/AuthCodeResponse.d.ts @@ -37,7 +37,8 @@ export interface AuthCodeResponse { /** * Check if a given object implements the AuthCodeResponse interface. */ -export declare function instanceOfAuthCodeResponse(value: object): boolean; +export declare function instanceOfAuthCodeResponse(value: object): value is AuthCodeResponse; export declare function AuthCodeResponseFromJSON(json: any): AuthCodeResponse; export declare function AuthCodeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthCodeResponse; -export declare function AuthCodeResponseToJSON(value?: AuthCodeResponse | null): any; +export declare function AuthCodeResponseToJSON(json: any): AuthCodeResponse; +export declare function AuthCodeResponseToJSONTyped(value?: AuthCodeResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/AuthCodeResponse.js b/typescript/dist/esm/models/AuthCodeResponse.js index 1f935fb1..1e4a6879 100644 --- a/typescript/dist/esm/models/AuthCodeResponse.js +++ b/typescript/dist/esm/models/AuthCodeResponse.js @@ -15,17 +15,19 @@ * Check if a given object implements the AuthCodeResponse interface. */ export function instanceOfAuthCodeResponse(value) { - let isInstance = true; - isInstance = isInstance && "code" in value; - isInstance = isInstance && "sessionState" in value; - isInstance = isInstance && "state" in value; - return isInstance; + if (!('code' in value) || value['code'] === undefined) + return false; + if (!('sessionState' in value) || value['sessionState'] === undefined) + return false; + if (!('state' in value) || value['state'] === undefined) + return false; + return true; } export function AuthCodeResponseFromJSON(json) { return AuthCodeResponseFromJSONTyped(json, false); } export function AuthCodeResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -34,16 +36,16 @@ export function AuthCodeResponseFromJSONTyped(json, ignoreDiscriminator) { 'state': json['state'], }; } -export function AuthCodeResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AuthCodeResponseToJSON(json) { + return AuthCodeResponseToJSONTyped(json, false); +} +export function AuthCodeResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'code': value.code, - 'sessionState': value.sessionState, - 'state': value.state, + 'code': value['code'], + 'sessionState': value['sessionState'], + 'state': value['state'], }; } diff --git a/typescript/dist/esm/models/AutoCreateDataset.d.ts b/typescript/dist/esm/models/AutoCreateDataset.d.ts index e6077852..1f524aff 100644 --- a/typescript/dist/esm/models/AutoCreateDataset.d.ts +++ b/typescript/dist/esm/models/AutoCreateDataset.d.ts @@ -55,7 +55,8 @@ export interface AutoCreateDataset { /** * Check if a given object implements the AutoCreateDataset interface. */ -export declare function instanceOfAutoCreateDataset(value: object): boolean; +export declare function instanceOfAutoCreateDataset(value: object): value is AutoCreateDataset; export declare function AutoCreateDatasetFromJSON(json: any): AutoCreateDataset; export declare function AutoCreateDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoCreateDataset; -export declare function AutoCreateDatasetToJSON(value?: AutoCreateDataset | null): any; +export declare function AutoCreateDatasetToJSON(json: any): AutoCreateDataset; +export declare function AutoCreateDatasetToJSONTyped(value?: AutoCreateDataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/AutoCreateDataset.js b/typescript/dist/esm/models/AutoCreateDataset.js index 993ad8bd..d089ecbc 100644 --- a/typescript/dist/esm/models/AutoCreateDataset.js +++ b/typescript/dist/esm/models/AutoCreateDataset.js @@ -11,47 +11,49 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * Check if a given object implements the AutoCreateDataset interface. */ export function instanceOfAutoCreateDataset(value) { - let isInstance = true; - isInstance = isInstance && "datasetDescription" in value; - isInstance = isInstance && "datasetName" in value; - isInstance = isInstance && "mainFile" in value; - isInstance = isInstance && "upload" in value; - return isInstance; + if (!('datasetDescription' in value) || value['datasetDescription'] === undefined) + return false; + if (!('datasetName' in value) || value['datasetName'] === undefined) + return false; + if (!('mainFile' in value) || value['mainFile'] === undefined) + return false; + if (!('upload' in value) || value['upload'] === undefined) + return false; + return true; } export function AutoCreateDatasetFromJSON(json) { return AutoCreateDatasetFromJSONTyped(json, false); } export function AutoCreateDatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'datasetDescription': json['datasetDescription'], 'datasetName': json['datasetName'], - 'layerName': !exists(json, 'layerName') ? undefined : json['layerName'], + 'layerName': json['layerName'] == null ? undefined : json['layerName'], 'mainFile': json['mainFile'], - 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'tags': json['tags'] == null ? undefined : json['tags'], 'upload': json['upload'], }; } -export function AutoCreateDatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AutoCreateDatasetToJSON(json) { + return AutoCreateDatasetToJSONTyped(json, false); +} +export function AutoCreateDatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'datasetDescription': value.datasetDescription, - 'datasetName': value.datasetName, - 'layerName': value.layerName, - 'mainFile': value.mainFile, - 'tags': value.tags, - 'upload': value.upload, + 'datasetDescription': value['datasetDescription'], + 'datasetName': value['datasetName'], + 'layerName': value['layerName'], + 'mainFile': value['mainFile'], + 'tags': value['tags'], + 'upload': value['upload'], }; } diff --git a/typescript/dist/esm/models/AxisOrder.d.ts b/typescript/dist/esm/models/AxisOrder.d.ts index 9bf43dd4..82772b8e 100644 --- a/typescript/dist/esm/models/AxisOrder.d.ts +++ b/typescript/dist/esm/models/AxisOrder.d.ts @@ -18,6 +18,8 @@ export declare const AxisOrder: { readonly EastNorth: "eastNorth"; }; export type AxisOrder = typeof AxisOrder[keyof typeof AxisOrder]; +export declare function instanceOfAxisOrder(value: any): boolean; export declare function AxisOrderFromJSON(json: any): AxisOrder; export declare function AxisOrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): AxisOrder; export declare function AxisOrderToJSON(value?: AxisOrder | null): any; +export declare function AxisOrderToJSONTyped(value: any, ignoreDiscriminator: boolean): AxisOrder; diff --git a/typescript/dist/esm/models/AxisOrder.js b/typescript/dist/esm/models/AxisOrder.js index 77eb464c..369dfcf5 100644 --- a/typescript/dist/esm/models/AxisOrder.js +++ b/typescript/dist/esm/models/AxisOrder.js @@ -19,6 +19,16 @@ export const AxisOrder = { NorthEast: 'northEast', EastNorth: 'eastNorth' }; +export function instanceOfAxisOrder(value) { + for (const key in AxisOrder) { + if (Object.prototype.hasOwnProperty.call(AxisOrder, key)) { + if (AxisOrder[key] === value) { + return true; + } + } + } + return false; +} export function AxisOrderFromJSON(json) { return AxisOrderFromJSONTyped(json, false); } @@ -28,3 +38,6 @@ export function AxisOrderFromJSONTyped(json, ignoreDiscriminator) { export function AxisOrderToJSON(value) { return value; } +export function AxisOrderToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/BoundingBox2D.d.ts b/typescript/dist/esm/models/BoundingBox2D.d.ts index eb528813..08f18375 100644 --- a/typescript/dist/esm/models/BoundingBox2D.d.ts +++ b/typescript/dist/esm/models/BoundingBox2D.d.ts @@ -33,7 +33,8 @@ export interface BoundingBox2D { /** * Check if a given object implements the BoundingBox2D interface. */ -export declare function instanceOfBoundingBox2D(value: object): boolean; +export declare function instanceOfBoundingBox2D(value: object): value is BoundingBox2D; export declare function BoundingBox2DFromJSON(json: any): BoundingBox2D; export declare function BoundingBox2DFromJSONTyped(json: any, ignoreDiscriminator: boolean): BoundingBox2D; -export declare function BoundingBox2DToJSON(value?: BoundingBox2D | null): any; +export declare function BoundingBox2DToJSON(json: any): BoundingBox2D; +export declare function BoundingBox2DToJSONTyped(value?: BoundingBox2D | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/BoundingBox2D.js b/typescript/dist/esm/models/BoundingBox2D.js index ee525088..05582b27 100644 --- a/typescript/dist/esm/models/BoundingBox2D.js +++ b/typescript/dist/esm/models/BoundingBox2D.js @@ -16,16 +16,17 @@ import { Coordinate2DFromJSON, Coordinate2DToJSON, } from './Coordinate2D'; * Check if a given object implements the BoundingBox2D interface. */ export function instanceOfBoundingBox2D(value) { - let isInstance = true; - isInstance = isInstance && "lowerLeftCoordinate" in value; - isInstance = isInstance && "upperRightCoordinate" in value; - return isInstance; + if (!('lowerLeftCoordinate' in value) || value['lowerLeftCoordinate'] === undefined) + return false; + if (!('upperRightCoordinate' in value) || value['upperRightCoordinate'] === undefined) + return false; + return true; } export function BoundingBox2DFromJSON(json) { return BoundingBox2DFromJSONTyped(json, false); } export function BoundingBox2DFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -33,15 +34,15 @@ export function BoundingBox2DFromJSONTyped(json, ignoreDiscriminator) { 'upperRightCoordinate': Coordinate2DFromJSON(json['upperRightCoordinate']), }; } -export function BoundingBox2DToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function BoundingBox2DToJSON(json) { + return BoundingBox2DToJSONTyped(json, false); +} +export function BoundingBox2DToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'lowerLeftCoordinate': Coordinate2DToJSON(value.lowerLeftCoordinate), - 'upperRightCoordinate': Coordinate2DToJSON(value.upperRightCoordinate), + 'lowerLeftCoordinate': Coordinate2DToJSON(value['lowerLeftCoordinate']), + 'upperRightCoordinate': Coordinate2DToJSON(value['upperRightCoordinate']), }; } diff --git a/typescript/dist/esm/models/Breakpoint.d.ts b/typescript/dist/esm/models/Breakpoint.d.ts index dbae252d..05d84313 100644 --- a/typescript/dist/esm/models/Breakpoint.d.ts +++ b/typescript/dist/esm/models/Breakpoint.d.ts @@ -31,7 +31,8 @@ export interface Breakpoint { /** * Check if a given object implements the Breakpoint interface. */ -export declare function instanceOfBreakpoint(value: object): boolean; +export declare function instanceOfBreakpoint(value: object): value is Breakpoint; export declare function BreakpointFromJSON(json: any): Breakpoint; export declare function BreakpointFromJSONTyped(json: any, ignoreDiscriminator: boolean): Breakpoint; -export declare function BreakpointToJSON(value?: Breakpoint | null): any; +export declare function BreakpointToJSON(json: any): Breakpoint; +export declare function BreakpointToJSONTyped(value?: Breakpoint | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Breakpoint.js b/typescript/dist/esm/models/Breakpoint.js index 7ff2caaf..5660654f 100644 --- a/typescript/dist/esm/models/Breakpoint.js +++ b/typescript/dist/esm/models/Breakpoint.js @@ -15,16 +15,17 @@ * Check if a given object implements the Breakpoint interface. */ export function instanceOfBreakpoint(value) { - let isInstance = true; - isInstance = isInstance && "color" in value; - isInstance = isInstance && "value" in value; - return isInstance; + if (!('color' in value) || value['color'] === undefined) + return false; + if (!('value' in value) || value['value'] === undefined) + return false; + return true; } export function BreakpointFromJSON(json) { return BreakpointFromJSONTyped(json, false); } export function BreakpointFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function BreakpointFromJSONTyped(json, ignoreDiscriminator) { 'value': json['value'], }; } -export function BreakpointToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function BreakpointToJSON(json) { + return BreakpointToJSONTyped(json, false); +} +export function BreakpointToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'color': value.color, - 'value': value.value, + 'color': value['color'], + 'value': value['value'], }; } diff --git a/typescript/dist/esm/models/ClassificationMeasurement.d.ts b/typescript/dist/esm/models/ClassificationMeasurement.d.ts index e209302f..a5798843 100644 --- a/typescript/dist/esm/models/ClassificationMeasurement.d.ts +++ b/typescript/dist/esm/models/ClassificationMeasurement.d.ts @@ -46,7 +46,8 @@ export type ClassificationMeasurementTypeEnum = typeof ClassificationMeasurement /** * Check if a given object implements the ClassificationMeasurement interface. */ -export declare function instanceOfClassificationMeasurement(value: object): boolean; +export declare function instanceOfClassificationMeasurement(value: object): value is ClassificationMeasurement; export declare function ClassificationMeasurementFromJSON(json: any): ClassificationMeasurement; export declare function ClassificationMeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClassificationMeasurement; -export declare function ClassificationMeasurementToJSON(value?: ClassificationMeasurement | null): any; +export declare function ClassificationMeasurementToJSON(json: any): ClassificationMeasurement; +export declare function ClassificationMeasurementToJSONTyped(value?: ClassificationMeasurement | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ClassificationMeasurement.js b/typescript/dist/esm/models/ClassificationMeasurement.js index 3c4ebe40..05499080 100644 --- a/typescript/dist/esm/models/ClassificationMeasurement.js +++ b/typescript/dist/esm/models/ClassificationMeasurement.js @@ -21,17 +21,19 @@ export const ClassificationMeasurementTypeEnum = { * Check if a given object implements the ClassificationMeasurement interface. */ export function instanceOfClassificationMeasurement(value) { - let isInstance = true; - isInstance = isInstance && "classes" in value; - isInstance = isInstance && "measurement" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('classes' in value) || value['classes'] === undefined) + return false; + if (!('measurement' in value) || value['measurement'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function ClassificationMeasurementFromJSON(json) { return ClassificationMeasurementFromJSONTyped(json, false); } export function ClassificationMeasurementFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -40,16 +42,16 @@ export function ClassificationMeasurementFromJSONTyped(json, ignoreDiscriminator 'type': json['type'], }; } -export function ClassificationMeasurementToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ClassificationMeasurementToJSON(json) { + return ClassificationMeasurementToJSONTyped(json, false); +} +export function ClassificationMeasurementToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'classes': value.classes, - 'measurement': value.measurement, - 'type': value.type, + 'classes': value['classes'], + 'measurement': value['measurement'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/CollectionItem.d.ts b/typescript/dist/esm/models/CollectionItem.d.ts index 7cd6117a..045dec7a 100644 --- a/typescript/dist/esm/models/CollectionItem.d.ts +++ b/typescript/dist/esm/models/CollectionItem.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { LayerCollectionListing } from './LayerCollectionListing'; -import { LayerListing } from './LayerListing'; +import type { LayerCollectionListing } from './LayerCollectionListing'; +import type { LayerListing } from './LayerListing'; /** * @type CollectionItem * @@ -23,4 +23,5 @@ export type CollectionItem = { } & LayerListing; export declare function CollectionItemFromJSON(json: any): CollectionItem; export declare function CollectionItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionItem; -export declare function CollectionItemToJSON(value?: CollectionItem | null): any; +export declare function CollectionItemToJSON(json: any): any; +export declare function CollectionItemToJSONTyped(value?: CollectionItem | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/CollectionItem.js b/typescript/dist/esm/models/CollectionItem.js index 7ad8e28f..12e10e8e 100644 --- a/typescript/dist/esm/models/CollectionItem.js +++ b/typescript/dist/esm/models/CollectionItem.js @@ -17,30 +17,30 @@ export function CollectionItemFromJSON(json) { return CollectionItemFromJSONTyped(json, false); } export function CollectionItemFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'collection': - return Object.assign(Object.assign({}, LayerCollectionListingFromJSONTyped(json, true)), { type: 'collection' }); + return Object.assign({}, LayerCollectionListingFromJSONTyped(json, true), { type: 'collection' }); case 'layer': - return Object.assign(Object.assign({}, LayerListingFromJSONTyped(json, true)), { type: 'layer' }); + return Object.assign({}, LayerListingFromJSONTyped(json, true), { type: 'layer' }); default: throw new Error(`No variant of CollectionItem exists with 'type=${json['type']}'`); } } -export function CollectionItemToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function CollectionItemToJSON(json) { + return CollectionItemToJSONTyped(json, false); +} +export function CollectionItemToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'collection': - return LayerCollectionListingToJSON(value); + return Object.assign({}, LayerCollectionListingToJSON(value), { type: 'collection' }); case 'layer': - return LayerListingToJSON(value); + return Object.assign({}, LayerListingToJSON(value), { type: 'layer' }); default: throw new Error(`No variant of CollectionItem exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/CollectionType.d.ts b/typescript/dist/esm/models/CollectionType.d.ts index d3cceb54..42b4ae96 100644 --- a/typescript/dist/esm/models/CollectionType.d.ts +++ b/typescript/dist/esm/models/CollectionType.d.ts @@ -17,6 +17,8 @@ export declare const CollectionType: { readonly FeatureCollection: "FeatureCollection"; }; export type CollectionType = typeof CollectionType[keyof typeof CollectionType]; +export declare function instanceOfCollectionType(value: any): boolean; export declare function CollectionTypeFromJSON(json: any): CollectionType; export declare function CollectionTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionType; export declare function CollectionTypeToJSON(value?: CollectionType | null): any; +export declare function CollectionTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): CollectionType; diff --git a/typescript/dist/esm/models/CollectionType.js b/typescript/dist/esm/models/CollectionType.js index e02ecaaa..77dbfa7c 100644 --- a/typescript/dist/esm/models/CollectionType.js +++ b/typescript/dist/esm/models/CollectionType.js @@ -18,6 +18,16 @@ export const CollectionType = { FeatureCollection: 'FeatureCollection' }; +export function instanceOfCollectionType(value) { + for (const key in CollectionType) { + if (Object.prototype.hasOwnProperty.call(CollectionType, key)) { + if (CollectionType[key] === value) { + return true; + } + } + } + return false; +} export function CollectionTypeFromJSON(json) { return CollectionTypeFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function CollectionTypeFromJSONTyped(json, ignoreDiscriminator) { export function CollectionTypeToJSON(value) { return value; } +export function CollectionTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/ColorParam.d.ts b/typescript/dist/esm/models/ColorParam.d.ts index 137c8b33..27e62d45 100644 --- a/typescript/dist/esm/models/ColorParam.d.ts +++ b/typescript/dist/esm/models/ColorParam.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ColorParamStatic } from './ColorParamStatic'; -import { DerivedColor } from './DerivedColor'; +import type { ColorParamStatic } from './ColorParamStatic'; +import type { DerivedColor } from './DerivedColor'; /** * @type ColorParam * @@ -23,4 +23,5 @@ export type ColorParam = { } & ColorParamStatic; export declare function ColorParamFromJSON(json: any): ColorParam; export declare function ColorParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): ColorParam; -export declare function ColorParamToJSON(value?: ColorParam | null): any; +export declare function ColorParamToJSON(json: any): any; +export declare function ColorParamToJSONTyped(value?: ColorParam | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ColorParam.js b/typescript/dist/esm/models/ColorParam.js index e0941c50..242f2721 100644 --- a/typescript/dist/esm/models/ColorParam.js +++ b/typescript/dist/esm/models/ColorParam.js @@ -17,30 +17,30 @@ export function ColorParamFromJSON(json) { return ColorParamFromJSONTyped(json, false); } export function ColorParamFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'derived': - return Object.assign(Object.assign({}, DerivedColorFromJSONTyped(json, true)), { type: 'derived' }); + return Object.assign({}, DerivedColorFromJSONTyped(json, true), { type: 'derived' }); case 'static': - return Object.assign(Object.assign({}, ColorParamStaticFromJSONTyped(json, true)), { type: 'static' }); + return Object.assign({}, ColorParamStaticFromJSONTyped(json, true), { type: 'static' }); default: throw new Error(`No variant of ColorParam exists with 'type=${json['type']}'`); } } -export function ColorParamToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ColorParamToJSON(json) { + return ColorParamToJSONTyped(json, false); +} +export function ColorParamToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'derived': - return DerivedColorToJSON(value); + return Object.assign({}, DerivedColorToJSON(value), { type: 'derived' }); case 'static': - return ColorParamStaticToJSON(value); + return Object.assign({}, ColorParamStaticToJSON(value), { type: 'static' }); default: throw new Error(`No variant of ColorParam exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/ColorParamStatic.d.ts b/typescript/dist/esm/models/ColorParamStatic.d.ts index 3290501e..5b67fd37 100644 --- a/typescript/dist/esm/models/ColorParamStatic.d.ts +++ b/typescript/dist/esm/models/ColorParamStatic.d.ts @@ -33,13 +33,13 @@ export interface ColorParamStatic { */ export declare const ColorParamStaticTypeEnum: { readonly Static: "static"; - readonly Derived: "derived"; }; export type ColorParamStaticTypeEnum = typeof ColorParamStaticTypeEnum[keyof typeof ColorParamStaticTypeEnum]; /** * Check if a given object implements the ColorParamStatic interface. */ -export declare function instanceOfColorParamStatic(value: object): boolean; +export declare function instanceOfColorParamStatic(value: object): value is ColorParamStatic; export declare function ColorParamStaticFromJSON(json: any): ColorParamStatic; export declare function ColorParamStaticFromJSONTyped(json: any, ignoreDiscriminator: boolean): ColorParamStatic; -export declare function ColorParamStaticToJSON(value?: ColorParamStatic | null): any; +export declare function ColorParamStaticToJSON(json: any): ColorParamStatic; +export declare function ColorParamStaticToJSONTyped(value?: ColorParamStatic | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ColorParamStatic.js b/typescript/dist/esm/models/ColorParamStatic.js index b42b143e..49ba126f 100644 --- a/typescript/dist/esm/models/ColorParamStatic.js +++ b/typescript/dist/esm/models/ColorParamStatic.js @@ -15,23 +15,23 @@ * @export */ export const ColorParamStaticTypeEnum = { - Static: 'static', - Derived: 'derived' + Static: 'static' }; /** * Check if a given object implements the ColorParamStatic interface. */ export function instanceOfColorParamStatic(value) { - let isInstance = true; - isInstance = isInstance && "color" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('color' in value) || value['color'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function ColorParamStaticFromJSON(json) { return ColorParamStaticFromJSONTyped(json, false); } export function ColorParamStaticFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,15 +39,15 @@ export function ColorParamStaticFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function ColorParamStaticToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ColorParamStaticToJSON(json) { + return ColorParamStaticToJSONTyped(json, false); +} +export function ColorParamStaticToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'color': value.color, - 'type': value.type, + 'color': value['color'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/Colorizer.d.ts b/typescript/dist/esm/models/Colorizer.d.ts index 83e37092..7d75528c 100644 --- a/typescript/dist/esm/models/Colorizer.d.ts +++ b/typescript/dist/esm/models/Colorizer.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { LinearGradient } from './LinearGradient'; -import { LogarithmicGradient } from './LogarithmicGradient'; -import { PaletteColorizer } from './PaletteColorizer'; +import type { LinearGradient } from './LinearGradient'; +import type { LogarithmicGradient } from './LogarithmicGradient'; +import type { PaletteColorizer } from './PaletteColorizer'; /** * @type Colorizer * @@ -26,4 +26,5 @@ export type Colorizer = { } & PaletteColorizer; export declare function ColorizerFromJSON(json: any): Colorizer; export declare function ColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): Colorizer; -export declare function ColorizerToJSON(value?: Colorizer | null): any; +export declare function ColorizerToJSON(json: any): any; +export declare function ColorizerToJSONTyped(value?: Colorizer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Colorizer.js b/typescript/dist/esm/models/Colorizer.js index a5e4a1b5..293fb745 100644 --- a/typescript/dist/esm/models/Colorizer.js +++ b/typescript/dist/esm/models/Colorizer.js @@ -18,34 +18,34 @@ export function ColorizerFromJSON(json) { return ColorizerFromJSONTyped(json, false); } export function ColorizerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'linearGradient': - return Object.assign(Object.assign({}, LinearGradientFromJSONTyped(json, true)), { type: 'linearGradient' }); + return Object.assign({}, LinearGradientFromJSONTyped(json, true), { type: 'linearGradient' }); case 'logarithmicGradient': - return Object.assign(Object.assign({}, LogarithmicGradientFromJSONTyped(json, true)), { type: 'logarithmicGradient' }); + return Object.assign({}, LogarithmicGradientFromJSONTyped(json, true), { type: 'logarithmicGradient' }); case 'palette': - return Object.assign(Object.assign({}, PaletteColorizerFromJSONTyped(json, true)), { type: 'palette' }); + return Object.assign({}, PaletteColorizerFromJSONTyped(json, true), { type: 'palette' }); default: throw new Error(`No variant of Colorizer exists with 'type=${json['type']}'`); } } -export function ColorizerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ColorizerToJSON(json) { + return ColorizerToJSONTyped(json, false); +} +export function ColorizerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'linearGradient': - return LinearGradientToJSON(value); + return Object.assign({}, LinearGradientToJSON(value), { type: 'linearGradient' }); case 'logarithmicGradient': - return LogarithmicGradientToJSON(value); + return Object.assign({}, LogarithmicGradientToJSON(value), { type: 'logarithmicGradient' }); case 'palette': - return PaletteColorizerToJSON(value); + return Object.assign({}, PaletteColorizerToJSON(value), { type: 'palette' }); default: throw new Error(`No variant of Colorizer exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/ComputationQuota.d.ts b/typescript/dist/esm/models/ComputationQuota.d.ts index 7d671174..714a306a 100644 --- a/typescript/dist/esm/models/ComputationQuota.d.ts +++ b/typescript/dist/esm/models/ComputationQuota.d.ts @@ -43,7 +43,8 @@ export interface ComputationQuota { /** * Check if a given object implements the ComputationQuota interface. */ -export declare function instanceOfComputationQuota(value: object): boolean; +export declare function instanceOfComputationQuota(value: object): value is ComputationQuota; export declare function ComputationQuotaFromJSON(json: any): ComputationQuota; export declare function ComputationQuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): ComputationQuota; -export declare function ComputationQuotaToJSON(value?: ComputationQuota | null): any; +export declare function ComputationQuotaToJSON(json: any): ComputationQuota; +export declare function ComputationQuotaToJSONTyped(value?: ComputationQuota | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ComputationQuota.js b/typescript/dist/esm/models/ComputationQuota.js index b95ee77c..4829e2bd 100644 --- a/typescript/dist/esm/models/ComputationQuota.js +++ b/typescript/dist/esm/models/ComputationQuota.js @@ -15,18 +15,21 @@ * Check if a given object implements the ComputationQuota interface. */ export function instanceOfComputationQuota(value) { - let isInstance = true; - isInstance = isInstance && "computationId" in value; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "timestamp" in value; - isInstance = isInstance && "workflowId" in value; - return isInstance; + if (!('computationId' in value) || value['computationId'] === undefined) + return false; + if (!('count' in value) || value['count'] === undefined) + return false; + if (!('timestamp' in value) || value['timestamp'] === undefined) + return false; + if (!('workflowId' in value) || value['workflowId'] === undefined) + return false; + return true; } export function ComputationQuotaFromJSON(json) { return ComputationQuotaFromJSONTyped(json, false); } export function ComputationQuotaFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -36,17 +39,17 @@ export function ComputationQuotaFromJSONTyped(json, ignoreDiscriminator) { 'workflowId': json['workflowId'], }; } -export function ComputationQuotaToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ComputationQuotaToJSON(json) { + return ComputationQuotaToJSONTyped(json, false); +} +export function ComputationQuotaToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'computationId': value.computationId, - 'count': value.count, - 'timestamp': (value.timestamp.toISOString()), - 'workflowId': value.workflowId, + 'computationId': value['computationId'], + 'count': value['count'], + 'timestamp': ((value['timestamp']).toISOString()), + 'workflowId': value['workflowId'], }; } diff --git a/typescript/dist/esm/models/ContinuousMeasurement.d.ts b/typescript/dist/esm/models/ContinuousMeasurement.d.ts index ab24d241..41c613d1 100644 --- a/typescript/dist/esm/models/ContinuousMeasurement.d.ts +++ b/typescript/dist/esm/models/ContinuousMeasurement.d.ts @@ -44,7 +44,8 @@ export type ContinuousMeasurementTypeEnum = typeof ContinuousMeasurementTypeEnum /** * Check if a given object implements the ContinuousMeasurement interface. */ -export declare function instanceOfContinuousMeasurement(value: object): boolean; +export declare function instanceOfContinuousMeasurement(value: object): value is ContinuousMeasurement; export declare function ContinuousMeasurementFromJSON(json: any): ContinuousMeasurement; export declare function ContinuousMeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContinuousMeasurement; -export declare function ContinuousMeasurementToJSON(value?: ContinuousMeasurement | null): any; +export declare function ContinuousMeasurementToJSON(json: any): ContinuousMeasurement; +export declare function ContinuousMeasurementToJSONTyped(value?: ContinuousMeasurement | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ContinuousMeasurement.js b/typescript/dist/esm/models/ContinuousMeasurement.js index 3e777f48..fa6d404b 100644 --- a/typescript/dist/esm/models/ContinuousMeasurement.js +++ b/typescript/dist/esm/models/ContinuousMeasurement.js @@ -11,7 +11,6 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * @export */ @@ -22,34 +21,35 @@ export const ContinuousMeasurementTypeEnum = { * Check if a given object implements the ContinuousMeasurement interface. */ export function instanceOfContinuousMeasurement(value) { - let isInstance = true; - isInstance = isInstance && "measurement" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('measurement' in value) || value['measurement'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function ContinuousMeasurementFromJSON(json) { return ContinuousMeasurementFromJSONTyped(json, false); } export function ContinuousMeasurementFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'measurement': json['measurement'], 'type': json['type'], - 'unit': !exists(json, 'unit') ? undefined : json['unit'], + 'unit': json['unit'] == null ? undefined : json['unit'], }; } -export function ContinuousMeasurementToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ContinuousMeasurementToJSON(json) { + return ContinuousMeasurementToJSONTyped(json, false); +} +export function ContinuousMeasurementToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'measurement': value.measurement, - 'type': value.type, - 'unit': value.unit, + 'measurement': value['measurement'], + 'type': value['type'], + 'unit': value['unit'], }; } diff --git a/typescript/dist/esm/models/Coordinate2D.d.ts b/typescript/dist/esm/models/Coordinate2D.d.ts index 4f3192fa..5e97411d 100644 --- a/typescript/dist/esm/models/Coordinate2D.d.ts +++ b/typescript/dist/esm/models/Coordinate2D.d.ts @@ -31,7 +31,8 @@ export interface Coordinate2D { /** * Check if a given object implements the Coordinate2D interface. */ -export declare function instanceOfCoordinate2D(value: object): boolean; +export declare function instanceOfCoordinate2D(value: object): value is Coordinate2D; export declare function Coordinate2DFromJSON(json: any): Coordinate2D; export declare function Coordinate2DFromJSONTyped(json: any, ignoreDiscriminator: boolean): Coordinate2D; -export declare function Coordinate2DToJSON(value?: Coordinate2D | null): any; +export declare function Coordinate2DToJSON(json: any): Coordinate2D; +export declare function Coordinate2DToJSONTyped(value?: Coordinate2D | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Coordinate2D.js b/typescript/dist/esm/models/Coordinate2D.js index 161ecf83..97dd960e 100644 --- a/typescript/dist/esm/models/Coordinate2D.js +++ b/typescript/dist/esm/models/Coordinate2D.js @@ -15,16 +15,17 @@ * Check if a given object implements the Coordinate2D interface. */ export function instanceOfCoordinate2D(value) { - let isInstance = true; - isInstance = isInstance && "x" in value; - isInstance = isInstance && "y" in value; - return isInstance; + if (!('x' in value) || value['x'] === undefined) + return false; + if (!('y' in value) || value['y'] === undefined) + return false; + return true; } export function Coordinate2DFromJSON(json) { return Coordinate2DFromJSONTyped(json, false); } export function Coordinate2DFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function Coordinate2DFromJSONTyped(json, ignoreDiscriminator) { 'y': json['y'], }; } -export function Coordinate2DToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function Coordinate2DToJSON(json) { + return Coordinate2DToJSONTyped(json, false); +} +export function Coordinate2DToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'x': value.x, - 'y': value.y, + 'x': value['x'], + 'y': value['y'], }; } diff --git a/typescript/dist/esm/models/CreateDataset.d.ts b/typescript/dist/esm/models/CreateDataset.d.ts index fdacea9b..ba7f4cad 100644 --- a/typescript/dist/esm/models/CreateDataset.d.ts +++ b/typescript/dist/esm/models/CreateDataset.d.ts @@ -33,7 +33,8 @@ export interface CreateDataset { /** * Check if a given object implements the CreateDataset interface. */ -export declare function instanceOfCreateDataset(value: object): boolean; +export declare function instanceOfCreateDataset(value: object): value is CreateDataset; export declare function CreateDatasetFromJSON(json: any): CreateDataset; export declare function CreateDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDataset; -export declare function CreateDatasetToJSON(value?: CreateDataset | null): any; +export declare function CreateDatasetToJSON(json: any): CreateDataset; +export declare function CreateDatasetToJSONTyped(value?: CreateDataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/CreateDataset.js b/typescript/dist/esm/models/CreateDataset.js index 39507102..b5392091 100644 --- a/typescript/dist/esm/models/CreateDataset.js +++ b/typescript/dist/esm/models/CreateDataset.js @@ -17,16 +17,17 @@ import { DatasetDefinitionFromJSON, DatasetDefinitionToJSON, } from './DatasetDe * Check if a given object implements the CreateDataset interface. */ export function instanceOfCreateDataset(value) { - let isInstance = true; - isInstance = isInstance && "dataPath" in value; - isInstance = isInstance && "definition" in value; - return isInstance; + if (!('dataPath' in value) || value['dataPath'] === undefined) + return false; + if (!('definition' in value) || value['definition'] === undefined) + return false; + return true; } export function CreateDatasetFromJSON(json) { return CreateDatasetFromJSONTyped(json, false); } export function CreateDatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -34,15 +35,15 @@ export function CreateDatasetFromJSONTyped(json, ignoreDiscriminator) { 'definition': DatasetDefinitionFromJSON(json['definition']), }; } -export function CreateDatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function CreateDatasetToJSON(json) { + return CreateDatasetToJSONTyped(json, false); +} +export function CreateDatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'dataPath': DataPathToJSON(value.dataPath), - 'definition': DatasetDefinitionToJSON(value.definition), + 'dataPath': DataPathToJSON(value['dataPath']), + 'definition': DatasetDefinitionToJSON(value['definition']), }; } diff --git a/typescript/dist/esm/models/CreateDatasetHandler200Response.d.ts b/typescript/dist/esm/models/CreateDatasetHandler200Response.d.ts index 713bb809..162af55f 100644 --- a/typescript/dist/esm/models/CreateDatasetHandler200Response.d.ts +++ b/typescript/dist/esm/models/CreateDatasetHandler200Response.d.ts @@ -25,7 +25,8 @@ export interface CreateDatasetHandler200Response { /** * Check if a given object implements the CreateDatasetHandler200Response interface. */ -export declare function instanceOfCreateDatasetHandler200Response(value: object): boolean; +export declare function instanceOfCreateDatasetHandler200Response(value: object): value is CreateDatasetHandler200Response; export declare function CreateDatasetHandler200ResponseFromJSON(json: any): CreateDatasetHandler200Response; export declare function CreateDatasetHandler200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDatasetHandler200Response; -export declare function CreateDatasetHandler200ResponseToJSON(value?: CreateDatasetHandler200Response | null): any; +export declare function CreateDatasetHandler200ResponseToJSON(json: any): CreateDatasetHandler200Response; +export declare function CreateDatasetHandler200ResponseToJSONTyped(value?: CreateDatasetHandler200Response | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/CreateDatasetHandler200Response.js b/typescript/dist/esm/models/CreateDatasetHandler200Response.js index 4011aa2e..7c3ee49f 100644 --- a/typescript/dist/esm/models/CreateDatasetHandler200Response.js +++ b/typescript/dist/esm/models/CreateDatasetHandler200Response.js @@ -15,29 +15,29 @@ * Check if a given object implements the CreateDatasetHandler200Response interface. */ export function instanceOfCreateDatasetHandler200Response(value) { - let isInstance = true; - isInstance = isInstance && "datasetName" in value; - return isInstance; + if (!('datasetName' in value) || value['datasetName'] === undefined) + return false; + return true; } export function CreateDatasetHandler200ResponseFromJSON(json) { return CreateDatasetHandler200ResponseFromJSONTyped(json, false); } export function CreateDatasetHandler200ResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'datasetName': json['datasetName'], }; } -export function CreateDatasetHandler200ResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function CreateDatasetHandler200ResponseToJSON(json) { + return CreateDatasetHandler200ResponseToJSONTyped(json, false); +} +export function CreateDatasetHandler200ResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'datasetName': value.datasetName, + 'datasetName': value['datasetName'], }; } diff --git a/typescript/dist/esm/models/CreateProject.d.ts b/typescript/dist/esm/models/CreateProject.d.ts index 597e2766..f1dcd7dc 100644 --- a/typescript/dist/esm/models/CreateProject.d.ts +++ b/typescript/dist/esm/models/CreateProject.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { STRectangle } from './STRectangle'; import type { TimeStep } from './TimeStep'; +import type { STRectangle } from './STRectangle'; /** * * @export @@ -45,7 +45,8 @@ export interface CreateProject { /** * Check if a given object implements the CreateProject interface. */ -export declare function instanceOfCreateProject(value: object): boolean; +export declare function instanceOfCreateProject(value: object): value is CreateProject; export declare function CreateProjectFromJSON(json: any): CreateProject; export declare function CreateProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateProject; -export declare function CreateProjectToJSON(value?: CreateProject | null): any; +export declare function CreateProjectToJSON(json: any): CreateProject; +export declare function CreateProjectToJSONTyped(value?: CreateProject | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/CreateProject.js b/typescript/dist/esm/models/CreateProject.js index e90bd93f..df338449 100644 --- a/typescript/dist/esm/models/CreateProject.js +++ b/typescript/dist/esm/models/CreateProject.js @@ -11,44 +11,45 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { STRectangleFromJSON, STRectangleToJSON, } from './STRectangle'; import { TimeStepFromJSON, TimeStepToJSON, } from './TimeStep'; +import { STRectangleFromJSON, STRectangleToJSON, } from './STRectangle'; /** * Check if a given object implements the CreateProject interface. */ export function instanceOfCreateProject(value) { - let isInstance = true; - isInstance = isInstance && "bounds" in value; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('bounds' in value) || value['bounds'] === undefined) + return false; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } export function CreateProjectFromJSON(json) { return CreateProjectFromJSONTyped(json, false); } export function CreateProjectFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bounds': STRectangleFromJSON(json['bounds']), 'description': json['description'], 'name': json['name'], - 'timeStep': !exists(json, 'timeStep') ? undefined : TimeStepFromJSON(json['timeStep']), + 'timeStep': json['timeStep'] == null ? undefined : TimeStepFromJSON(json['timeStep']), }; } -export function CreateProjectToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function CreateProjectToJSON(json) { + return CreateProjectToJSONTyped(json, false); +} +export function CreateProjectToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bounds': STRectangleToJSON(value.bounds), - 'description': value.description, - 'name': value.name, - 'timeStep': TimeStepToJSON(value.timeStep), + 'bounds': STRectangleToJSON(value['bounds']), + 'description': value['description'], + 'name': value['name'], + 'timeStep': TimeStepToJSON(value['timeStep']), }; } diff --git a/typescript/dist/esm/models/CsvHeader.d.ts b/typescript/dist/esm/models/CsvHeader.d.ts index eeed3dbc..70b4f799 100644 --- a/typescript/dist/esm/models/CsvHeader.d.ts +++ b/typescript/dist/esm/models/CsvHeader.d.ts @@ -19,6 +19,8 @@ export declare const CsvHeader: { readonly Auto: "auto"; }; export type CsvHeader = typeof CsvHeader[keyof typeof CsvHeader]; +export declare function instanceOfCsvHeader(value: any): boolean; export declare function CsvHeaderFromJSON(json: any): CsvHeader; export declare function CsvHeaderFromJSONTyped(json: any, ignoreDiscriminator: boolean): CsvHeader; export declare function CsvHeaderToJSON(value?: CsvHeader | null): any; +export declare function CsvHeaderToJSONTyped(value: any, ignoreDiscriminator: boolean): CsvHeader; diff --git a/typescript/dist/esm/models/CsvHeader.js b/typescript/dist/esm/models/CsvHeader.js index f233e2a1..bcfc37e2 100644 --- a/typescript/dist/esm/models/CsvHeader.js +++ b/typescript/dist/esm/models/CsvHeader.js @@ -20,6 +20,16 @@ export const CsvHeader = { No: 'no', Auto: 'auto' }; +export function instanceOfCsvHeader(value) { + for (const key in CsvHeader) { + if (Object.prototype.hasOwnProperty.call(CsvHeader, key)) { + if (CsvHeader[key] === value) { + return true; + } + } + } + return false; +} export function CsvHeaderFromJSON(json) { return CsvHeaderFromJSONTyped(json, false); } @@ -29,3 +39,6 @@ export function CsvHeaderFromJSONTyped(json, ignoreDiscriminator) { export function CsvHeaderToJSON(value) { return value; } +export function CsvHeaderToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/DataId.d.ts b/typescript/dist/esm/models/DataId.d.ts index ab01e7ea..730c86e1 100644 --- a/typescript/dist/esm/models/DataId.d.ts +++ b/typescript/dist/esm/models/DataId.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ExternalDataId } from './ExternalDataId'; -import { InternalDataId } from './InternalDataId'; +import type { ExternalDataId } from './ExternalDataId'; +import type { InternalDataId } from './InternalDataId'; /** * @type DataId * @@ -23,4 +23,5 @@ export type DataId = { } & InternalDataId; export declare function DataIdFromJSON(json: any): DataId; export declare function DataIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataId; -export declare function DataIdToJSON(value?: DataId | null): any; +export declare function DataIdToJSON(json: any): any; +export declare function DataIdToJSONTyped(value?: DataId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DataId.js b/typescript/dist/esm/models/DataId.js index 4fa9ca62..5e85fc23 100644 --- a/typescript/dist/esm/models/DataId.js +++ b/typescript/dist/esm/models/DataId.js @@ -17,30 +17,30 @@ export function DataIdFromJSON(json) { return DataIdFromJSONTyped(json, false); } export function DataIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'external': - return Object.assign(Object.assign({}, ExternalDataIdFromJSONTyped(json, true)), { type: 'external' }); + return Object.assign({}, ExternalDataIdFromJSONTyped(json, true), { type: 'external' }); case 'internal': - return Object.assign(Object.assign({}, InternalDataIdFromJSONTyped(json, true)), { type: 'internal' }); + return Object.assign({}, InternalDataIdFromJSONTyped(json, true), { type: 'internal' }); default: throw new Error(`No variant of DataId exists with 'type=${json['type']}'`); } } -export function DataIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DataIdToJSON(json) { + return DataIdToJSONTyped(json, false); +} +export function DataIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'external': - return ExternalDataIdToJSON(value); + return Object.assign({}, ExternalDataIdToJSON(value), { type: 'external' }); case 'internal': - return InternalDataIdToJSON(value); + return Object.assign({}, InternalDataIdToJSON(value), { type: 'internal' }); default: throw new Error(`No variant of DataId exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/DataPath.d.ts b/typescript/dist/esm/models/DataPath.d.ts index be15a3a0..b1f02bce 100644 --- a/typescript/dist/esm/models/DataPath.d.ts +++ b/typescript/dist/esm/models/DataPath.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DataPathOneOf } from './DataPathOneOf'; -import { DataPathOneOf1 } from './DataPathOneOf1'; +import type { DataPathOneOf } from './DataPathOneOf'; +import type { DataPathOneOf1 } from './DataPathOneOf1'; /** * @type DataPath * @@ -19,4 +19,5 @@ import { DataPathOneOf1 } from './DataPathOneOf1'; export type DataPath = DataPathOneOf | DataPathOneOf1; export declare function DataPathFromJSON(json: any): DataPath; export declare function DataPathFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataPath; -export declare function DataPathToJSON(value?: DataPath | null): any; +export declare function DataPathToJSON(json: any): any; +export declare function DataPathToJSONTyped(value?: DataPath | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DataPath.js b/typescript/dist/esm/models/DataPath.js index 2c8d7e0f..0f25ff29 100644 --- a/typescript/dist/esm/models/DataPath.js +++ b/typescript/dist/esm/models/DataPath.js @@ -17,17 +17,23 @@ export function DataPathFromJSON(json) { return DataPathFromJSONTyped(json, false); } export function DataPathFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - return Object.assign(Object.assign({}, DataPathOneOfFromJSONTyped(json, true)), DataPathOneOf1FromJSONTyped(json, true)); -} -export function DataPathToJSON(value) { - if (value === undefined) { - return undefined; + if (instanceOfDataPathOneOf(json)) { + return DataPathOneOfFromJSONTyped(json, true); + } + if (instanceOfDataPathOneOf1(json)) { + return DataPathOneOf1FromJSONTyped(json, true); } - if (value === null) { - return null; + return {}; +} +export function DataPathToJSON(json) { + return DataPathToJSONTyped(json, false); +} +export function DataPathToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } if (instanceOfDataPathOneOf(value)) { return DataPathOneOfToJSON(value); diff --git a/typescript/dist/esm/models/DataPathOneOf.d.ts b/typescript/dist/esm/models/DataPathOneOf.d.ts index b0816be4..5182804a 100644 --- a/typescript/dist/esm/models/DataPathOneOf.d.ts +++ b/typescript/dist/esm/models/DataPathOneOf.d.ts @@ -25,7 +25,8 @@ export interface DataPathOneOf { /** * Check if a given object implements the DataPathOneOf interface. */ -export declare function instanceOfDataPathOneOf(value: object): boolean; +export declare function instanceOfDataPathOneOf(value: object): value is DataPathOneOf; export declare function DataPathOneOfFromJSON(json: any): DataPathOneOf; export declare function DataPathOneOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataPathOneOf; -export declare function DataPathOneOfToJSON(value?: DataPathOneOf | null): any; +export declare function DataPathOneOfToJSON(json: any): DataPathOneOf; +export declare function DataPathOneOfToJSONTyped(value?: DataPathOneOf | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DataPathOneOf.js b/typescript/dist/esm/models/DataPathOneOf.js index 7518d325..24f2290e 100644 --- a/typescript/dist/esm/models/DataPathOneOf.js +++ b/typescript/dist/esm/models/DataPathOneOf.js @@ -15,29 +15,29 @@ * Check if a given object implements the DataPathOneOf interface. */ export function instanceOfDataPathOneOf(value) { - let isInstance = true; - isInstance = isInstance && "volume" in value; - return isInstance; + if (!('volume' in value) || value['volume'] === undefined) + return false; + return true; } export function DataPathOneOfFromJSON(json) { return DataPathOneOfFromJSONTyped(json, false); } export function DataPathOneOfFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'volume': json['volume'], }; } -export function DataPathOneOfToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DataPathOneOfToJSON(json) { + return DataPathOneOfToJSONTyped(json, false); +} +export function DataPathOneOfToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'volume': value.volume, + 'volume': value['volume'], }; } diff --git a/typescript/dist/esm/models/DataPathOneOf1.d.ts b/typescript/dist/esm/models/DataPathOneOf1.d.ts index 31d20891..94767d68 100644 --- a/typescript/dist/esm/models/DataPathOneOf1.d.ts +++ b/typescript/dist/esm/models/DataPathOneOf1.d.ts @@ -25,7 +25,8 @@ export interface DataPathOneOf1 { /** * Check if a given object implements the DataPathOneOf1 interface. */ -export declare function instanceOfDataPathOneOf1(value: object): boolean; +export declare function instanceOfDataPathOneOf1(value: object): value is DataPathOneOf1; export declare function DataPathOneOf1FromJSON(json: any): DataPathOneOf1; export declare function DataPathOneOf1FromJSONTyped(json: any, ignoreDiscriminator: boolean): DataPathOneOf1; -export declare function DataPathOneOf1ToJSON(value?: DataPathOneOf1 | null): any; +export declare function DataPathOneOf1ToJSON(json: any): DataPathOneOf1; +export declare function DataPathOneOf1ToJSONTyped(value?: DataPathOneOf1 | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DataPathOneOf1.js b/typescript/dist/esm/models/DataPathOneOf1.js index d7d0435a..7eda2a54 100644 --- a/typescript/dist/esm/models/DataPathOneOf1.js +++ b/typescript/dist/esm/models/DataPathOneOf1.js @@ -15,29 +15,29 @@ * Check if a given object implements the DataPathOneOf1 interface. */ export function instanceOfDataPathOneOf1(value) { - let isInstance = true; - isInstance = isInstance && "upload" in value; - return isInstance; + if (!('upload' in value) || value['upload'] === undefined) + return false; + return true; } export function DataPathOneOf1FromJSON(json) { return DataPathOneOf1FromJSONTyped(json, false); } export function DataPathOneOf1FromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'upload': json['upload'], }; } -export function DataPathOneOf1ToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DataPathOneOf1ToJSON(json) { + return DataPathOneOf1ToJSONTyped(json, false); +} +export function DataPathOneOf1ToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'upload': value.upload, + 'upload': value['upload'], }; } diff --git a/typescript/dist/esm/models/DataUsage.d.ts b/typescript/dist/esm/models/DataUsage.d.ts index e4d2035e..c406d613 100644 --- a/typescript/dist/esm/models/DataUsage.d.ts +++ b/typescript/dist/esm/models/DataUsage.d.ts @@ -49,7 +49,8 @@ export interface DataUsage { /** * Check if a given object implements the DataUsage interface. */ -export declare function instanceOfDataUsage(value: object): boolean; +export declare function instanceOfDataUsage(value: object): value is DataUsage; export declare function DataUsageFromJSON(json: any): DataUsage; export declare function DataUsageFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataUsage; -export declare function DataUsageToJSON(value?: DataUsage | null): any; +export declare function DataUsageToJSON(json: any): DataUsage; +export declare function DataUsageToJSONTyped(value?: DataUsage | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DataUsage.js b/typescript/dist/esm/models/DataUsage.js index 553a8c71..f1ff1fb9 100644 --- a/typescript/dist/esm/models/DataUsage.js +++ b/typescript/dist/esm/models/DataUsage.js @@ -15,19 +15,23 @@ * Check if a given object implements the DataUsage interface. */ export function instanceOfDataUsage(value) { - let isInstance = true; - isInstance = isInstance && "computationId" in value; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "timestamp" in value; - isInstance = isInstance && "userId" in value; - return isInstance; + if (!('computationId' in value) || value['computationId'] === undefined) + return false; + if (!('count' in value) || value['count'] === undefined) + return false; + if (!('data' in value) || value['data'] === undefined) + return false; + if (!('timestamp' in value) || value['timestamp'] === undefined) + return false; + if (!('userId' in value) || value['userId'] === undefined) + return false; + return true; } export function DataUsageFromJSON(json) { return DataUsageFromJSONTyped(json, false); } export function DataUsageFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,18 +42,18 @@ export function DataUsageFromJSONTyped(json, ignoreDiscriminator) { 'userId': json['userId'], }; } -export function DataUsageToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DataUsageToJSON(json) { + return DataUsageToJSONTyped(json, false); +} +export function DataUsageToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'computationId': value.computationId, - 'count': value.count, - 'data': value.data, - 'timestamp': (value.timestamp.toISOString()), - 'userId': value.userId, + 'computationId': value['computationId'], + 'count': value['count'], + 'data': value['data'], + 'timestamp': ((value['timestamp']).toISOString()), + 'userId': value['userId'], }; } diff --git a/typescript/dist/esm/models/DataUsageSummary.d.ts b/typescript/dist/esm/models/DataUsageSummary.d.ts index 37c28d1a..818080e3 100644 --- a/typescript/dist/esm/models/DataUsageSummary.d.ts +++ b/typescript/dist/esm/models/DataUsageSummary.d.ts @@ -37,7 +37,8 @@ export interface DataUsageSummary { /** * Check if a given object implements the DataUsageSummary interface. */ -export declare function instanceOfDataUsageSummary(value: object): boolean; +export declare function instanceOfDataUsageSummary(value: object): value is DataUsageSummary; export declare function DataUsageSummaryFromJSON(json: any): DataUsageSummary; export declare function DataUsageSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataUsageSummary; -export declare function DataUsageSummaryToJSON(value?: DataUsageSummary | null): any; +export declare function DataUsageSummaryToJSON(json: any): DataUsageSummary; +export declare function DataUsageSummaryToJSONTyped(value?: DataUsageSummary | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DataUsageSummary.js b/typescript/dist/esm/models/DataUsageSummary.js index d7e63f62..532cf93c 100644 --- a/typescript/dist/esm/models/DataUsageSummary.js +++ b/typescript/dist/esm/models/DataUsageSummary.js @@ -15,17 +15,19 @@ * Check if a given object implements the DataUsageSummary interface. */ export function instanceOfDataUsageSummary(value) { - let isInstance = true; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "timestamp" in value; - return isInstance; + if (!('count' in value) || value['count'] === undefined) + return false; + if (!('data' in value) || value['data'] === undefined) + return false; + if (!('timestamp' in value) || value['timestamp'] === undefined) + return false; + return true; } export function DataUsageSummaryFromJSON(json) { return DataUsageSummaryFromJSONTyped(json, false); } export function DataUsageSummaryFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -34,16 +36,16 @@ export function DataUsageSummaryFromJSONTyped(json, ignoreDiscriminator) { 'timestamp': (new Date(json['timestamp'])), }; } -export function DataUsageSummaryToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DataUsageSummaryToJSON(json) { + return DataUsageSummaryToJSONTyped(json, false); +} +export function DataUsageSummaryToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'count': value.count, - 'data': value.data, - 'timestamp': (value.timestamp.toISOString()), + 'count': value['count'], + 'data': value['data'], + 'timestamp': ((value['timestamp']).toISOString()), }; } diff --git a/typescript/dist/esm/models/Dataset.d.ts b/typescript/dist/esm/models/Dataset.d.ts index 91ca3554..5dd433f5 100644 --- a/typescript/dist/esm/models/Dataset.d.ts +++ b/typescript/dist/esm/models/Dataset.d.ts @@ -76,7 +76,8 @@ export interface Dataset { /** * Check if a given object implements the Dataset interface. */ -export declare function instanceOfDataset(value: object): boolean; +export declare function instanceOfDataset(value: object): value is Dataset; export declare function DatasetFromJSON(json: any): Dataset; export declare function DatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Dataset; -export declare function DatasetToJSON(value?: Dataset | null): any; +export declare function DatasetToJSON(json: any): Dataset; +export declare function DatasetToJSONTyped(value?: Dataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Dataset.js b/typescript/dist/esm/models/Dataset.js index 2f702377..e1d2c991 100644 --- a/typescript/dist/esm/models/Dataset.js +++ b/typescript/dist/esm/models/Dataset.js @@ -11,7 +11,6 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { ProvenanceFromJSON, ProvenanceToJSON, } from './Provenance'; import { SymbologyFromJSON, SymbologyToJSON, } from './Symbology'; import { TypedResultDescriptorFromJSON, TypedResultDescriptorToJSON, } from './TypedResultDescriptor'; @@ -19,20 +18,25 @@ import { TypedResultDescriptorFromJSON, TypedResultDescriptorToJSON, } from './T * Check if a given object implements the Dataset interface. */ export function instanceOfDataset(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "sourceOperator" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('sourceOperator' in value) || value['sourceOperator'] === undefined) + return false; + return true; } export function DatasetFromJSON(json) { return DatasetFromJSONTyped(json, false); } export function DatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -40,29 +44,29 @@ export function DatasetFromJSONTyped(json, ignoreDiscriminator) { 'displayName': json['displayName'], 'id': json['id'], 'name': json['name'], - 'provenance': !exists(json, 'provenance') ? undefined : (json['provenance'] === null ? null : json['provenance'].map(ProvenanceFromJSON)), + 'provenance': json['provenance'] == null ? undefined : (json['provenance'].map(ProvenanceFromJSON)), 'resultDescriptor': TypedResultDescriptorFromJSON(json['resultDescriptor']), 'sourceOperator': json['sourceOperator'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), - 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), + 'tags': json['tags'] == null ? undefined : json['tags'], }; } -export function DatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DatasetToJSON(json) { + return DatasetToJSONTyped(json, false); +} +export function DatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'displayName': value.displayName, - 'id': value.id, - 'name': value.name, - 'provenance': value.provenance === undefined ? undefined : (value.provenance === null ? null : value.provenance.map(ProvenanceToJSON)), - 'resultDescriptor': TypedResultDescriptorToJSON(value.resultDescriptor), - 'sourceOperator': value.sourceOperator, - 'symbology': SymbologyToJSON(value.symbology), - 'tags': value.tags, + 'description': value['description'], + 'displayName': value['displayName'], + 'id': value['id'], + 'name': value['name'], + 'provenance': value['provenance'] == null ? undefined : (value['provenance'].map(ProvenanceToJSON)), + 'resultDescriptor': TypedResultDescriptorToJSON(value['resultDescriptor']), + 'sourceOperator': value['sourceOperator'], + 'symbology': SymbologyToJSON(value['symbology']), + 'tags': value['tags'], }; } diff --git a/typescript/dist/esm/models/DatasetDefinition.d.ts b/typescript/dist/esm/models/DatasetDefinition.d.ts index 5f645eec..4ff6160a 100644 --- a/typescript/dist/esm/models/DatasetDefinition.d.ts +++ b/typescript/dist/esm/models/DatasetDefinition.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { AddDataset } from './AddDataset'; import type { MetaDataDefinition } from './MetaDataDefinition'; +import type { AddDataset } from './AddDataset'; /** * * @export @@ -33,7 +33,8 @@ export interface DatasetDefinition { /** * Check if a given object implements the DatasetDefinition interface. */ -export declare function instanceOfDatasetDefinition(value: object): boolean; +export declare function instanceOfDatasetDefinition(value: object): value is DatasetDefinition; export declare function DatasetDefinitionFromJSON(json: any): DatasetDefinition; export declare function DatasetDefinitionFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatasetDefinition; -export declare function DatasetDefinitionToJSON(value?: DatasetDefinition | null): any; +export declare function DatasetDefinitionToJSON(json: any): DatasetDefinition; +export declare function DatasetDefinitionToJSONTyped(value?: DatasetDefinition | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DatasetDefinition.js b/typescript/dist/esm/models/DatasetDefinition.js index f06fa61d..4dead4e2 100644 --- a/typescript/dist/esm/models/DatasetDefinition.js +++ b/typescript/dist/esm/models/DatasetDefinition.js @@ -11,22 +11,23 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { AddDatasetFromJSON, AddDatasetToJSON, } from './AddDataset'; import { MetaDataDefinitionFromJSON, MetaDataDefinitionToJSON, } from './MetaDataDefinition'; +import { AddDatasetFromJSON, AddDatasetToJSON, } from './AddDataset'; /** * Check if a given object implements the DatasetDefinition interface. */ export function instanceOfDatasetDefinition(value) { - let isInstance = true; - isInstance = isInstance && "metaData" in value; - isInstance = isInstance && "properties" in value; - return isInstance; + if (!('metaData' in value) || value['metaData'] === undefined) + return false; + if (!('properties' in value) || value['properties'] === undefined) + return false; + return true; } export function DatasetDefinitionFromJSON(json) { return DatasetDefinitionFromJSONTyped(json, false); } export function DatasetDefinitionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -34,15 +35,15 @@ export function DatasetDefinitionFromJSONTyped(json, ignoreDiscriminator) { 'properties': AddDatasetFromJSON(json['properties']), }; } -export function DatasetDefinitionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DatasetDefinitionToJSON(json) { + return DatasetDefinitionToJSONTyped(json, false); +} +export function DatasetDefinitionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'metaData': MetaDataDefinitionToJSON(value.metaData), - 'properties': AddDatasetToJSON(value.properties), + 'metaData': MetaDataDefinitionToJSON(value['metaData']), + 'properties': AddDatasetToJSON(value['properties']), }; } diff --git a/typescript/dist/esm/models/DatasetListing.d.ts b/typescript/dist/esm/models/DatasetListing.d.ts index f5c590ad..01328add 100644 --- a/typescript/dist/esm/models/DatasetListing.d.ts +++ b/typescript/dist/esm/models/DatasetListing.d.ts @@ -69,7 +69,8 @@ export interface DatasetListing { /** * Check if a given object implements the DatasetListing interface. */ -export declare function instanceOfDatasetListing(value: object): boolean; +export declare function instanceOfDatasetListing(value: object): value is DatasetListing; export declare function DatasetListingFromJSON(json: any): DatasetListing; export declare function DatasetListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatasetListing; -export declare function DatasetListingToJSON(value?: DatasetListing | null): any; +export declare function DatasetListingToJSON(json: any): DatasetListing; +export declare function DatasetListingToJSONTyped(value?: DatasetListing | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DatasetListing.js b/typescript/dist/esm/models/DatasetListing.js index 46943c0d..b340e224 100644 --- a/typescript/dist/esm/models/DatasetListing.js +++ b/typescript/dist/esm/models/DatasetListing.js @@ -11,28 +11,33 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { SymbologyFromJSON, SymbologyToJSON, } from './Symbology'; import { TypedResultDescriptorFromJSON, TypedResultDescriptorToJSON, } from './TypedResultDescriptor'; /** * Check if a given object implements the DatasetListing interface. */ export function instanceOfDatasetListing(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "sourceOperator" in value; - isInstance = isInstance && "tags" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('sourceOperator' in value) || value['sourceOperator'] === undefined) + return false; + if (!('tags' in value) || value['tags'] === undefined) + return false; + return true; } export function DatasetListingFromJSON(json) { return DatasetListingFromJSONTyped(json, false); } export function DatasetListingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,25 +47,25 @@ export function DatasetListingFromJSONTyped(json, ignoreDiscriminator) { 'name': json['name'], 'resultDescriptor': TypedResultDescriptorFromJSON(json['resultDescriptor']), 'sourceOperator': json['sourceOperator'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), 'tags': json['tags'], }; } -export function DatasetListingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DatasetListingToJSON(json) { + return DatasetListingToJSONTyped(json, false); +} +export function DatasetListingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'displayName': value.displayName, - 'id': value.id, - 'name': value.name, - 'resultDescriptor': TypedResultDescriptorToJSON(value.resultDescriptor), - 'sourceOperator': value.sourceOperator, - 'symbology': SymbologyToJSON(value.symbology), - 'tags': value.tags, + 'description': value['description'], + 'displayName': value['displayName'], + 'id': value['id'], + 'name': value['name'], + 'resultDescriptor': TypedResultDescriptorToJSON(value['resultDescriptor']), + 'sourceOperator': value['sourceOperator'], + 'symbology': SymbologyToJSON(value['symbology']), + 'tags': value['tags'], }; } diff --git a/typescript/dist/esm/models/DatasetResource.d.ts b/typescript/dist/esm/models/DatasetResource.d.ts index b2267d2d..c9dc85e6 100644 --- a/typescript/dist/esm/models/DatasetResource.d.ts +++ b/typescript/dist/esm/models/DatasetResource.d.ts @@ -38,7 +38,8 @@ export type DatasetResourceTypeEnum = typeof DatasetResourceTypeEnum[keyof typeo /** * Check if a given object implements the DatasetResource interface. */ -export declare function instanceOfDatasetResource(value: object): boolean; +export declare function instanceOfDatasetResource(value: object): value is DatasetResource; export declare function DatasetResourceFromJSON(json: any): DatasetResource; export declare function DatasetResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatasetResource; -export declare function DatasetResourceToJSON(value?: DatasetResource | null): any; +export declare function DatasetResourceToJSON(json: any): DatasetResource; +export declare function DatasetResourceToJSONTyped(value?: DatasetResource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DatasetResource.js b/typescript/dist/esm/models/DatasetResource.js index ee6cd3ed..32227cba 100644 --- a/typescript/dist/esm/models/DatasetResource.js +++ b/typescript/dist/esm/models/DatasetResource.js @@ -21,16 +21,17 @@ export const DatasetResourceTypeEnum = { * Check if a given object implements the DatasetResource interface. */ export function instanceOfDatasetResource(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function DatasetResourceFromJSON(json) { return DatasetResourceFromJSONTyped(json, false); } export function DatasetResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,15 +39,15 @@ export function DatasetResourceFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function DatasetResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DatasetResourceToJSON(json) { + return DatasetResourceToJSONTyped(json, false); +} +export function DatasetResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/DateTime.d.ts b/typescript/dist/esm/models/DateTime.d.ts index 15f27d04..c0634073 100644 --- a/typescript/dist/esm/models/DateTime.d.ts +++ b/typescript/dist/esm/models/DateTime.d.ts @@ -25,7 +25,8 @@ export interface DateTime { /** * Check if a given object implements the DateTime interface. */ -export declare function instanceOfDateTime(value: object): boolean; +export declare function instanceOfDateTime(value: object): value is DateTime; export declare function DateTimeFromJSON(json: any): DateTime; export declare function DateTimeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DateTime; -export declare function DateTimeToJSON(value?: DateTime | null): any; +export declare function DateTimeToJSON(json: any): DateTime; +export declare function DateTimeToJSONTyped(value?: DateTime | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DateTime.js b/typescript/dist/esm/models/DateTime.js index c6754309..c1dda6fa 100644 --- a/typescript/dist/esm/models/DateTime.js +++ b/typescript/dist/esm/models/DateTime.js @@ -15,29 +15,29 @@ * Check if a given object implements the DateTime interface. */ export function instanceOfDateTime(value) { - let isInstance = true; - isInstance = isInstance && "datetime" in value; - return isInstance; + if (!('datetime' in value) || value['datetime'] === undefined) + return false; + return true; } export function DateTimeFromJSON(json) { return DateTimeFromJSONTyped(json, false); } export function DateTimeFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'datetime': (new Date(json['datetime'])), }; } -export function DateTimeToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DateTimeToJSON(json) { + return DateTimeToJSONTyped(json, false); +} +export function DateTimeToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'datetime': (value.datetime.toISOString()), + 'datetime': ((value['datetime']).toISOString()), }; } diff --git a/typescript/dist/esm/models/DerivedColor.d.ts b/typescript/dist/esm/models/DerivedColor.d.ts index d704d4b7..4a4bed2c 100644 --- a/typescript/dist/esm/models/DerivedColor.d.ts +++ b/typescript/dist/esm/models/DerivedColor.d.ts @@ -45,7 +45,8 @@ export type DerivedColorTypeEnum = typeof DerivedColorTypeEnum[keyof typeof Deri /** * Check if a given object implements the DerivedColor interface. */ -export declare function instanceOfDerivedColor(value: object): boolean; +export declare function instanceOfDerivedColor(value: object): value is DerivedColor; export declare function DerivedColorFromJSON(json: any): DerivedColor; export declare function DerivedColorFromJSONTyped(json: any, ignoreDiscriminator: boolean): DerivedColor; -export declare function DerivedColorToJSON(value?: DerivedColor | null): any; +export declare function DerivedColorToJSON(json: any): DerivedColor; +export declare function DerivedColorToJSONTyped(value?: DerivedColor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DerivedColor.js b/typescript/dist/esm/models/DerivedColor.js index 669a33bc..8814d9fe 100644 --- a/typescript/dist/esm/models/DerivedColor.js +++ b/typescript/dist/esm/models/DerivedColor.js @@ -22,17 +22,19 @@ export const DerivedColorTypeEnum = { * Check if a given object implements the DerivedColor interface. */ export function instanceOfDerivedColor(value) { - let isInstance = true; - isInstance = isInstance && "attribute" in value; - isInstance = isInstance && "colorizer" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('attribute' in value) || value['attribute'] === undefined) + return false; + if (!('colorizer' in value) || value['colorizer'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function DerivedColorFromJSON(json) { return DerivedColorFromJSONTyped(json, false); } export function DerivedColorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,16 +43,16 @@ export function DerivedColorFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function DerivedColorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DerivedColorToJSON(json) { + return DerivedColorToJSONTyped(json, false); +} +export function DerivedColorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'attribute': value.attribute, - 'colorizer': ColorizerToJSON(value.colorizer), - 'type': value.type, + 'attribute': value['attribute'], + 'colorizer': ColorizerToJSON(value['colorizer']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/DerivedNumber.d.ts b/typescript/dist/esm/models/DerivedNumber.d.ts index 6a21127b..33d8105b 100644 --- a/typescript/dist/esm/models/DerivedNumber.d.ts +++ b/typescript/dist/esm/models/DerivedNumber.d.ts @@ -50,7 +50,8 @@ export type DerivedNumberTypeEnum = typeof DerivedNumberTypeEnum[keyof typeof De /** * Check if a given object implements the DerivedNumber interface. */ -export declare function instanceOfDerivedNumber(value: object): boolean; +export declare function instanceOfDerivedNumber(value: object): value is DerivedNumber; export declare function DerivedNumberFromJSON(json: any): DerivedNumber; export declare function DerivedNumberFromJSONTyped(json: any, ignoreDiscriminator: boolean): DerivedNumber; -export declare function DerivedNumberToJSON(value?: DerivedNumber | null): any; +export declare function DerivedNumberToJSON(json: any): DerivedNumber; +export declare function DerivedNumberToJSONTyped(value?: DerivedNumber | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/DerivedNumber.js b/typescript/dist/esm/models/DerivedNumber.js index 146ff45d..3a87d52c 100644 --- a/typescript/dist/esm/models/DerivedNumber.js +++ b/typescript/dist/esm/models/DerivedNumber.js @@ -21,18 +21,21 @@ export const DerivedNumberTypeEnum = { * Check if a given object implements the DerivedNumber interface. */ export function instanceOfDerivedNumber(value) { - let isInstance = true; - isInstance = isInstance && "attribute" in value; - isInstance = isInstance && "defaultValue" in value; - isInstance = isInstance && "factor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('attribute' in value) || value['attribute'] === undefined) + return false; + if (!('defaultValue' in value) || value['defaultValue'] === undefined) + return false; + if (!('factor' in value) || value['factor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function DerivedNumberFromJSON(json) { return DerivedNumberFromJSONTyped(json, false); } export function DerivedNumberFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,17 +45,17 @@ export function DerivedNumberFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function DerivedNumberToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DerivedNumberToJSON(json) { + return DerivedNumberToJSONTyped(json, false); +} +export function DerivedNumberToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'attribute': value.attribute, - 'defaultValue': value.defaultValue, - 'factor': value.factor, - 'type': value.type, + 'attribute': value['attribute'], + 'defaultValue': value['defaultValue'], + 'factor': value['factor'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/DescribeCoverageRequest.d.ts b/typescript/dist/esm/models/DescribeCoverageRequest.d.ts index 8abf5f19..5cc34e7e 100644 --- a/typescript/dist/esm/models/DescribeCoverageRequest.d.ts +++ b/typescript/dist/esm/models/DescribeCoverageRequest.d.ts @@ -17,6 +17,8 @@ export declare const DescribeCoverageRequest: { readonly DescribeCoverage: "DescribeCoverage"; }; export type DescribeCoverageRequest = typeof DescribeCoverageRequest[keyof typeof DescribeCoverageRequest]; +export declare function instanceOfDescribeCoverageRequest(value: any): boolean; export declare function DescribeCoverageRequestFromJSON(json: any): DescribeCoverageRequest; export declare function DescribeCoverageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeCoverageRequest; export declare function DescribeCoverageRequestToJSON(value?: DescribeCoverageRequest | null): any; +export declare function DescribeCoverageRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): DescribeCoverageRequest; diff --git a/typescript/dist/esm/models/DescribeCoverageRequest.js b/typescript/dist/esm/models/DescribeCoverageRequest.js index 632e29b8..fd5ae1f5 100644 --- a/typescript/dist/esm/models/DescribeCoverageRequest.js +++ b/typescript/dist/esm/models/DescribeCoverageRequest.js @@ -18,6 +18,16 @@ export const DescribeCoverageRequest = { DescribeCoverage: 'DescribeCoverage' }; +export function instanceOfDescribeCoverageRequest(value) { + for (const key in DescribeCoverageRequest) { + if (Object.prototype.hasOwnProperty.call(DescribeCoverageRequest, key)) { + if (DescribeCoverageRequest[key] === value) { + return true; + } + } + } + return false; +} export function DescribeCoverageRequestFromJSON(json) { return DescribeCoverageRequestFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function DescribeCoverageRequestFromJSONTyped(json, ignoreDiscriminator) export function DescribeCoverageRequestToJSON(value) { return value; } +export function DescribeCoverageRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/ErrorResponse.d.ts b/typescript/dist/esm/models/ErrorResponse.d.ts index 75036720..854640e6 100644 --- a/typescript/dist/esm/models/ErrorResponse.d.ts +++ b/typescript/dist/esm/models/ErrorResponse.d.ts @@ -31,7 +31,8 @@ export interface ErrorResponse { /** * Check if a given object implements the ErrorResponse interface. */ -export declare function instanceOfErrorResponse(value: object): boolean; +export declare function instanceOfErrorResponse(value: object): value is ErrorResponse; export declare function ErrorResponseFromJSON(json: any): ErrorResponse; export declare function ErrorResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorResponse; -export declare function ErrorResponseToJSON(value?: ErrorResponse | null): any; +export declare function ErrorResponseToJSON(json: any): ErrorResponse; +export declare function ErrorResponseToJSONTyped(value?: ErrorResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ErrorResponse.js b/typescript/dist/esm/models/ErrorResponse.js index 0ccf7781..f1a84cb9 100644 --- a/typescript/dist/esm/models/ErrorResponse.js +++ b/typescript/dist/esm/models/ErrorResponse.js @@ -15,16 +15,17 @@ * Check if a given object implements the ErrorResponse interface. */ export function instanceOfErrorResponse(value) { - let isInstance = true; - isInstance = isInstance && "error" in value; - isInstance = isInstance && "message" in value; - return isInstance; + if (!('error' in value) || value['error'] === undefined) + return false; + if (!('message' in value) || value['message'] === undefined) + return false; + return true; } export function ErrorResponseFromJSON(json) { return ErrorResponseFromJSONTyped(json, false); } export function ErrorResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function ErrorResponseFromJSONTyped(json, ignoreDiscriminator) { 'message': json['message'], }; } -export function ErrorResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ErrorResponseToJSON(json) { + return ErrorResponseToJSONTyped(json, false); +} +export function ErrorResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'error': value.error, - 'message': value.message, + 'error': value['error'], + 'message': value['message'], }; } diff --git a/typescript/dist/esm/models/ExternalDataId.d.ts b/typescript/dist/esm/models/ExternalDataId.d.ts index cf1fd7d4..7d545dd8 100644 --- a/typescript/dist/esm/models/ExternalDataId.d.ts +++ b/typescript/dist/esm/models/ExternalDataId.d.ts @@ -44,7 +44,8 @@ export type ExternalDataIdTypeEnum = typeof ExternalDataIdTypeEnum[keyof typeof /** * Check if a given object implements the ExternalDataId interface. */ -export declare function instanceOfExternalDataId(value: object): boolean; +export declare function instanceOfExternalDataId(value: object): value is ExternalDataId; export declare function ExternalDataIdFromJSON(json: any): ExternalDataId; export declare function ExternalDataIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExternalDataId; -export declare function ExternalDataIdToJSON(value?: ExternalDataId | null): any; +export declare function ExternalDataIdToJSON(json: any): ExternalDataId; +export declare function ExternalDataIdToJSONTyped(value?: ExternalDataId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ExternalDataId.js b/typescript/dist/esm/models/ExternalDataId.js index 7baa3f01..0c57cb42 100644 --- a/typescript/dist/esm/models/ExternalDataId.js +++ b/typescript/dist/esm/models/ExternalDataId.js @@ -21,17 +21,19 @@ export const ExternalDataIdTypeEnum = { * Check if a given object implements the ExternalDataId interface. */ export function instanceOfExternalDataId(value) { - let isInstance = true; - isInstance = isInstance && "layerId" in value; - isInstance = isInstance && "providerId" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('layerId' in value) || value['layerId'] === undefined) + return false; + if (!('providerId' in value) || value['providerId'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function ExternalDataIdFromJSON(json) { return ExternalDataIdFromJSONTyped(json, false); } export function ExternalDataIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -40,16 +42,16 @@ export function ExternalDataIdFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function ExternalDataIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ExternalDataIdToJSON(json) { + return ExternalDataIdToJSONTyped(json, false); +} +export function ExternalDataIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'layerId': value.layerId, - 'providerId': value.providerId, - 'type': value.type, + 'layerId': value['layerId'], + 'providerId': value['providerId'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/FeatureDataType.d.ts b/typescript/dist/esm/models/FeatureDataType.d.ts index 17a2b28c..a0b12e48 100644 --- a/typescript/dist/esm/models/FeatureDataType.d.ts +++ b/typescript/dist/esm/models/FeatureDataType.d.ts @@ -22,6 +22,8 @@ export declare const FeatureDataType: { readonly DateTime: "dateTime"; }; export type FeatureDataType = typeof FeatureDataType[keyof typeof FeatureDataType]; +export declare function instanceOfFeatureDataType(value: any): boolean; export declare function FeatureDataTypeFromJSON(json: any): FeatureDataType; export declare function FeatureDataTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureDataType; export declare function FeatureDataTypeToJSON(value?: FeatureDataType | null): any; +export declare function FeatureDataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): FeatureDataType; diff --git a/typescript/dist/esm/models/FeatureDataType.js b/typescript/dist/esm/models/FeatureDataType.js index 4c9db2f0..d488d6af 100644 --- a/typescript/dist/esm/models/FeatureDataType.js +++ b/typescript/dist/esm/models/FeatureDataType.js @@ -23,6 +23,16 @@ export const FeatureDataType = { Bool: 'bool', DateTime: 'dateTime' }; +export function instanceOfFeatureDataType(value) { + for (const key in FeatureDataType) { + if (Object.prototype.hasOwnProperty.call(FeatureDataType, key)) { + if (FeatureDataType[key] === value) { + return true; + } + } + } + return false; +} export function FeatureDataTypeFromJSON(json) { return FeatureDataTypeFromJSONTyped(json, false); } @@ -32,3 +42,6 @@ export function FeatureDataTypeFromJSONTyped(json, ignoreDiscriminator) { export function FeatureDataTypeToJSON(value) { return value; } +export function FeatureDataTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/FileNotFoundHandling.d.ts b/typescript/dist/esm/models/FileNotFoundHandling.d.ts index e4aa2e05..8467ab74 100644 --- a/typescript/dist/esm/models/FileNotFoundHandling.d.ts +++ b/typescript/dist/esm/models/FileNotFoundHandling.d.ts @@ -18,6 +18,8 @@ export declare const FileNotFoundHandling: { readonly Error: "Error"; }; export type FileNotFoundHandling = typeof FileNotFoundHandling[keyof typeof FileNotFoundHandling]; +export declare function instanceOfFileNotFoundHandling(value: any): boolean; export declare function FileNotFoundHandlingFromJSON(json: any): FileNotFoundHandling; export declare function FileNotFoundHandlingFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileNotFoundHandling; export declare function FileNotFoundHandlingToJSON(value?: FileNotFoundHandling | null): any; +export declare function FileNotFoundHandlingToJSONTyped(value: any, ignoreDiscriminator: boolean): FileNotFoundHandling; diff --git a/typescript/dist/esm/models/FileNotFoundHandling.js b/typescript/dist/esm/models/FileNotFoundHandling.js index b90453f9..007e0498 100644 --- a/typescript/dist/esm/models/FileNotFoundHandling.js +++ b/typescript/dist/esm/models/FileNotFoundHandling.js @@ -19,6 +19,16 @@ export const FileNotFoundHandling = { NoData: 'NoData', Error: 'Error' }; +export function instanceOfFileNotFoundHandling(value) { + for (const key in FileNotFoundHandling) { + if (Object.prototype.hasOwnProperty.call(FileNotFoundHandling, key)) { + if (FileNotFoundHandling[key] === value) { + return true; + } + } + } + return false; +} export function FileNotFoundHandlingFromJSON(json) { return FileNotFoundHandlingFromJSONTyped(json, false); } @@ -28,3 +38,6 @@ export function FileNotFoundHandlingFromJSONTyped(json, ignoreDiscriminator) { export function FileNotFoundHandlingToJSON(value) { return value; } +export function FileNotFoundHandlingToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/FormatSpecifics.d.ts b/typescript/dist/esm/models/FormatSpecifics.d.ts index 72050a4f..02aedb0e 100644 --- a/typescript/dist/esm/models/FormatSpecifics.d.ts +++ b/typescript/dist/esm/models/FormatSpecifics.d.ts @@ -9,7 +9,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { FormatSpecificsOneOf } from './FormatSpecificsOneOf'; +import type { FormatSpecificsOneOf } from './FormatSpecificsOneOf'; /** * @type FormatSpecifics * @@ -18,4 +18,5 @@ import { FormatSpecificsOneOf } from './FormatSpecificsOneOf'; export type FormatSpecifics = FormatSpecificsOneOf; export declare function FormatSpecificsFromJSON(json: any): FormatSpecifics; export declare function FormatSpecificsFromJSONTyped(json: any, ignoreDiscriminator: boolean): FormatSpecifics; -export declare function FormatSpecificsToJSON(value?: FormatSpecifics | null): any; +export declare function FormatSpecificsToJSON(json: any): any; +export declare function FormatSpecificsToJSONTyped(value?: FormatSpecifics | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/FormatSpecifics.js b/typescript/dist/esm/models/FormatSpecifics.js index 75cd6ea7..6b3efe52 100644 --- a/typescript/dist/esm/models/FormatSpecifics.js +++ b/typescript/dist/esm/models/FormatSpecifics.js @@ -16,17 +16,20 @@ export function FormatSpecificsFromJSON(json) { return FormatSpecificsFromJSONTyped(json, false); } export function FormatSpecificsFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - return Object.assign({}, FormatSpecificsOneOfFromJSONTyped(json, true)); -} -export function FormatSpecificsToJSON(value) { - if (value === undefined) { - return undefined; + if (instanceOfFormatSpecificsOneOf(json)) { + return FormatSpecificsOneOfFromJSONTyped(json, true); } - if (value === null) { - return null; + return {}; +} +export function FormatSpecificsToJSON(json) { + return FormatSpecificsToJSONTyped(json, false); +} +export function FormatSpecificsToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } if (instanceOfFormatSpecificsOneOf(value)) { return FormatSpecificsOneOfToJSON(value); diff --git a/typescript/dist/esm/models/FormatSpecificsOneOf.d.ts b/typescript/dist/esm/models/FormatSpecificsOneOf.d.ts index fa56f7a9..3875ba2f 100644 --- a/typescript/dist/esm/models/FormatSpecificsOneOf.d.ts +++ b/typescript/dist/esm/models/FormatSpecificsOneOf.d.ts @@ -26,7 +26,8 @@ export interface FormatSpecificsOneOf { /** * Check if a given object implements the FormatSpecificsOneOf interface. */ -export declare function instanceOfFormatSpecificsOneOf(value: object): boolean; +export declare function instanceOfFormatSpecificsOneOf(value: object): value is FormatSpecificsOneOf; export declare function FormatSpecificsOneOfFromJSON(json: any): FormatSpecificsOneOf; export declare function FormatSpecificsOneOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): FormatSpecificsOneOf; -export declare function FormatSpecificsOneOfToJSON(value?: FormatSpecificsOneOf | null): any; +export declare function FormatSpecificsOneOfToJSON(json: any): FormatSpecificsOneOf; +export declare function FormatSpecificsOneOfToJSONTyped(value?: FormatSpecificsOneOf | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/FormatSpecificsOneOf.js b/typescript/dist/esm/models/FormatSpecificsOneOf.js index 6473c6f9..4e94c6ea 100644 --- a/typescript/dist/esm/models/FormatSpecificsOneOf.js +++ b/typescript/dist/esm/models/FormatSpecificsOneOf.js @@ -16,29 +16,29 @@ import { FormatSpecificsOneOfCsvFromJSON, FormatSpecificsOneOfCsvToJSON, } from * Check if a given object implements the FormatSpecificsOneOf interface. */ export function instanceOfFormatSpecificsOneOf(value) { - let isInstance = true; - isInstance = isInstance && "csv" in value; - return isInstance; + if (!('csv' in value) || value['csv'] === undefined) + return false; + return true; } export function FormatSpecificsOneOfFromJSON(json) { return FormatSpecificsOneOfFromJSONTyped(json, false); } export function FormatSpecificsOneOfFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'csv': FormatSpecificsOneOfCsvFromJSON(json['csv']), }; } -export function FormatSpecificsOneOfToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function FormatSpecificsOneOfToJSON(json) { + return FormatSpecificsOneOfToJSONTyped(json, false); +} +export function FormatSpecificsOneOfToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'csv': FormatSpecificsOneOfCsvToJSON(value.csv), + 'csv': FormatSpecificsOneOfCsvToJSON(value['csv']), }; } diff --git a/typescript/dist/esm/models/FormatSpecificsOneOfCsv.d.ts b/typescript/dist/esm/models/FormatSpecificsOneOfCsv.d.ts index 7a244c60..b9b304aa 100644 --- a/typescript/dist/esm/models/FormatSpecificsOneOfCsv.d.ts +++ b/typescript/dist/esm/models/FormatSpecificsOneOfCsv.d.ts @@ -26,7 +26,8 @@ export interface FormatSpecificsOneOfCsv { /** * Check if a given object implements the FormatSpecificsOneOfCsv interface. */ -export declare function instanceOfFormatSpecificsOneOfCsv(value: object): boolean; +export declare function instanceOfFormatSpecificsOneOfCsv(value: object): value is FormatSpecificsOneOfCsv; export declare function FormatSpecificsOneOfCsvFromJSON(json: any): FormatSpecificsOneOfCsv; export declare function FormatSpecificsOneOfCsvFromJSONTyped(json: any, ignoreDiscriminator: boolean): FormatSpecificsOneOfCsv; -export declare function FormatSpecificsOneOfCsvToJSON(value?: FormatSpecificsOneOfCsv | null): any; +export declare function FormatSpecificsOneOfCsvToJSON(json: any): FormatSpecificsOneOfCsv; +export declare function FormatSpecificsOneOfCsvToJSONTyped(value?: FormatSpecificsOneOfCsv | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/FormatSpecificsOneOfCsv.js b/typescript/dist/esm/models/FormatSpecificsOneOfCsv.js index 7170531f..18b1f025 100644 --- a/typescript/dist/esm/models/FormatSpecificsOneOfCsv.js +++ b/typescript/dist/esm/models/FormatSpecificsOneOfCsv.js @@ -16,29 +16,29 @@ import { CsvHeaderFromJSON, CsvHeaderToJSON, } from './CsvHeader'; * Check if a given object implements the FormatSpecificsOneOfCsv interface. */ export function instanceOfFormatSpecificsOneOfCsv(value) { - let isInstance = true; - isInstance = isInstance && "header" in value; - return isInstance; + if (!('header' in value) || value['header'] === undefined) + return false; + return true; } export function FormatSpecificsOneOfCsvFromJSON(json) { return FormatSpecificsOneOfCsvFromJSONTyped(json, false); } export function FormatSpecificsOneOfCsvFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'header': CsvHeaderFromJSON(json['header']), }; } -export function FormatSpecificsOneOfCsvToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function FormatSpecificsOneOfCsvToJSON(json) { + return FormatSpecificsOneOfCsvToJSONTyped(json, false); +} +export function FormatSpecificsOneOfCsvToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'header': CsvHeaderToJSON(value.header), + 'header': CsvHeaderToJSON(value['header']), }; } diff --git a/typescript/dist/esm/models/GdalDatasetGeoTransform.d.ts b/typescript/dist/esm/models/GdalDatasetGeoTransform.d.ts index b549b436..cd084cf3 100644 --- a/typescript/dist/esm/models/GdalDatasetGeoTransform.d.ts +++ b/typescript/dist/esm/models/GdalDatasetGeoTransform.d.ts @@ -38,7 +38,8 @@ export interface GdalDatasetGeoTransform { /** * Check if a given object implements the GdalDatasetGeoTransform interface. */ -export declare function instanceOfGdalDatasetGeoTransform(value: object): boolean; +export declare function instanceOfGdalDatasetGeoTransform(value: object): value is GdalDatasetGeoTransform; export declare function GdalDatasetGeoTransformFromJSON(json: any): GdalDatasetGeoTransform; export declare function GdalDatasetGeoTransformFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalDatasetGeoTransform; -export declare function GdalDatasetGeoTransformToJSON(value?: GdalDatasetGeoTransform | null): any; +export declare function GdalDatasetGeoTransformToJSON(json: any): GdalDatasetGeoTransform; +export declare function GdalDatasetGeoTransformToJSONTyped(value?: GdalDatasetGeoTransform | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/GdalDatasetGeoTransform.js b/typescript/dist/esm/models/GdalDatasetGeoTransform.js index e27f5b3f..ef8c7df6 100644 --- a/typescript/dist/esm/models/GdalDatasetGeoTransform.js +++ b/typescript/dist/esm/models/GdalDatasetGeoTransform.js @@ -16,17 +16,19 @@ import { Coordinate2DFromJSON, Coordinate2DToJSON, } from './Coordinate2D'; * Check if a given object implements the GdalDatasetGeoTransform interface. */ export function instanceOfGdalDatasetGeoTransform(value) { - let isInstance = true; - isInstance = isInstance && "originCoordinate" in value; - isInstance = isInstance && "xPixelSize" in value; - isInstance = isInstance && "yPixelSize" in value; - return isInstance; + if (!('originCoordinate' in value) || value['originCoordinate'] === undefined) + return false; + if (!('xPixelSize' in value) || value['xPixelSize'] === undefined) + return false; + if (!('yPixelSize' in value) || value['yPixelSize'] === undefined) + return false; + return true; } export function GdalDatasetGeoTransformFromJSON(json) { return GdalDatasetGeoTransformFromJSONTyped(json, false); } export function GdalDatasetGeoTransformFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -35,16 +37,16 @@ export function GdalDatasetGeoTransformFromJSONTyped(json, ignoreDiscriminator) 'yPixelSize': json['yPixelSize'], }; } -export function GdalDatasetGeoTransformToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalDatasetGeoTransformToJSON(json) { + return GdalDatasetGeoTransformToJSONTyped(json, false); +} +export function GdalDatasetGeoTransformToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'originCoordinate': Coordinate2DToJSON(value.originCoordinate), - 'xPixelSize': value.xPixelSize, - 'yPixelSize': value.yPixelSize, + 'originCoordinate': Coordinate2DToJSON(value['originCoordinate']), + 'xPixelSize': value['xPixelSize'], + 'yPixelSize': value['yPixelSize'], }; } diff --git a/typescript/dist/esm/models/GdalDatasetParameters.d.ts b/typescript/dist/esm/models/GdalDatasetParameters.d.ts index fa4ce808..32c9a296 100644 --- a/typescript/dist/esm/models/GdalDatasetParameters.d.ts +++ b/typescript/dist/esm/models/GdalDatasetParameters.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { FileNotFoundHandling } from './FileNotFoundHandling'; import type { GdalDatasetGeoTransform } from './GdalDatasetGeoTransform'; import type { GdalMetadataMapping } from './GdalMetadataMapping'; +import type { FileNotFoundHandling } from './FileNotFoundHandling'; /** * Parameters for loading data using Gdal * @export @@ -88,7 +88,8 @@ export interface GdalDatasetParameters { /** * Check if a given object implements the GdalDatasetParameters interface. */ -export declare function instanceOfGdalDatasetParameters(value: object): boolean; +export declare function instanceOfGdalDatasetParameters(value: object): value is GdalDatasetParameters; export declare function GdalDatasetParametersFromJSON(json: any): GdalDatasetParameters; export declare function GdalDatasetParametersFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalDatasetParameters; -export declare function GdalDatasetParametersToJSON(value?: GdalDatasetParameters | null): any; +export declare function GdalDatasetParametersToJSON(json: any): GdalDatasetParameters; +export declare function GdalDatasetParametersToJSONTyped(value?: GdalDatasetParameters | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/GdalDatasetParameters.js b/typescript/dist/esm/models/GdalDatasetParameters.js index 615397ec..d5dedb53 100644 --- a/typescript/dist/esm/models/GdalDatasetParameters.js +++ b/typescript/dist/esm/models/GdalDatasetParameters.js @@ -11,62 +11,66 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { FileNotFoundHandlingFromJSON, FileNotFoundHandlingToJSON, } from './FileNotFoundHandling'; import { GdalDatasetGeoTransformFromJSON, GdalDatasetGeoTransformToJSON, } from './GdalDatasetGeoTransform'; import { GdalMetadataMappingFromJSON, GdalMetadataMappingToJSON, } from './GdalMetadataMapping'; +import { FileNotFoundHandlingFromJSON, FileNotFoundHandlingToJSON, } from './FileNotFoundHandling'; /** * Check if a given object implements the GdalDatasetParameters interface. */ export function instanceOfGdalDatasetParameters(value) { - let isInstance = true; - isInstance = isInstance && "fileNotFoundHandling" in value; - isInstance = isInstance && "filePath" in value; - isInstance = isInstance && "geoTransform" in value; - isInstance = isInstance && "height" in value; - isInstance = isInstance && "rasterbandChannel" in value; - isInstance = isInstance && "width" in value; - return isInstance; + if (!('fileNotFoundHandling' in value) || value['fileNotFoundHandling'] === undefined) + return false; + if (!('filePath' in value) || value['filePath'] === undefined) + return false; + if (!('geoTransform' in value) || value['geoTransform'] === undefined) + return false; + if (!('height' in value) || value['height'] === undefined) + return false; + if (!('rasterbandChannel' in value) || value['rasterbandChannel'] === undefined) + return false; + if (!('width' in value) || value['width'] === undefined) + return false; + return true; } export function GdalDatasetParametersFromJSON(json) { return GdalDatasetParametersFromJSONTyped(json, false); } export function GdalDatasetParametersFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'allowAlphabandAsMask': !exists(json, 'allowAlphabandAsMask') ? undefined : json['allowAlphabandAsMask'], + 'allowAlphabandAsMask': json['allowAlphabandAsMask'] == null ? undefined : json['allowAlphabandAsMask'], 'fileNotFoundHandling': FileNotFoundHandlingFromJSON(json['fileNotFoundHandling']), 'filePath': json['filePath'], - 'gdalConfigOptions': !exists(json, 'gdalConfigOptions') ? undefined : json['gdalConfigOptions'], - 'gdalOpenOptions': !exists(json, 'gdalOpenOptions') ? undefined : json['gdalOpenOptions'], + 'gdalConfigOptions': json['gdalConfigOptions'] == null ? undefined : json['gdalConfigOptions'], + 'gdalOpenOptions': json['gdalOpenOptions'] == null ? undefined : json['gdalOpenOptions'], 'geoTransform': GdalDatasetGeoTransformFromJSON(json['geoTransform']), 'height': json['height'], - 'noDataValue': !exists(json, 'noDataValue') ? undefined : json['noDataValue'], - 'propertiesMapping': !exists(json, 'propertiesMapping') ? undefined : (json['propertiesMapping'] === null ? null : json['propertiesMapping'].map(GdalMetadataMappingFromJSON)), + 'noDataValue': json['noDataValue'] == null ? undefined : json['noDataValue'], + 'propertiesMapping': json['propertiesMapping'] == null ? undefined : (json['propertiesMapping'].map(GdalMetadataMappingFromJSON)), 'rasterbandChannel': json['rasterbandChannel'], 'width': json['width'], }; } -export function GdalDatasetParametersToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalDatasetParametersToJSON(json) { + return GdalDatasetParametersToJSONTyped(json, false); +} +export function GdalDatasetParametersToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'allowAlphabandAsMask': value.allowAlphabandAsMask, - 'fileNotFoundHandling': FileNotFoundHandlingToJSON(value.fileNotFoundHandling), - 'filePath': value.filePath, - 'gdalConfigOptions': value.gdalConfigOptions, - 'gdalOpenOptions': value.gdalOpenOptions, - 'geoTransform': GdalDatasetGeoTransformToJSON(value.geoTransform), - 'height': value.height, - 'noDataValue': value.noDataValue, - 'propertiesMapping': value.propertiesMapping === undefined ? undefined : (value.propertiesMapping === null ? null : value.propertiesMapping.map(GdalMetadataMappingToJSON)), - 'rasterbandChannel': value.rasterbandChannel, - 'width': value.width, + 'allowAlphabandAsMask': value['allowAlphabandAsMask'], + 'fileNotFoundHandling': FileNotFoundHandlingToJSON(value['fileNotFoundHandling']), + 'filePath': value['filePath'], + 'gdalConfigOptions': value['gdalConfigOptions'], + 'gdalOpenOptions': value['gdalOpenOptions'], + 'geoTransform': GdalDatasetGeoTransformToJSON(value['geoTransform']), + 'height': value['height'], + 'noDataValue': value['noDataValue'], + 'propertiesMapping': value['propertiesMapping'] == null ? undefined : (value['propertiesMapping'].map(GdalMetadataMappingToJSON)), + 'rasterbandChannel': value['rasterbandChannel'], + 'width': value['width'], }; } diff --git a/typescript/dist/esm/models/GdalLoadingInfoTemporalSlice.d.ts b/typescript/dist/esm/models/GdalLoadingInfoTemporalSlice.d.ts index 1d0e7df9..c90109bf 100644 --- a/typescript/dist/esm/models/GdalLoadingInfoTemporalSlice.d.ts +++ b/typescript/dist/esm/models/GdalLoadingInfoTemporalSlice.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { GdalDatasetParameters } from './GdalDatasetParameters'; import type { TimeInterval } from './TimeInterval'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; /** * one temporal slice of the dataset that requires reading from exactly one Gdal dataset * @export @@ -39,7 +39,8 @@ export interface GdalLoadingInfoTemporalSlice { /** * Check if a given object implements the GdalLoadingInfoTemporalSlice interface. */ -export declare function instanceOfGdalLoadingInfoTemporalSlice(value: object): boolean; +export declare function instanceOfGdalLoadingInfoTemporalSlice(value: object): value is GdalLoadingInfoTemporalSlice; export declare function GdalLoadingInfoTemporalSliceFromJSON(json: any): GdalLoadingInfoTemporalSlice; export declare function GdalLoadingInfoTemporalSliceFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalLoadingInfoTemporalSlice; -export declare function GdalLoadingInfoTemporalSliceToJSON(value?: GdalLoadingInfoTemporalSlice | null): any; +export declare function GdalLoadingInfoTemporalSliceToJSON(json: any): GdalLoadingInfoTemporalSlice; +export declare function GdalLoadingInfoTemporalSliceToJSONTyped(value?: GdalLoadingInfoTemporalSlice | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/GdalLoadingInfoTemporalSlice.js b/typescript/dist/esm/models/GdalLoadingInfoTemporalSlice.js index 023b8761..2e3b6b61 100644 --- a/typescript/dist/esm/models/GdalLoadingInfoTemporalSlice.js +++ b/typescript/dist/esm/models/GdalLoadingInfoTemporalSlice.js @@ -11,40 +11,39 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { GdalDatasetParametersFromJSON, GdalDatasetParametersToJSON, } from './GdalDatasetParameters'; import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; +import { GdalDatasetParametersFromJSON, GdalDatasetParametersToJSON, } from './GdalDatasetParameters'; /** * Check if a given object implements the GdalLoadingInfoTemporalSlice interface. */ export function instanceOfGdalLoadingInfoTemporalSlice(value) { - let isInstance = true; - isInstance = isInstance && "time" in value; - return isInstance; + if (!('time' in value) || value['time'] === undefined) + return false; + return true; } export function GdalLoadingInfoTemporalSliceFromJSON(json) { return GdalLoadingInfoTemporalSliceFromJSONTyped(json, false); } export function GdalLoadingInfoTemporalSliceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'cacheTtl': !exists(json, 'cacheTtl') ? undefined : json['cacheTtl'], - 'params': !exists(json, 'params') ? undefined : GdalDatasetParametersFromJSON(json['params']), + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], + 'params': json['params'] == null ? undefined : GdalDatasetParametersFromJSON(json['params']), 'time': TimeIntervalFromJSON(json['time']), }; } -export function GdalLoadingInfoTemporalSliceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalLoadingInfoTemporalSliceToJSON(json) { + return GdalLoadingInfoTemporalSliceToJSONTyped(json, false); +} +export function GdalLoadingInfoTemporalSliceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'cacheTtl': value.cacheTtl, - 'params': GdalDatasetParametersToJSON(value.params), - 'time': TimeIntervalToJSON(value.time), + 'cacheTtl': value['cacheTtl'], + 'params': GdalDatasetParametersToJSON(value['params']), + 'time': TimeIntervalToJSON(value['time']), }; } diff --git a/typescript/dist/esm/models/GdalMetaDataList.d.ts b/typescript/dist/esm/models/GdalMetaDataList.d.ts index 8f68482c..201f39c3 100644 --- a/typescript/dist/esm/models/GdalMetaDataList.d.ts +++ b/typescript/dist/esm/models/GdalMetaDataList.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { GdalLoadingInfoTemporalSlice } from './GdalLoadingInfoTemporalSlice'; import type { RasterResultDescriptor } from './RasterResultDescriptor'; +import type { GdalLoadingInfoTemporalSlice } from './GdalLoadingInfoTemporalSlice'; /** * * @export @@ -46,7 +46,8 @@ export type GdalMetaDataListTypeEnum = typeof GdalMetaDataListTypeEnum[keyof typ /** * Check if a given object implements the GdalMetaDataList interface. */ -export declare function instanceOfGdalMetaDataList(value: object): boolean; +export declare function instanceOfGdalMetaDataList(value: object): value is GdalMetaDataList; export declare function GdalMetaDataListFromJSON(json: any): GdalMetaDataList; export declare function GdalMetaDataListFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetaDataList; -export declare function GdalMetaDataListToJSON(value?: GdalMetaDataList | null): any; +export declare function GdalMetaDataListToJSON(json: any): GdalMetaDataList; +export declare function GdalMetaDataListToJSONTyped(value?: GdalMetaDataList | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/GdalMetaDataList.js b/typescript/dist/esm/models/GdalMetaDataList.js index 331740d0..d9f205ef 100644 --- a/typescript/dist/esm/models/GdalMetaDataList.js +++ b/typescript/dist/esm/models/GdalMetaDataList.js @@ -11,8 +11,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { GdalLoadingInfoTemporalSliceFromJSON, GdalLoadingInfoTemporalSliceToJSON, } from './GdalLoadingInfoTemporalSlice'; import { RasterResultDescriptorFromJSON, RasterResultDescriptorToJSON, } from './RasterResultDescriptor'; +import { GdalLoadingInfoTemporalSliceFromJSON, GdalLoadingInfoTemporalSliceToJSON, } from './GdalLoadingInfoTemporalSlice'; /** * @export */ @@ -23,17 +23,19 @@ export const GdalMetaDataListTypeEnum = { * Check if a given object implements the GdalMetaDataList interface. */ export function instanceOfGdalMetaDataList(value) { - let isInstance = true; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('params' in value) || value['params'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function GdalMetaDataListFromJSON(json) { return GdalMetaDataListFromJSONTyped(json, false); } export function GdalMetaDataListFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,16 +44,16 @@ export function GdalMetaDataListFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function GdalMetaDataListToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalMetaDataListToJSON(json) { + return GdalMetaDataListToJSONTyped(json, false); +} +export function GdalMetaDataListToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'params': (value.params.map(GdalLoadingInfoTemporalSliceToJSON)), - 'resultDescriptor': RasterResultDescriptorToJSON(value.resultDescriptor), - 'type': value.type, + 'params': (value['params'].map(GdalLoadingInfoTemporalSliceToJSON)), + 'resultDescriptor': RasterResultDescriptorToJSON(value['resultDescriptor']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/GdalMetaDataRegular.d.ts b/typescript/dist/esm/models/GdalMetaDataRegular.d.ts index 04e5f784..f91ecd4f 100644 --- a/typescript/dist/esm/models/GdalMetaDataRegular.d.ts +++ b/typescript/dist/esm/models/GdalMetaDataRegular.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { GdalDatasetParameters } from './GdalDatasetParameters'; +import type { TimeStep } from './TimeStep'; +import type { TimeInterval } from './TimeInterval'; import type { GdalSourceTimePlaceholder } from './GdalSourceTimePlaceholder'; import type { RasterResultDescriptor } from './RasterResultDescriptor'; -import type { TimeInterval } from './TimeInterval'; -import type { TimeStep } from './TimeStep'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; /** * * @export @@ -75,7 +75,8 @@ export type GdalMetaDataRegularTypeEnum = typeof GdalMetaDataRegularTypeEnum[key /** * Check if a given object implements the GdalMetaDataRegular interface. */ -export declare function instanceOfGdalMetaDataRegular(value: object): boolean; +export declare function instanceOfGdalMetaDataRegular(value: object): value is GdalMetaDataRegular; export declare function GdalMetaDataRegularFromJSON(json: any): GdalMetaDataRegular; export declare function GdalMetaDataRegularFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetaDataRegular; -export declare function GdalMetaDataRegularToJSON(value?: GdalMetaDataRegular | null): any; +export declare function GdalMetaDataRegularToJSON(json: any): GdalMetaDataRegular; +export declare function GdalMetaDataRegularToJSONTyped(value?: GdalMetaDataRegular | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/GdalMetaDataRegular.js b/typescript/dist/esm/models/GdalMetaDataRegular.js index 7f1de9c9..0645084d 100644 --- a/typescript/dist/esm/models/GdalMetaDataRegular.js +++ b/typescript/dist/esm/models/GdalMetaDataRegular.js @@ -11,12 +11,12 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import { GdalDatasetParametersFromJSON, GdalDatasetParametersToJSON, } from './GdalDatasetParameters'; +import { mapValues } from '../runtime'; +import { TimeStepFromJSON, TimeStepToJSON, } from './TimeStep'; +import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; import { GdalSourceTimePlaceholderFromJSON, GdalSourceTimePlaceholderToJSON, } from './GdalSourceTimePlaceholder'; import { RasterResultDescriptorFromJSON, RasterResultDescriptorToJSON, } from './RasterResultDescriptor'; -import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; -import { TimeStepFromJSON, TimeStepToJSON, } from './TimeStep'; +import { GdalDatasetParametersFromJSON, GdalDatasetParametersToJSON, } from './GdalDatasetParameters'; /** * @export */ @@ -27,24 +27,29 @@ export const GdalMetaDataRegularTypeEnum = { * Check if a given object implements the GdalMetaDataRegular interface. */ export function instanceOfGdalMetaDataRegular(value) { - let isInstance = true; - isInstance = isInstance && "dataTime" in value; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "step" in value; - isInstance = isInstance && "timePlaceholders" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('dataTime' in value) || value['dataTime'] === undefined) + return false; + if (!('params' in value) || value['params'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('step' in value) || value['step'] === undefined) + return false; + if (!('timePlaceholders' in value) || value['timePlaceholders'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function GdalMetaDataRegularFromJSON(json) { return GdalMetaDataRegularFromJSONTyped(json, false); } export function GdalMetaDataRegularFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'cacheTtl': !exists(json, 'cacheTtl') ? undefined : json['cacheTtl'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], 'dataTime': TimeIntervalFromJSON(json['dataTime']), 'params': GdalDatasetParametersFromJSON(json['params']), 'resultDescriptor': RasterResultDescriptorFromJSON(json['resultDescriptor']), @@ -53,20 +58,20 @@ export function GdalMetaDataRegularFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function GdalMetaDataRegularToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalMetaDataRegularToJSON(json) { + return GdalMetaDataRegularToJSONTyped(json, false); +} +export function GdalMetaDataRegularToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'cacheTtl': value.cacheTtl, - 'dataTime': TimeIntervalToJSON(value.dataTime), - 'params': GdalDatasetParametersToJSON(value.params), - 'resultDescriptor': RasterResultDescriptorToJSON(value.resultDescriptor), - 'step': TimeStepToJSON(value.step), - 'timePlaceholders': (mapValues(value.timePlaceholders, GdalSourceTimePlaceholderToJSON)), - 'type': value.type, + 'cacheTtl': value['cacheTtl'], + 'dataTime': TimeIntervalToJSON(value['dataTime']), + 'params': GdalDatasetParametersToJSON(value['params']), + 'resultDescriptor': RasterResultDescriptorToJSON(value['resultDescriptor']), + 'step': TimeStepToJSON(value['step']), + 'timePlaceholders': (mapValues(value['timePlaceholders'], GdalSourceTimePlaceholderToJSON)), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/GdalMetaDataStatic.d.ts b/typescript/dist/esm/models/GdalMetaDataStatic.d.ts index d06ae93e..735d01af 100644 --- a/typescript/dist/esm/models/GdalMetaDataStatic.d.ts +++ b/typescript/dist/esm/models/GdalMetaDataStatic.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { GdalDatasetParameters } from './GdalDatasetParameters'; -import type { RasterResultDescriptor } from './RasterResultDescriptor'; import type { TimeInterval } from './TimeInterval'; +import type { RasterResultDescriptor } from './RasterResultDescriptor'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; /** * * @export @@ -59,7 +59,8 @@ export type GdalMetaDataStaticTypeEnum = typeof GdalMetaDataStaticTypeEnum[keyof /** * Check if a given object implements the GdalMetaDataStatic interface. */ -export declare function instanceOfGdalMetaDataStatic(value: object): boolean; +export declare function instanceOfGdalMetaDataStatic(value: object): value is GdalMetaDataStatic; export declare function GdalMetaDataStaticFromJSON(json: any): GdalMetaDataStatic; export declare function GdalMetaDataStaticFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetaDataStatic; -export declare function GdalMetaDataStaticToJSON(value?: GdalMetaDataStatic | null): any; +export declare function GdalMetaDataStaticToJSON(json: any): GdalMetaDataStatic; +export declare function GdalMetaDataStaticToJSONTyped(value?: GdalMetaDataStatic | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/GdalMetaDataStatic.js b/typescript/dist/esm/models/GdalMetaDataStatic.js index 1f2007c4..0b5d73ca 100644 --- a/typescript/dist/esm/models/GdalMetaDataStatic.js +++ b/typescript/dist/esm/models/GdalMetaDataStatic.js @@ -11,10 +11,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { GdalDatasetParametersFromJSON, GdalDatasetParametersToJSON, } from './GdalDatasetParameters'; -import { RasterResultDescriptorFromJSON, RasterResultDescriptorToJSON, } from './RasterResultDescriptor'; import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; +import { RasterResultDescriptorFromJSON, RasterResultDescriptorToJSON, } from './RasterResultDescriptor'; +import { GdalDatasetParametersFromJSON, GdalDatasetParametersToJSON, } from './GdalDatasetParameters'; /** * @export */ @@ -25,39 +24,41 @@ export const GdalMetaDataStaticTypeEnum = { * Check if a given object implements the GdalMetaDataStatic interface. */ export function instanceOfGdalMetaDataStatic(value) { - let isInstance = true; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('params' in value) || value['params'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function GdalMetaDataStaticFromJSON(json) { return GdalMetaDataStaticFromJSONTyped(json, false); } export function GdalMetaDataStaticFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'cacheTtl': !exists(json, 'cacheTtl') ? undefined : json['cacheTtl'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], 'params': GdalDatasetParametersFromJSON(json['params']), 'resultDescriptor': RasterResultDescriptorFromJSON(json['resultDescriptor']), - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), 'type': json['type'], }; } -export function GdalMetaDataStaticToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalMetaDataStaticToJSON(json) { + return GdalMetaDataStaticToJSONTyped(json, false); +} +export function GdalMetaDataStaticToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'cacheTtl': value.cacheTtl, - 'params': GdalDatasetParametersToJSON(value.params), - 'resultDescriptor': RasterResultDescriptorToJSON(value.resultDescriptor), - 'time': TimeIntervalToJSON(value.time), - 'type': value.type, + 'cacheTtl': value['cacheTtl'], + 'params': GdalDatasetParametersToJSON(value['params']), + 'resultDescriptor': RasterResultDescriptorToJSON(value['resultDescriptor']), + 'time': TimeIntervalToJSON(value['time']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/GdalMetadataMapping.d.ts b/typescript/dist/esm/models/GdalMetadataMapping.d.ts index 3961e501..657aae9f 100644 --- a/typescript/dist/esm/models/GdalMetadataMapping.d.ts +++ b/typescript/dist/esm/models/GdalMetadataMapping.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { RasterPropertiesEntryType } from './RasterPropertiesEntryType'; import type { RasterPropertiesKey } from './RasterPropertiesKey'; +import type { RasterPropertiesEntryType } from './RasterPropertiesEntryType'; /** * * @export @@ -39,7 +39,8 @@ export interface GdalMetadataMapping { /** * Check if a given object implements the GdalMetadataMapping interface. */ -export declare function instanceOfGdalMetadataMapping(value: object): boolean; +export declare function instanceOfGdalMetadataMapping(value: object): value is GdalMetadataMapping; export declare function GdalMetadataMappingFromJSON(json: any): GdalMetadataMapping; export declare function GdalMetadataMappingFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetadataMapping; -export declare function GdalMetadataMappingToJSON(value?: GdalMetadataMapping | null): any; +export declare function GdalMetadataMappingToJSON(json: any): GdalMetadataMapping; +export declare function GdalMetadataMappingToJSONTyped(value?: GdalMetadataMapping | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/GdalMetadataMapping.js b/typescript/dist/esm/models/GdalMetadataMapping.js index 2a7dac15..dc0824a0 100644 --- a/typescript/dist/esm/models/GdalMetadataMapping.js +++ b/typescript/dist/esm/models/GdalMetadataMapping.js @@ -11,23 +11,25 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { RasterPropertiesEntryTypeFromJSON, RasterPropertiesEntryTypeToJSON, } from './RasterPropertiesEntryType'; import { RasterPropertiesKeyFromJSON, RasterPropertiesKeyToJSON, } from './RasterPropertiesKey'; +import { RasterPropertiesEntryTypeFromJSON, RasterPropertiesEntryTypeToJSON, } from './RasterPropertiesEntryType'; /** * Check if a given object implements the GdalMetadataMapping interface. */ export function instanceOfGdalMetadataMapping(value) { - let isInstance = true; - isInstance = isInstance && "sourceKey" in value; - isInstance = isInstance && "targetKey" in value; - isInstance = isInstance && "targetType" in value; - return isInstance; + if (!('sourceKey' in value) || value['sourceKey'] === undefined) + return false; + if (!('targetKey' in value) || value['targetKey'] === undefined) + return false; + if (!('targetType' in value) || value['targetType'] === undefined) + return false; + return true; } export function GdalMetadataMappingFromJSON(json) { return GdalMetadataMappingFromJSONTyped(json, false); } export function GdalMetadataMappingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -36,16 +38,16 @@ export function GdalMetadataMappingFromJSONTyped(json, ignoreDiscriminator) { 'targetType': RasterPropertiesEntryTypeFromJSON(json['target_type']), }; } -export function GdalMetadataMappingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalMetadataMappingToJSON(json) { + return GdalMetadataMappingToJSONTyped(json, false); +} +export function GdalMetadataMappingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'source_key': RasterPropertiesKeyToJSON(value.sourceKey), - 'target_key': RasterPropertiesKeyToJSON(value.targetKey), - 'target_type': RasterPropertiesEntryTypeToJSON(value.targetType), + 'source_key': RasterPropertiesKeyToJSON(value['sourceKey']), + 'target_key': RasterPropertiesKeyToJSON(value['targetKey']), + 'target_type': RasterPropertiesEntryTypeToJSON(value['targetType']), }; } diff --git a/typescript/dist/esm/models/GdalMetadataNetCdfCf.d.ts b/typescript/dist/esm/models/GdalMetadataNetCdfCf.d.ts index cd177621..2105357e 100644 --- a/typescript/dist/esm/models/GdalMetadataNetCdfCf.d.ts +++ b/typescript/dist/esm/models/GdalMetadataNetCdfCf.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { GdalDatasetParameters } from './GdalDatasetParameters'; -import type { RasterResultDescriptor } from './RasterResultDescriptor'; import type { TimeStep } from './TimeStep'; +import type { RasterResultDescriptor } from './RasterResultDescriptor'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; /** * Meta data for 4D `NetCDF` CF datasets * @export @@ -78,7 +78,8 @@ export type GdalMetadataNetCdfCfTypeEnum = typeof GdalMetadataNetCdfCfTypeEnum[k /** * Check if a given object implements the GdalMetadataNetCdfCf interface. */ -export declare function instanceOfGdalMetadataNetCdfCf(value: object): boolean; +export declare function instanceOfGdalMetadataNetCdfCf(value: object): value is GdalMetadataNetCdfCf; export declare function GdalMetadataNetCdfCfFromJSON(json: any): GdalMetadataNetCdfCf; export declare function GdalMetadataNetCdfCfFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetadataNetCdfCf; -export declare function GdalMetadataNetCdfCfToJSON(value?: GdalMetadataNetCdfCf | null): any; +export declare function GdalMetadataNetCdfCfToJSON(json: any): GdalMetadataNetCdfCf; +export declare function GdalMetadataNetCdfCfToJSONTyped(value?: GdalMetadataNetCdfCf | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/GdalMetadataNetCdfCf.js b/typescript/dist/esm/models/GdalMetadataNetCdfCf.js index c88588ff..aefd5a98 100644 --- a/typescript/dist/esm/models/GdalMetadataNetCdfCf.js +++ b/typescript/dist/esm/models/GdalMetadataNetCdfCf.js @@ -11,10 +11,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { GdalDatasetParametersFromJSON, GdalDatasetParametersToJSON, } from './GdalDatasetParameters'; -import { RasterResultDescriptorFromJSON, RasterResultDescriptorToJSON, } from './RasterResultDescriptor'; import { TimeStepFromJSON, TimeStepToJSON, } from './TimeStep'; +import { RasterResultDescriptorFromJSON, RasterResultDescriptorToJSON, } from './RasterResultDescriptor'; +import { GdalDatasetParametersFromJSON, GdalDatasetParametersToJSON, } from './GdalDatasetParameters'; /** * @export */ @@ -25,26 +24,32 @@ export const GdalMetadataNetCdfCfTypeEnum = { * Check if a given object implements the GdalMetadataNetCdfCf interface. */ export function instanceOfGdalMetadataNetCdfCf(value) { - let isInstance = true; - isInstance = isInstance && "bandOffset" in value; - isInstance = isInstance && "end" in value; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "start" in value; - isInstance = isInstance && "step" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('bandOffset' in value) || value['bandOffset'] === undefined) + return false; + if (!('end' in value) || value['end'] === undefined) + return false; + if (!('params' in value) || value['params'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('start' in value) || value['start'] === undefined) + return false; + if (!('step' in value) || value['step'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function GdalMetadataNetCdfCfFromJSON(json) { return GdalMetadataNetCdfCfFromJSONTyped(json, false); } export function GdalMetadataNetCdfCfFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bandOffset': json['bandOffset'], - 'cacheTtl': !exists(json, 'cacheTtl') ? undefined : json['cacheTtl'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], 'end': json['end'], 'params': GdalDatasetParametersFromJSON(json['params']), 'resultDescriptor': RasterResultDescriptorFromJSON(json['resultDescriptor']), @@ -53,21 +58,21 @@ export function GdalMetadataNetCdfCfFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function GdalMetadataNetCdfCfToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalMetadataNetCdfCfToJSON(json) { + return GdalMetadataNetCdfCfToJSONTyped(json, false); +} +export function GdalMetadataNetCdfCfToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bandOffset': value.bandOffset, - 'cacheTtl': value.cacheTtl, - 'end': value.end, - 'params': GdalDatasetParametersToJSON(value.params), - 'resultDescriptor': RasterResultDescriptorToJSON(value.resultDescriptor), - 'start': value.start, - 'step': TimeStepToJSON(value.step), - 'type': value.type, + 'bandOffset': value['bandOffset'], + 'cacheTtl': value['cacheTtl'], + 'end': value['end'], + 'params': GdalDatasetParametersToJSON(value['params']), + 'resultDescriptor': RasterResultDescriptorToJSON(value['resultDescriptor']), + 'start': value['start'], + 'step': TimeStepToJSON(value['step']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/GdalSourceTimePlaceholder.d.ts b/typescript/dist/esm/models/GdalSourceTimePlaceholder.d.ts index 15214023..d8e9be5b 100644 --- a/typescript/dist/esm/models/GdalSourceTimePlaceholder.d.ts +++ b/typescript/dist/esm/models/GdalSourceTimePlaceholder.d.ts @@ -32,7 +32,8 @@ export interface GdalSourceTimePlaceholder { /** * Check if a given object implements the GdalSourceTimePlaceholder interface. */ -export declare function instanceOfGdalSourceTimePlaceholder(value: object): boolean; +export declare function instanceOfGdalSourceTimePlaceholder(value: object): value is GdalSourceTimePlaceholder; export declare function GdalSourceTimePlaceholderFromJSON(json: any): GdalSourceTimePlaceholder; export declare function GdalSourceTimePlaceholderFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalSourceTimePlaceholder; -export declare function GdalSourceTimePlaceholderToJSON(value?: GdalSourceTimePlaceholder | null): any; +export declare function GdalSourceTimePlaceholderToJSON(json: any): GdalSourceTimePlaceholder; +export declare function GdalSourceTimePlaceholderToJSONTyped(value?: GdalSourceTimePlaceholder | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/GdalSourceTimePlaceholder.js b/typescript/dist/esm/models/GdalSourceTimePlaceholder.js index 721a7e19..f42b5240 100644 --- a/typescript/dist/esm/models/GdalSourceTimePlaceholder.js +++ b/typescript/dist/esm/models/GdalSourceTimePlaceholder.js @@ -16,16 +16,17 @@ import { TimeReferenceFromJSON, TimeReferenceToJSON, } from './TimeReference'; * Check if a given object implements the GdalSourceTimePlaceholder interface. */ export function instanceOfGdalSourceTimePlaceholder(value) { - let isInstance = true; - isInstance = isInstance && "format" in value; - isInstance = isInstance && "reference" in value; - return isInstance; + if (!('format' in value) || value['format'] === undefined) + return false; + if (!('reference' in value) || value['reference'] === undefined) + return false; + return true; } export function GdalSourceTimePlaceholderFromJSON(json) { return GdalSourceTimePlaceholderFromJSONTyped(json, false); } export function GdalSourceTimePlaceholderFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -33,15 +34,15 @@ export function GdalSourceTimePlaceholderFromJSONTyped(json, ignoreDiscriminator 'reference': TimeReferenceFromJSON(json['reference']), }; } -export function GdalSourceTimePlaceholderToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalSourceTimePlaceholderToJSON(json) { + return GdalSourceTimePlaceholderToJSONTyped(json, false); +} +export function GdalSourceTimePlaceholderToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'format': value.format, - 'reference': TimeReferenceToJSON(value.reference), + 'format': value['format'], + 'reference': TimeReferenceToJSON(value['reference']), }; } diff --git a/typescript/dist/esm/models/GeoJson.d.ts b/typescript/dist/esm/models/GeoJson.d.ts index 004ba2d1..993ad8c6 100644 --- a/typescript/dist/esm/models/GeoJson.d.ts +++ b/typescript/dist/esm/models/GeoJson.d.ts @@ -32,7 +32,8 @@ export interface GeoJson { /** * Check if a given object implements the GeoJson interface. */ -export declare function instanceOfGeoJson(value: object): boolean; +export declare function instanceOfGeoJson(value: object): value is GeoJson; export declare function GeoJsonFromJSON(json: any): GeoJson; export declare function GeoJsonFromJSONTyped(json: any, ignoreDiscriminator: boolean): GeoJson; -export declare function GeoJsonToJSON(value?: GeoJson | null): any; +export declare function GeoJsonToJSON(json: any): GeoJson; +export declare function GeoJsonToJSONTyped(value?: GeoJson | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/GeoJson.js b/typescript/dist/esm/models/GeoJson.js index 1a37daa9..7fafd844 100644 --- a/typescript/dist/esm/models/GeoJson.js +++ b/typescript/dist/esm/models/GeoJson.js @@ -16,16 +16,17 @@ import { CollectionTypeFromJSON, CollectionTypeToJSON, } from './CollectionType' * Check if a given object implements the GeoJson interface. */ export function instanceOfGeoJson(value) { - let isInstance = true; - isInstance = isInstance && "features" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('features' in value) || value['features'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function GeoJsonFromJSON(json) { return GeoJsonFromJSONTyped(json, false); } export function GeoJsonFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -33,15 +34,15 @@ export function GeoJsonFromJSONTyped(json, ignoreDiscriminator) { 'type': CollectionTypeFromJSON(json['type']), }; } -export function GeoJsonToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GeoJsonToJSON(json) { + return GeoJsonToJSONTyped(json, false); +} +export function GeoJsonToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'features': value.features, - 'type': CollectionTypeToJSON(value.type), + 'features': value['features'], + 'type': CollectionTypeToJSON(value['type']), }; } diff --git a/typescript/dist/esm/models/GetCapabilitiesFormat.d.ts b/typescript/dist/esm/models/GetCapabilitiesFormat.d.ts index 95b0b23f..fd1027eb 100644 --- a/typescript/dist/esm/models/GetCapabilitiesFormat.d.ts +++ b/typescript/dist/esm/models/GetCapabilitiesFormat.d.ts @@ -17,6 +17,8 @@ export declare const GetCapabilitiesFormat: { readonly TextXml: "text/xml"; }; export type GetCapabilitiesFormat = typeof GetCapabilitiesFormat[keyof typeof GetCapabilitiesFormat]; +export declare function instanceOfGetCapabilitiesFormat(value: any): boolean; export declare function GetCapabilitiesFormatFromJSON(json: any): GetCapabilitiesFormat; export declare function GetCapabilitiesFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetCapabilitiesFormat; export declare function GetCapabilitiesFormatToJSON(value?: GetCapabilitiesFormat | null): any; +export declare function GetCapabilitiesFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCapabilitiesFormat; diff --git a/typescript/dist/esm/models/GetCapabilitiesFormat.js b/typescript/dist/esm/models/GetCapabilitiesFormat.js index aa564537..2fffd11e 100644 --- a/typescript/dist/esm/models/GetCapabilitiesFormat.js +++ b/typescript/dist/esm/models/GetCapabilitiesFormat.js @@ -18,6 +18,16 @@ export const GetCapabilitiesFormat = { TextXml: 'text/xml' }; +export function instanceOfGetCapabilitiesFormat(value) { + for (const key in GetCapabilitiesFormat) { + if (Object.prototype.hasOwnProperty.call(GetCapabilitiesFormat, key)) { + if (GetCapabilitiesFormat[key] === value) { + return true; + } + } + } + return false; +} export function GetCapabilitiesFormatFromJSON(json) { return GetCapabilitiesFormatFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function GetCapabilitiesFormatFromJSONTyped(json, ignoreDiscriminator) { export function GetCapabilitiesFormatToJSON(value) { return value; } +export function GetCapabilitiesFormatToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/GetCapabilitiesRequest.d.ts b/typescript/dist/esm/models/GetCapabilitiesRequest.d.ts index c7df069d..4c06be57 100644 --- a/typescript/dist/esm/models/GetCapabilitiesRequest.d.ts +++ b/typescript/dist/esm/models/GetCapabilitiesRequest.d.ts @@ -17,6 +17,8 @@ export declare const GetCapabilitiesRequest: { readonly GetCapabilities: "GetCapabilities"; }; export type GetCapabilitiesRequest = typeof GetCapabilitiesRequest[keyof typeof GetCapabilitiesRequest]; +export declare function instanceOfGetCapabilitiesRequest(value: any): boolean; export declare function GetCapabilitiesRequestFromJSON(json: any): GetCapabilitiesRequest; export declare function GetCapabilitiesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetCapabilitiesRequest; export declare function GetCapabilitiesRequestToJSON(value?: GetCapabilitiesRequest | null): any; +export declare function GetCapabilitiesRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCapabilitiesRequest; diff --git a/typescript/dist/esm/models/GetCapabilitiesRequest.js b/typescript/dist/esm/models/GetCapabilitiesRequest.js index 1fdb1008..b43cfef4 100644 --- a/typescript/dist/esm/models/GetCapabilitiesRequest.js +++ b/typescript/dist/esm/models/GetCapabilitiesRequest.js @@ -18,6 +18,16 @@ export const GetCapabilitiesRequest = { GetCapabilities: 'GetCapabilities' }; +export function instanceOfGetCapabilitiesRequest(value) { + for (const key in GetCapabilitiesRequest) { + if (Object.prototype.hasOwnProperty.call(GetCapabilitiesRequest, key)) { + if (GetCapabilitiesRequest[key] === value) { + return true; + } + } + } + return false; +} export function GetCapabilitiesRequestFromJSON(json) { return GetCapabilitiesRequestFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function GetCapabilitiesRequestFromJSONTyped(json, ignoreDiscriminator) { export function GetCapabilitiesRequestToJSON(value) { return value; } +export function GetCapabilitiesRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/GetCoverageFormat.d.ts b/typescript/dist/esm/models/GetCoverageFormat.d.ts index dffbb0e8..f4b2f64d 100644 --- a/typescript/dist/esm/models/GetCoverageFormat.d.ts +++ b/typescript/dist/esm/models/GetCoverageFormat.d.ts @@ -17,6 +17,8 @@ export declare const GetCoverageFormat: { readonly ImageTiff: "image/tiff"; }; export type GetCoverageFormat = typeof GetCoverageFormat[keyof typeof GetCoverageFormat]; +export declare function instanceOfGetCoverageFormat(value: any): boolean; export declare function GetCoverageFormatFromJSON(json: any): GetCoverageFormat; export declare function GetCoverageFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetCoverageFormat; export declare function GetCoverageFormatToJSON(value?: GetCoverageFormat | null): any; +export declare function GetCoverageFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCoverageFormat; diff --git a/typescript/dist/esm/models/GetCoverageFormat.js b/typescript/dist/esm/models/GetCoverageFormat.js index f30260a8..55066e1d 100644 --- a/typescript/dist/esm/models/GetCoverageFormat.js +++ b/typescript/dist/esm/models/GetCoverageFormat.js @@ -18,6 +18,16 @@ export const GetCoverageFormat = { ImageTiff: 'image/tiff' }; +export function instanceOfGetCoverageFormat(value) { + for (const key in GetCoverageFormat) { + if (Object.prototype.hasOwnProperty.call(GetCoverageFormat, key)) { + if (GetCoverageFormat[key] === value) { + return true; + } + } + } + return false; +} export function GetCoverageFormatFromJSON(json) { return GetCoverageFormatFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function GetCoverageFormatFromJSONTyped(json, ignoreDiscriminator) { export function GetCoverageFormatToJSON(value) { return value; } +export function GetCoverageFormatToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/GetCoverageRequest.d.ts b/typescript/dist/esm/models/GetCoverageRequest.d.ts index 34801895..14c7eb33 100644 --- a/typescript/dist/esm/models/GetCoverageRequest.d.ts +++ b/typescript/dist/esm/models/GetCoverageRequest.d.ts @@ -17,6 +17,8 @@ export declare const GetCoverageRequest: { readonly GetCoverage: "GetCoverage"; }; export type GetCoverageRequest = typeof GetCoverageRequest[keyof typeof GetCoverageRequest]; +export declare function instanceOfGetCoverageRequest(value: any): boolean; export declare function GetCoverageRequestFromJSON(json: any): GetCoverageRequest; export declare function GetCoverageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetCoverageRequest; export declare function GetCoverageRequestToJSON(value?: GetCoverageRequest | null): any; +export declare function GetCoverageRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCoverageRequest; diff --git a/typescript/dist/esm/models/GetCoverageRequest.js b/typescript/dist/esm/models/GetCoverageRequest.js index ac570e03..65636a12 100644 --- a/typescript/dist/esm/models/GetCoverageRequest.js +++ b/typescript/dist/esm/models/GetCoverageRequest.js @@ -18,6 +18,16 @@ export const GetCoverageRequest = { GetCoverage: 'GetCoverage' }; +export function instanceOfGetCoverageRequest(value) { + for (const key in GetCoverageRequest) { + if (Object.prototype.hasOwnProperty.call(GetCoverageRequest, key)) { + if (GetCoverageRequest[key] === value) { + return true; + } + } + } + return false; +} export function GetCoverageRequestFromJSON(json) { return GetCoverageRequestFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function GetCoverageRequestFromJSONTyped(json, ignoreDiscriminator) { export function GetCoverageRequestToJSON(value) { return value; } +export function GetCoverageRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/GetFeatureRequest.d.ts b/typescript/dist/esm/models/GetFeatureRequest.d.ts index 3118dc0d..b3543aba 100644 --- a/typescript/dist/esm/models/GetFeatureRequest.d.ts +++ b/typescript/dist/esm/models/GetFeatureRequest.d.ts @@ -17,6 +17,8 @@ export declare const GetFeatureRequest: { readonly GetFeature: "GetFeature"; }; export type GetFeatureRequest = typeof GetFeatureRequest[keyof typeof GetFeatureRequest]; +export declare function instanceOfGetFeatureRequest(value: any): boolean; export declare function GetFeatureRequestFromJSON(json: any): GetFeatureRequest; export declare function GetFeatureRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetFeatureRequest; export declare function GetFeatureRequestToJSON(value?: GetFeatureRequest | null): any; +export declare function GetFeatureRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetFeatureRequest; diff --git a/typescript/dist/esm/models/GetFeatureRequest.js b/typescript/dist/esm/models/GetFeatureRequest.js index 54223538..17218364 100644 --- a/typescript/dist/esm/models/GetFeatureRequest.js +++ b/typescript/dist/esm/models/GetFeatureRequest.js @@ -18,6 +18,16 @@ export const GetFeatureRequest = { GetFeature: 'GetFeature' }; +export function instanceOfGetFeatureRequest(value) { + for (const key in GetFeatureRequest) { + if (Object.prototype.hasOwnProperty.call(GetFeatureRequest, key)) { + if (GetFeatureRequest[key] === value) { + return true; + } + } + } + return false; +} export function GetFeatureRequestFromJSON(json) { return GetFeatureRequestFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function GetFeatureRequestFromJSONTyped(json, ignoreDiscriminator) { export function GetFeatureRequestToJSON(value) { return value; } +export function GetFeatureRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/GetLegendGraphicRequest.d.ts b/typescript/dist/esm/models/GetLegendGraphicRequest.d.ts index ee086d0f..90ff104d 100644 --- a/typescript/dist/esm/models/GetLegendGraphicRequest.d.ts +++ b/typescript/dist/esm/models/GetLegendGraphicRequest.d.ts @@ -17,6 +17,8 @@ export declare const GetLegendGraphicRequest: { readonly GetLegendGraphic: "GetLegendGraphic"; }; export type GetLegendGraphicRequest = typeof GetLegendGraphicRequest[keyof typeof GetLegendGraphicRequest]; +export declare function instanceOfGetLegendGraphicRequest(value: any): boolean; export declare function GetLegendGraphicRequestFromJSON(json: any): GetLegendGraphicRequest; export declare function GetLegendGraphicRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetLegendGraphicRequest; export declare function GetLegendGraphicRequestToJSON(value?: GetLegendGraphicRequest | null): any; +export declare function GetLegendGraphicRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetLegendGraphicRequest; diff --git a/typescript/dist/esm/models/GetLegendGraphicRequest.js b/typescript/dist/esm/models/GetLegendGraphicRequest.js index 13069954..bc8d123f 100644 --- a/typescript/dist/esm/models/GetLegendGraphicRequest.js +++ b/typescript/dist/esm/models/GetLegendGraphicRequest.js @@ -18,6 +18,16 @@ export const GetLegendGraphicRequest = { GetLegendGraphic: 'GetLegendGraphic' }; +export function instanceOfGetLegendGraphicRequest(value) { + for (const key in GetLegendGraphicRequest) { + if (Object.prototype.hasOwnProperty.call(GetLegendGraphicRequest, key)) { + if (GetLegendGraphicRequest[key] === value) { + return true; + } + } + } + return false; +} export function GetLegendGraphicRequestFromJSON(json) { return GetLegendGraphicRequestFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function GetLegendGraphicRequestFromJSONTyped(json, ignoreDiscriminator) export function GetLegendGraphicRequestToJSON(value) { return value; } +export function GetLegendGraphicRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/GetMapExceptionFormat.d.ts b/typescript/dist/esm/models/GetMapExceptionFormat.d.ts index bec87079..c792af4c 100644 --- a/typescript/dist/esm/models/GetMapExceptionFormat.d.ts +++ b/typescript/dist/esm/models/GetMapExceptionFormat.d.ts @@ -18,6 +18,8 @@ export declare const GetMapExceptionFormat: { readonly Json: "JSON"; }; export type GetMapExceptionFormat = typeof GetMapExceptionFormat[keyof typeof GetMapExceptionFormat]; +export declare function instanceOfGetMapExceptionFormat(value: any): boolean; export declare function GetMapExceptionFormatFromJSON(json: any): GetMapExceptionFormat; export declare function GetMapExceptionFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetMapExceptionFormat; export declare function GetMapExceptionFormatToJSON(value?: GetMapExceptionFormat | null): any; +export declare function GetMapExceptionFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetMapExceptionFormat; diff --git a/typescript/dist/esm/models/GetMapExceptionFormat.js b/typescript/dist/esm/models/GetMapExceptionFormat.js index 34368c9b..b1b7eeb0 100644 --- a/typescript/dist/esm/models/GetMapExceptionFormat.js +++ b/typescript/dist/esm/models/GetMapExceptionFormat.js @@ -19,6 +19,16 @@ export const GetMapExceptionFormat = { Xml: 'XML', Json: 'JSON' }; +export function instanceOfGetMapExceptionFormat(value) { + for (const key in GetMapExceptionFormat) { + if (Object.prototype.hasOwnProperty.call(GetMapExceptionFormat, key)) { + if (GetMapExceptionFormat[key] === value) { + return true; + } + } + } + return false; +} export function GetMapExceptionFormatFromJSON(json) { return GetMapExceptionFormatFromJSONTyped(json, false); } @@ -28,3 +38,6 @@ export function GetMapExceptionFormatFromJSONTyped(json, ignoreDiscriminator) { export function GetMapExceptionFormatToJSON(value) { return value; } +export function GetMapExceptionFormatToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/GetMapFormat.d.ts b/typescript/dist/esm/models/GetMapFormat.d.ts index ccbff908..929d5f9a 100644 --- a/typescript/dist/esm/models/GetMapFormat.d.ts +++ b/typescript/dist/esm/models/GetMapFormat.d.ts @@ -17,6 +17,8 @@ export declare const GetMapFormat: { readonly ImagePng: "image/png"; }; export type GetMapFormat = typeof GetMapFormat[keyof typeof GetMapFormat]; +export declare function instanceOfGetMapFormat(value: any): boolean; export declare function GetMapFormatFromJSON(json: any): GetMapFormat; export declare function GetMapFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetMapFormat; export declare function GetMapFormatToJSON(value?: GetMapFormat | null): any; +export declare function GetMapFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetMapFormat; diff --git a/typescript/dist/esm/models/GetMapFormat.js b/typescript/dist/esm/models/GetMapFormat.js index 1c1bff3e..95b34fc5 100644 --- a/typescript/dist/esm/models/GetMapFormat.js +++ b/typescript/dist/esm/models/GetMapFormat.js @@ -18,6 +18,16 @@ export const GetMapFormat = { ImagePng: 'image/png' }; +export function instanceOfGetMapFormat(value) { + for (const key in GetMapFormat) { + if (Object.prototype.hasOwnProperty.call(GetMapFormat, key)) { + if (GetMapFormat[key] === value) { + return true; + } + } + } + return false; +} export function GetMapFormatFromJSON(json) { return GetMapFormatFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function GetMapFormatFromJSONTyped(json, ignoreDiscriminator) { export function GetMapFormatToJSON(value) { return value; } +export function GetMapFormatToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/GetMapRequest.d.ts b/typescript/dist/esm/models/GetMapRequest.d.ts index afd0bf0b..f35fc7ab 100644 --- a/typescript/dist/esm/models/GetMapRequest.d.ts +++ b/typescript/dist/esm/models/GetMapRequest.d.ts @@ -17,6 +17,8 @@ export declare const GetMapRequest: { readonly GetMap: "GetMap"; }; export type GetMapRequest = typeof GetMapRequest[keyof typeof GetMapRequest]; +export declare function instanceOfGetMapRequest(value: any): boolean; export declare function GetMapRequestFromJSON(json: any): GetMapRequest; export declare function GetMapRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetMapRequest; export declare function GetMapRequestToJSON(value?: GetMapRequest | null): any; +export declare function GetMapRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetMapRequest; diff --git a/typescript/dist/esm/models/GetMapRequest.js b/typescript/dist/esm/models/GetMapRequest.js index 2377ff7e..46e0dfaf 100644 --- a/typescript/dist/esm/models/GetMapRequest.js +++ b/typescript/dist/esm/models/GetMapRequest.js @@ -18,6 +18,16 @@ export const GetMapRequest = { GetMap: 'GetMap' }; +export function instanceOfGetMapRequest(value) { + for (const key in GetMapRequest) { + if (Object.prototype.hasOwnProperty.call(GetMapRequest, key)) { + if (GetMapRequest[key] === value) { + return true; + } + } + } + return false; +} export function GetMapRequestFromJSON(json) { return GetMapRequestFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function GetMapRequestFromJSONTyped(json, ignoreDiscriminator) { export function GetMapRequestToJSON(value) { return value; } +export function GetMapRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/InlineObject.d.ts b/typescript/dist/esm/models/InlineObject.d.ts new file mode 100644 index 00000000..ac0931b0 --- /dev/null +++ b/typescript/dist/esm/models/InlineObject.d.ts @@ -0,0 +1,32 @@ +/** + * Geo Engine API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: dev@geoengine.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/** + * + * @export + * @interface InlineObject + */ +export interface InlineObject { + /** + * + * @type {string} + * @memberof InlineObject + */ + url: string; +} +/** + * Check if a given object implements the InlineObject interface. + */ +export declare function instanceOfInlineObject(value: object): value is InlineObject; +export declare function InlineObjectFromJSON(json: any): InlineObject; +export declare function InlineObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): InlineObject; +export declare function InlineObjectToJSON(json: any): InlineObject; +export declare function InlineObjectToJSONTyped(value?: InlineObject | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/InlineObject.js b/typescript/dist/esm/models/InlineObject.js new file mode 100644 index 00000000..6a372a1b --- /dev/null +++ b/typescript/dist/esm/models/InlineObject.js @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: dev@geoengine.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/** + * Check if a given object implements the InlineObject interface. + */ +export function instanceOfInlineObject(value) { + if (!('url' in value) || value['url'] === undefined) + return false; + return true; +} +export function InlineObjectFromJSON(json) { + return InlineObjectFromJSONTyped(json, false); +} +export function InlineObjectFromJSONTyped(json, ignoreDiscriminator) { + if (json == null) { + return json; + } + return { + 'url': json['url'], + }; +} +export function InlineObjectToJSON(json) { + return InlineObjectToJSONTyped(json, false); +} +export function InlineObjectToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; + } + return { + 'url': value['url'], + }; +} diff --git a/typescript/dist/esm/models/InternalDataId.d.ts b/typescript/dist/esm/models/InternalDataId.d.ts index d2f3c909..fb4a3a83 100644 --- a/typescript/dist/esm/models/InternalDataId.d.ts +++ b/typescript/dist/esm/models/InternalDataId.d.ts @@ -33,13 +33,13 @@ export interface InternalDataId { */ export declare const InternalDataIdTypeEnum: { readonly Internal: "internal"; - readonly External: "external"; }; export type InternalDataIdTypeEnum = typeof InternalDataIdTypeEnum[keyof typeof InternalDataIdTypeEnum]; /** * Check if a given object implements the InternalDataId interface. */ -export declare function instanceOfInternalDataId(value: object): boolean; +export declare function instanceOfInternalDataId(value: object): value is InternalDataId; export declare function InternalDataIdFromJSON(json: any): InternalDataId; export declare function InternalDataIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): InternalDataId; -export declare function InternalDataIdToJSON(value?: InternalDataId | null): any; +export declare function InternalDataIdToJSON(json: any): InternalDataId; +export declare function InternalDataIdToJSONTyped(value?: InternalDataId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/InternalDataId.js b/typescript/dist/esm/models/InternalDataId.js index 41e0f5dd..6d9308ec 100644 --- a/typescript/dist/esm/models/InternalDataId.js +++ b/typescript/dist/esm/models/InternalDataId.js @@ -15,23 +15,23 @@ * @export */ export const InternalDataIdTypeEnum = { - Internal: 'internal', - External: 'external' + Internal: 'internal' }; /** * Check if a given object implements the InternalDataId interface. */ export function instanceOfInternalDataId(value) { - let isInstance = true; - isInstance = isInstance && "datasetId" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('datasetId' in value) || value['datasetId'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function InternalDataIdFromJSON(json) { return InternalDataIdFromJSONTyped(json, false); } export function InternalDataIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,15 +39,15 @@ export function InternalDataIdFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function InternalDataIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function InternalDataIdToJSON(json) { + return InternalDataIdToJSONTyped(json, false); +} +export function InternalDataIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'datasetId': value.datasetId, - 'type': value.type, + 'datasetId': value['datasetId'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/Layer.d.ts b/typescript/dist/esm/models/Layer.d.ts index b7002503..907e6232 100644 --- a/typescript/dist/esm/models/Layer.d.ts +++ b/typescript/dist/esm/models/Layer.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { ProviderLayerId } from './ProviderLayerId'; import type { Symbology } from './Symbology'; +import type { ProviderLayerId } from './ProviderLayerId'; import type { Workflow } from './Workflow'; /** * @@ -66,7 +66,8 @@ export interface Layer { /** * Check if a given object implements the Layer interface. */ -export declare function instanceOfLayer(value: object): boolean; +export declare function instanceOfLayer(value: object): value is Layer; export declare function LayerFromJSON(json: any): Layer; export declare function LayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): Layer; -export declare function LayerToJSON(value?: Layer | null): any; +export declare function LayerToJSON(json: any): Layer; +export declare function LayerToJSONTyped(value?: Layer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Layer.js b/typescript/dist/esm/models/Layer.js index 14368bd2..29ee0cdb 100644 --- a/typescript/dist/esm/models/Layer.js +++ b/typescript/dist/esm/models/Layer.js @@ -11,52 +11,54 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { ProviderLayerIdFromJSON, ProviderLayerIdToJSON, } from './ProviderLayerId'; import { SymbologyFromJSON, SymbologyToJSON, } from './Symbology'; +import { ProviderLayerIdFromJSON, ProviderLayerIdToJSON, } from './ProviderLayerId'; import { WorkflowFromJSON, WorkflowToJSON, } from './Workflow'; /** * Check if a given object implements the Layer interface. */ export function instanceOfLayer(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('workflow' in value) || value['workflow'] === undefined) + return false; + return true; } export function LayerFromJSON(json) { return LayerFromJSONTyped(json, false); } export function LayerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'id': ProviderLayerIdFromJSON(json['id']), - 'metadata': !exists(json, 'metadata') ? undefined : json['metadata'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), + 'properties': json['properties'] == null ? undefined : json['properties'], + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), 'workflow': WorkflowFromJSON(json['workflow']), }; } -export function LayerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerToJSON(json) { + return LayerToJSONTyped(json, false); +} +export function LayerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'id': ProviderLayerIdToJSON(value.id), - 'metadata': value.metadata, - 'name': value.name, - 'properties': value.properties, - 'symbology': SymbologyToJSON(value.symbology), - 'workflow': WorkflowToJSON(value.workflow), + 'description': value['description'], + 'id': ProviderLayerIdToJSON(value['id']), + 'metadata': value['metadata'], + 'name': value['name'], + 'properties': value['properties'], + 'symbology': SymbologyToJSON(value['symbology']), + 'workflow': WorkflowToJSON(value['workflow']), }; } diff --git a/typescript/dist/esm/models/LayerCollection.d.ts b/typescript/dist/esm/models/LayerCollection.d.ts index b9c0e178..194aebf0 100644 --- a/typescript/dist/esm/models/LayerCollection.d.ts +++ b/typescript/dist/esm/models/LayerCollection.d.ts @@ -57,7 +57,8 @@ export interface LayerCollection { /** * Check if a given object implements the LayerCollection interface. */ -export declare function instanceOfLayerCollection(value: object): boolean; +export declare function instanceOfLayerCollection(value: object): value is LayerCollection; export declare function LayerCollectionFromJSON(json: any): LayerCollection; export declare function LayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerCollection; -export declare function LayerCollectionToJSON(value?: LayerCollection | null): any; +export declare function LayerCollectionToJSON(json: any): LayerCollection; +export declare function LayerCollectionToJSONTyped(value?: LayerCollection | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/LayerCollection.js b/typescript/dist/esm/models/LayerCollection.js index d1ca0b25..cf655620 100644 --- a/typescript/dist/esm/models/LayerCollection.js +++ b/typescript/dist/esm/models/LayerCollection.js @@ -11,50 +11,53 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { CollectionItemFromJSON, CollectionItemToJSON, } from './CollectionItem'; import { ProviderLayerCollectionIdFromJSON, ProviderLayerCollectionIdToJSON, } from './ProviderLayerCollectionId'; /** * Check if a given object implements the LayerCollection interface. */ export function instanceOfLayerCollection(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "items" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "properties" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('items' in value) || value['items'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('properties' in value) || value['properties'] === undefined) + return false; + return true; } export function LayerCollectionFromJSON(json) { return LayerCollectionFromJSONTyped(json, false); } export function LayerCollectionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], - 'entryLabel': !exists(json, 'entryLabel') ? undefined : json['entryLabel'], + 'entryLabel': json['entryLabel'] == null ? undefined : json['entryLabel'], 'id': ProviderLayerCollectionIdFromJSON(json['id']), 'items': (json['items'].map(CollectionItemFromJSON)), 'name': json['name'], 'properties': json['properties'], }; } -export function LayerCollectionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerCollectionToJSON(json) { + return LayerCollectionToJSONTyped(json, false); +} +export function LayerCollectionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'entryLabel': value.entryLabel, - 'id': ProviderLayerCollectionIdToJSON(value.id), - 'items': (value.items.map(CollectionItemToJSON)), - 'name': value.name, - 'properties': value.properties, + 'description': value['description'], + 'entryLabel': value['entryLabel'], + 'id': ProviderLayerCollectionIdToJSON(value['id']), + 'items': (value['items'].map(CollectionItemToJSON)), + 'name': value['name'], + 'properties': value['properties'], }; } diff --git a/typescript/dist/esm/models/LayerCollectionListing.d.ts b/typescript/dist/esm/models/LayerCollectionListing.d.ts index e3a05c0e..a83e8c0d 100644 --- a/typescript/dist/esm/models/LayerCollectionListing.d.ts +++ b/typescript/dist/esm/models/LayerCollectionListing.d.ts @@ -52,13 +52,13 @@ export interface LayerCollectionListing { */ export declare const LayerCollectionListingTypeEnum: { readonly Collection: "collection"; - readonly Layer: "layer"; }; export type LayerCollectionListingTypeEnum = typeof LayerCollectionListingTypeEnum[keyof typeof LayerCollectionListingTypeEnum]; /** * Check if a given object implements the LayerCollectionListing interface. */ -export declare function instanceOfLayerCollectionListing(value: object): boolean; +export declare function instanceOfLayerCollectionListing(value: object): value is LayerCollectionListing; export declare function LayerCollectionListingFromJSON(json: any): LayerCollectionListing; export declare function LayerCollectionListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerCollectionListing; -export declare function LayerCollectionListingToJSON(value?: LayerCollectionListing | null): any; +export declare function LayerCollectionListingToJSON(json: any): LayerCollectionListing; +export declare function LayerCollectionListingToJSONTyped(value?: LayerCollectionListing | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/LayerCollectionListing.js b/typescript/dist/esm/models/LayerCollectionListing.js index 4d0470fb..7c097dbb 100644 --- a/typescript/dist/esm/models/LayerCollectionListing.js +++ b/typescript/dist/esm/models/LayerCollectionListing.js @@ -11,53 +11,54 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { ProviderLayerCollectionIdFromJSON, ProviderLayerCollectionIdToJSON, } from './ProviderLayerCollectionId'; /** * @export */ export const LayerCollectionListingTypeEnum = { - Collection: 'collection', - Layer: 'layer' + Collection: 'collection' }; /** * Check if a given object implements the LayerCollectionListing interface. */ export function instanceOfLayerCollectionListing(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function LayerCollectionListingFromJSON(json) { return LayerCollectionListingFromJSONTyped(json, false); } export function LayerCollectionListingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'id': ProviderLayerCollectionIdFromJSON(json['id']), 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], 'type': json['type'], }; } -export function LayerCollectionListingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerCollectionListingToJSON(json) { + return LayerCollectionListingToJSONTyped(json, false); +} +export function LayerCollectionListingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'id': ProviderLayerCollectionIdToJSON(value.id), - 'name': value.name, - 'properties': value.properties, - 'type': value.type, + 'description': value['description'], + 'id': ProviderLayerCollectionIdToJSON(value['id']), + 'name': value['name'], + 'properties': value['properties'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/LayerCollectionResource.d.ts b/typescript/dist/esm/models/LayerCollectionResource.d.ts index 6daab6d0..ec129b62 100644 --- a/typescript/dist/esm/models/LayerCollectionResource.d.ts +++ b/typescript/dist/esm/models/LayerCollectionResource.d.ts @@ -38,7 +38,8 @@ export type LayerCollectionResourceTypeEnum = typeof LayerCollectionResourceType /** * Check if a given object implements the LayerCollectionResource interface. */ -export declare function instanceOfLayerCollectionResource(value: object): boolean; +export declare function instanceOfLayerCollectionResource(value: object): value is LayerCollectionResource; export declare function LayerCollectionResourceFromJSON(json: any): LayerCollectionResource; export declare function LayerCollectionResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerCollectionResource; -export declare function LayerCollectionResourceToJSON(value?: LayerCollectionResource | null): any; +export declare function LayerCollectionResourceToJSON(json: any): LayerCollectionResource; +export declare function LayerCollectionResourceToJSONTyped(value?: LayerCollectionResource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/LayerCollectionResource.js b/typescript/dist/esm/models/LayerCollectionResource.js index 31c90a29..2e96348f 100644 --- a/typescript/dist/esm/models/LayerCollectionResource.js +++ b/typescript/dist/esm/models/LayerCollectionResource.js @@ -21,16 +21,17 @@ export const LayerCollectionResourceTypeEnum = { * Check if a given object implements the LayerCollectionResource interface. */ export function instanceOfLayerCollectionResource(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function LayerCollectionResourceFromJSON(json) { return LayerCollectionResourceFromJSONTyped(json, false); } export function LayerCollectionResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,15 +39,15 @@ export function LayerCollectionResourceFromJSONTyped(json, ignoreDiscriminator) 'type': json['type'], }; } -export function LayerCollectionResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerCollectionResourceToJSON(json) { + return LayerCollectionResourceToJSONTyped(json, false); +} +export function LayerCollectionResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/LayerListing.d.ts b/typescript/dist/esm/models/LayerListing.d.ts index c8a481ba..b2526193 100644 --- a/typescript/dist/esm/models/LayerListing.d.ts +++ b/typescript/dist/esm/models/LayerListing.d.ts @@ -57,7 +57,8 @@ export type LayerListingTypeEnum = typeof LayerListingTypeEnum[keyof typeof Laye /** * Check if a given object implements the LayerListing interface. */ -export declare function instanceOfLayerListing(value: object): boolean; +export declare function instanceOfLayerListing(value: object): value is LayerListing; export declare function LayerListingFromJSON(json: any): LayerListing; export declare function LayerListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerListing; -export declare function LayerListingToJSON(value?: LayerListing | null): any; +export declare function LayerListingToJSON(json: any): LayerListing; +export declare function LayerListingToJSONTyped(value?: LayerListing | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/LayerListing.js b/typescript/dist/esm/models/LayerListing.js index 9516170c..37bc31cb 100644 --- a/typescript/dist/esm/models/LayerListing.js +++ b/typescript/dist/esm/models/LayerListing.js @@ -11,7 +11,6 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { ProviderLayerIdFromJSON, ProviderLayerIdToJSON, } from './ProviderLayerId'; /** * @export @@ -23,40 +22,43 @@ export const LayerListingTypeEnum = { * Check if a given object implements the LayerListing interface. */ export function instanceOfLayerListing(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function LayerListingFromJSON(json) { return LayerListingFromJSONTyped(json, false); } export function LayerListingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'id': ProviderLayerIdFromJSON(json['id']), 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], 'type': json['type'], }; } -export function LayerListingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerListingToJSON(json) { + return LayerListingToJSONTyped(json, false); +} +export function LayerListingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'id': ProviderLayerIdToJSON(value.id), - 'name': value.name, - 'properties': value.properties, - 'type': value.type, + 'description': value['description'], + 'id': ProviderLayerIdToJSON(value['id']), + 'name': value['name'], + 'properties': value['properties'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/LayerResource.d.ts b/typescript/dist/esm/models/LayerResource.d.ts index 70455cdd..679ab67d 100644 --- a/typescript/dist/esm/models/LayerResource.d.ts +++ b/typescript/dist/esm/models/LayerResource.d.ts @@ -38,7 +38,8 @@ export type LayerResourceTypeEnum = typeof LayerResourceTypeEnum[keyof typeof La /** * Check if a given object implements the LayerResource interface. */ -export declare function instanceOfLayerResource(value: object): boolean; +export declare function instanceOfLayerResource(value: object): value is LayerResource; export declare function LayerResourceFromJSON(json: any): LayerResource; export declare function LayerResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerResource; -export declare function LayerResourceToJSON(value?: LayerResource | null): any; +export declare function LayerResourceToJSON(json: any): LayerResource; +export declare function LayerResourceToJSONTyped(value?: LayerResource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/LayerResource.js b/typescript/dist/esm/models/LayerResource.js index bbb9a101..907e8a55 100644 --- a/typescript/dist/esm/models/LayerResource.js +++ b/typescript/dist/esm/models/LayerResource.js @@ -21,16 +21,17 @@ export const LayerResourceTypeEnum = { * Check if a given object implements the LayerResource interface. */ export function instanceOfLayerResource(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function LayerResourceFromJSON(json) { return LayerResourceFromJSONTyped(json, false); } export function LayerResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,15 +39,15 @@ export function LayerResourceFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function LayerResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerResourceToJSON(json) { + return LayerResourceToJSONTyped(json, false); +} +export function LayerResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/LayerUpdate.d.ts b/typescript/dist/esm/models/LayerUpdate.d.ts index ac3cfe51..fc0d7a88 100644 --- a/typescript/dist/esm/models/LayerUpdate.d.ts +++ b/typescript/dist/esm/models/LayerUpdate.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ProjectLayer } from './ProjectLayer'; -import { ProjectUpdateToken } from './ProjectUpdateToken'; +import type { ProjectLayer } from './ProjectLayer'; +import type { ProjectUpdateToken } from './ProjectUpdateToken'; /** * @type LayerUpdate * @@ -19,4 +19,5 @@ import { ProjectUpdateToken } from './ProjectUpdateToken'; export type LayerUpdate = ProjectLayer | ProjectUpdateToken; export declare function LayerUpdateFromJSON(json: any): LayerUpdate; export declare function LayerUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerUpdate; -export declare function LayerUpdateToJSON(value?: LayerUpdate | null): any; +export declare function LayerUpdateToJSON(json: any): any; +export declare function LayerUpdateToJSONTyped(value?: LayerUpdate | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/LayerUpdate.js b/typescript/dist/esm/models/LayerUpdate.js index 15f09aaa..3a13fbb7 100644 --- a/typescript/dist/esm/models/LayerUpdate.js +++ b/typescript/dist/esm/models/LayerUpdate.js @@ -12,30 +12,28 @@ * Do not edit the class manually. */ import { instanceOfProjectLayer, ProjectLayerFromJSONTyped, ProjectLayerToJSON, } from './ProjectLayer'; -import { ProjectUpdateToken, instanceOfProjectUpdateToken, ProjectUpdateTokenToJSON, } from './ProjectUpdateToken'; +import { instanceOfProjectUpdateToken, ProjectUpdateTokenFromJSONTyped, ProjectUpdateTokenToJSON, } from './ProjectUpdateToken'; export function LayerUpdateFromJSON(json) { return LayerUpdateFromJSONTyped(json, false); } export function LayerUpdateFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - if (json === ProjectUpdateToken.None) { - return ProjectUpdateToken.None; + if (instanceOfProjectLayer(json)) { + return ProjectLayerFromJSONTyped(json, true); } - else if (json === ProjectUpdateToken.Delete) { - return ProjectUpdateToken.Delete; - } - else { - return Object.assign({}, ProjectLayerFromJSONTyped(json, true)); + if (instanceOfProjectUpdateToken(json)) { + return ProjectUpdateTokenFromJSONTyped(json, true); } + return {}; } -export function LayerUpdateToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerUpdateToJSON(json) { + return LayerUpdateToJSONTyped(json, false); +} +export function LayerUpdateToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } if (typeof value === 'object' && instanceOfProjectLayer(value)) { return ProjectLayerToJSON(value); diff --git a/typescript/dist/esm/models/LayerVisibility.d.ts b/typescript/dist/esm/models/LayerVisibility.d.ts index 65dc0aa0..cadd44db 100644 --- a/typescript/dist/esm/models/LayerVisibility.d.ts +++ b/typescript/dist/esm/models/LayerVisibility.d.ts @@ -31,7 +31,8 @@ export interface LayerVisibility { /** * Check if a given object implements the LayerVisibility interface. */ -export declare function instanceOfLayerVisibility(value: object): boolean; +export declare function instanceOfLayerVisibility(value: object): value is LayerVisibility; export declare function LayerVisibilityFromJSON(json: any): LayerVisibility; export declare function LayerVisibilityFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerVisibility; -export declare function LayerVisibilityToJSON(value?: LayerVisibility | null): any; +export declare function LayerVisibilityToJSON(json: any): LayerVisibility; +export declare function LayerVisibilityToJSONTyped(value?: LayerVisibility | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/LayerVisibility.js b/typescript/dist/esm/models/LayerVisibility.js index 382e3daa..4cee5186 100644 --- a/typescript/dist/esm/models/LayerVisibility.js +++ b/typescript/dist/esm/models/LayerVisibility.js @@ -15,16 +15,17 @@ * Check if a given object implements the LayerVisibility interface. */ export function instanceOfLayerVisibility(value) { - let isInstance = true; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "legend" in value; - return isInstance; + if (!('data' in value) || value['data'] === undefined) + return false; + if (!('legend' in value) || value['legend'] === undefined) + return false; + return true; } export function LayerVisibilityFromJSON(json) { return LayerVisibilityFromJSONTyped(json, false); } export function LayerVisibilityFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function LayerVisibilityFromJSONTyped(json, ignoreDiscriminator) { 'legend': json['legend'], }; } -export function LayerVisibilityToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerVisibilityToJSON(json) { + return LayerVisibilityToJSONTyped(json, false); +} +export function LayerVisibilityToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'data': value.data, - 'legend': value.legend, + 'data': value['data'], + 'legend': value['legend'], }; } diff --git a/typescript/dist/esm/models/LineSymbology.d.ts b/typescript/dist/esm/models/LineSymbology.d.ts index 7a657fbe..02ba3590 100644 --- a/typescript/dist/esm/models/LineSymbology.d.ts +++ b/typescript/dist/esm/models/LineSymbology.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { StrokeParam } from './StrokeParam'; import type { TextSymbology } from './TextSymbology'; +import type { StrokeParam } from './StrokeParam'; /** * * @export @@ -52,7 +52,8 @@ export type LineSymbologyTypeEnum = typeof LineSymbologyTypeEnum[keyof typeof Li /** * Check if a given object implements the LineSymbology interface. */ -export declare function instanceOfLineSymbology(value: object): boolean; +export declare function instanceOfLineSymbology(value: object): value is LineSymbology; export declare function LineSymbologyFromJSON(json: any): LineSymbology; export declare function LineSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): LineSymbology; -export declare function LineSymbologyToJSON(value?: LineSymbology | null): any; +export declare function LineSymbologyToJSON(json: any): LineSymbology; +export declare function LineSymbologyToJSONTyped(value?: LineSymbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/LineSymbology.js b/typescript/dist/esm/models/LineSymbology.js index ce4bb5d7..fac48181 100644 --- a/typescript/dist/esm/models/LineSymbology.js +++ b/typescript/dist/esm/models/LineSymbology.js @@ -11,9 +11,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { StrokeParamFromJSON, StrokeParamToJSON, } from './StrokeParam'; import { TextSymbologyFromJSON, TextSymbologyToJSON, } from './TextSymbology'; +import { StrokeParamFromJSON, StrokeParamToJSON, } from './StrokeParam'; /** * @export */ @@ -24,37 +23,39 @@ export const LineSymbologyTypeEnum = { * Check if a given object implements the LineSymbology interface. */ export function instanceOfLineSymbology(value) { - let isInstance = true; - isInstance = isInstance && "autoSimplified" in value; - isInstance = isInstance && "stroke" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('autoSimplified' in value) || value['autoSimplified'] === undefined) + return false; + if (!('stroke' in value) || value['stroke'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function LineSymbologyFromJSON(json) { return LineSymbologyFromJSONTyped(json, false); } export function LineSymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'autoSimplified': json['autoSimplified'], 'stroke': StrokeParamFromJSON(json['stroke']), - 'text': !exists(json, 'text') ? undefined : TextSymbologyFromJSON(json['text']), + 'text': json['text'] == null ? undefined : TextSymbologyFromJSON(json['text']), 'type': json['type'], }; } -export function LineSymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LineSymbologyToJSON(json) { + return LineSymbologyToJSONTyped(json, false); +} +export function LineSymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'autoSimplified': value.autoSimplified, - 'stroke': StrokeParamToJSON(value.stroke), - 'text': TextSymbologyToJSON(value.text), - 'type': value.type, + 'autoSimplified': value['autoSimplified'], + 'stroke': StrokeParamToJSON(value['stroke']), + 'text': TextSymbologyToJSON(value['text']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/LinearGradient.d.ts b/typescript/dist/esm/models/LinearGradient.d.ts index f11f716f..04ab36a1 100644 --- a/typescript/dist/esm/models/LinearGradient.d.ts +++ b/typescript/dist/esm/models/LinearGradient.d.ts @@ -52,14 +52,13 @@ export interface LinearGradient { */ export declare const LinearGradientTypeEnum: { readonly LinearGradient: "linearGradient"; - readonly LogarithmicGradient: "logarithmicGradient"; - readonly Palette: "palette"; }; export type LinearGradientTypeEnum = typeof LinearGradientTypeEnum[keyof typeof LinearGradientTypeEnum]; /** * Check if a given object implements the LinearGradient interface. */ -export declare function instanceOfLinearGradient(value: object): boolean; +export declare function instanceOfLinearGradient(value: object): value is LinearGradient; export declare function LinearGradientFromJSON(json: any): LinearGradient; export declare function LinearGradientFromJSONTyped(json: any, ignoreDiscriminator: boolean): LinearGradient; -export declare function LinearGradientToJSON(value?: LinearGradient | null): any; +export declare function LinearGradientToJSON(json: any): LinearGradient; +export declare function LinearGradientToJSONTyped(value?: LinearGradient | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/LinearGradient.js b/typescript/dist/esm/models/LinearGradient.js index b41bfaca..a661f669 100644 --- a/typescript/dist/esm/models/LinearGradient.js +++ b/typescript/dist/esm/models/LinearGradient.js @@ -16,27 +16,29 @@ import { BreakpointFromJSON, BreakpointToJSON, } from './Breakpoint'; * @export */ export const LinearGradientTypeEnum = { - LinearGradient: 'linearGradient', - LogarithmicGradient: 'logarithmicGradient', - Palette: 'palette' + LinearGradient: 'linearGradient' }; /** * Check if a given object implements the LinearGradient interface. */ export function instanceOfLinearGradient(value) { - let isInstance = true; - isInstance = isInstance && "breakpoints" in value; - isInstance = isInstance && "noDataColor" in value; - isInstance = isInstance && "overColor" in value; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "underColor" in value; - return isInstance; + if (!('breakpoints' in value) || value['breakpoints'] === undefined) + return false; + if (!('noDataColor' in value) || value['noDataColor'] === undefined) + return false; + if (!('overColor' in value) || value['overColor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + if (!('underColor' in value) || value['underColor'] === undefined) + return false; + return true; } export function LinearGradientFromJSON(json) { return LinearGradientFromJSONTyped(json, false); } export function LinearGradientFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -47,18 +49,18 @@ export function LinearGradientFromJSONTyped(json, ignoreDiscriminator) { 'underColor': json['underColor'], }; } -export function LinearGradientToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LinearGradientToJSON(json) { + return LinearGradientToJSONTyped(json, false); +} +export function LinearGradientToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'breakpoints': (value.breakpoints.map(BreakpointToJSON)), - 'noDataColor': value.noDataColor, - 'overColor': value.overColor, - 'type': value.type, - 'underColor': value.underColor, + 'breakpoints': (value['breakpoints'].map(BreakpointToJSON)), + 'noDataColor': value['noDataColor'], + 'overColor': value['overColor'], + 'type': value['type'], + 'underColor': value['underColor'], }; } diff --git a/typescript/dist/esm/models/LogarithmicGradient.d.ts b/typescript/dist/esm/models/LogarithmicGradient.d.ts index 3ca0a5d8..1d89248f 100644 --- a/typescript/dist/esm/models/LogarithmicGradient.d.ts +++ b/typescript/dist/esm/models/LogarithmicGradient.d.ts @@ -57,7 +57,8 @@ export type LogarithmicGradientTypeEnum = typeof LogarithmicGradientTypeEnum[key /** * Check if a given object implements the LogarithmicGradient interface. */ -export declare function instanceOfLogarithmicGradient(value: object): boolean; +export declare function instanceOfLogarithmicGradient(value: object): value is LogarithmicGradient; export declare function LogarithmicGradientFromJSON(json: any): LogarithmicGradient; export declare function LogarithmicGradientFromJSONTyped(json: any, ignoreDiscriminator: boolean): LogarithmicGradient; -export declare function LogarithmicGradientToJSON(value?: LogarithmicGradient | null): any; +export declare function LogarithmicGradientToJSON(json: any): LogarithmicGradient; +export declare function LogarithmicGradientToJSONTyped(value?: LogarithmicGradient | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/LogarithmicGradient.js b/typescript/dist/esm/models/LogarithmicGradient.js index 3a454638..94c90943 100644 --- a/typescript/dist/esm/models/LogarithmicGradient.js +++ b/typescript/dist/esm/models/LogarithmicGradient.js @@ -22,19 +22,23 @@ export const LogarithmicGradientTypeEnum = { * Check if a given object implements the LogarithmicGradient interface. */ export function instanceOfLogarithmicGradient(value) { - let isInstance = true; - isInstance = isInstance && "breakpoints" in value; - isInstance = isInstance && "noDataColor" in value; - isInstance = isInstance && "overColor" in value; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "underColor" in value; - return isInstance; + if (!('breakpoints' in value) || value['breakpoints'] === undefined) + return false; + if (!('noDataColor' in value) || value['noDataColor'] === undefined) + return false; + if (!('overColor' in value) || value['overColor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + if (!('underColor' in value) || value['underColor'] === undefined) + return false; + return true; } export function LogarithmicGradientFromJSON(json) { return LogarithmicGradientFromJSONTyped(json, false); } export function LogarithmicGradientFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -45,18 +49,18 @@ export function LogarithmicGradientFromJSONTyped(json, ignoreDiscriminator) { 'underColor': json['underColor'], }; } -export function LogarithmicGradientToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LogarithmicGradientToJSON(json) { + return LogarithmicGradientToJSONTyped(json, false); +} +export function LogarithmicGradientToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'breakpoints': (value.breakpoints.map(BreakpointToJSON)), - 'noDataColor': value.noDataColor, - 'overColor': value.overColor, - 'type': value.type, - 'underColor': value.underColor, + 'breakpoints': (value['breakpoints'].map(BreakpointToJSON)), + 'noDataColor': value['noDataColor'], + 'overColor': value['overColor'], + 'type': value['type'], + 'underColor': value['underColor'], }; } diff --git a/typescript/dist/esm/models/Measurement.d.ts b/typescript/dist/esm/models/Measurement.d.ts index 6daef098..4ea22b1a 100644 --- a/typescript/dist/esm/models/Measurement.d.ts +++ b/typescript/dist/esm/models/Measurement.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ClassificationMeasurement } from './ClassificationMeasurement'; -import { ContinuousMeasurement } from './ContinuousMeasurement'; -import { UnitlessMeasurement } from './UnitlessMeasurement'; +import type { ClassificationMeasurement } from './ClassificationMeasurement'; +import type { ContinuousMeasurement } from './ContinuousMeasurement'; +import type { UnitlessMeasurement } from './UnitlessMeasurement'; /** * @type Measurement * @@ -26,4 +26,5 @@ export type Measurement = { } & UnitlessMeasurement; export declare function MeasurementFromJSON(json: any): Measurement; export declare function MeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): Measurement; -export declare function MeasurementToJSON(value?: Measurement | null): any; +export declare function MeasurementToJSON(json: any): any; +export declare function MeasurementToJSONTyped(value?: Measurement | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Measurement.js b/typescript/dist/esm/models/Measurement.js index 1c5f4002..22294691 100644 --- a/typescript/dist/esm/models/Measurement.js +++ b/typescript/dist/esm/models/Measurement.js @@ -18,34 +18,34 @@ export function MeasurementFromJSON(json) { return MeasurementFromJSONTyped(json, false); } export function MeasurementFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'classification': - return Object.assign(Object.assign({}, ClassificationMeasurementFromJSONTyped(json, true)), { type: 'classification' }); + return Object.assign({}, ClassificationMeasurementFromJSONTyped(json, true), { type: 'classification' }); case 'continuous': - return Object.assign(Object.assign({}, ContinuousMeasurementFromJSONTyped(json, true)), { type: 'continuous' }); + return Object.assign({}, ContinuousMeasurementFromJSONTyped(json, true), { type: 'continuous' }); case 'unitless': - return Object.assign(Object.assign({}, UnitlessMeasurementFromJSONTyped(json, true)), { type: 'unitless' }); + return Object.assign({}, UnitlessMeasurementFromJSONTyped(json, true), { type: 'unitless' }); default: throw new Error(`No variant of Measurement exists with 'type=${json['type']}'`); } } -export function MeasurementToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MeasurementToJSON(json) { + return MeasurementToJSONTyped(json, false); +} +export function MeasurementToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'classification': - return ClassificationMeasurementToJSON(value); + return Object.assign({}, ClassificationMeasurementToJSON(value), { type: 'classification' }); case 'continuous': - return ContinuousMeasurementToJSON(value); + return Object.assign({}, ContinuousMeasurementToJSON(value), { type: 'continuous' }); case 'unitless': - return UnitlessMeasurementToJSON(value); + return Object.assign({}, UnitlessMeasurementToJSON(value), { type: 'unitless' }); default: throw new Error(`No variant of Measurement exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/MetaDataDefinition.d.ts b/typescript/dist/esm/models/MetaDataDefinition.d.ts index 6f92b75b..f1f5da52 100644 --- a/typescript/dist/esm/models/MetaDataDefinition.d.ts +++ b/typescript/dist/esm/models/MetaDataDefinition.d.ts @@ -9,12 +9,12 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { GdalMetaDataList } from './GdalMetaDataList'; -import { GdalMetaDataRegular } from './GdalMetaDataRegular'; -import { GdalMetaDataStatic } from './GdalMetaDataStatic'; -import { GdalMetadataNetCdfCf } from './GdalMetadataNetCdfCf'; -import { MockMetaData } from './MockMetaData'; -import { OgrMetaData } from './OgrMetaData'; +import type { GdalMetaDataList } from './GdalMetaDataList'; +import type { GdalMetaDataRegular } from './GdalMetaDataRegular'; +import type { GdalMetaDataStatic } from './GdalMetaDataStatic'; +import type { GdalMetadataNetCdfCf } from './GdalMetadataNetCdfCf'; +import type { MockMetaData } from './MockMetaData'; +import type { OgrMetaData } from './OgrMetaData'; /** * @type MetaDataDefinition * @@ -35,4 +35,5 @@ export type MetaDataDefinition = { } & OgrMetaData; export declare function MetaDataDefinitionFromJSON(json: any): MetaDataDefinition; export declare function MetaDataDefinitionFromJSONTyped(json: any, ignoreDiscriminator: boolean): MetaDataDefinition; -export declare function MetaDataDefinitionToJSON(value?: MetaDataDefinition | null): any; +export declare function MetaDataDefinitionToJSON(json: any): any; +export declare function MetaDataDefinitionToJSONTyped(value?: MetaDataDefinition | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MetaDataDefinition.js b/typescript/dist/esm/models/MetaDataDefinition.js index 25a97940..e2ea6dc7 100644 --- a/typescript/dist/esm/models/MetaDataDefinition.js +++ b/typescript/dist/esm/models/MetaDataDefinition.js @@ -21,46 +21,46 @@ export function MetaDataDefinitionFromJSON(json) { return MetaDataDefinitionFromJSONTyped(json, false); } export function MetaDataDefinitionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'GdalMetaDataList': - return Object.assign(Object.assign({}, GdalMetaDataListFromJSONTyped(json, true)), { type: 'GdalMetaDataList' }); + return Object.assign({}, GdalMetaDataListFromJSONTyped(json, true), { type: 'GdalMetaDataList' }); case 'GdalMetaDataRegular': - return Object.assign(Object.assign({}, GdalMetaDataRegularFromJSONTyped(json, true)), { type: 'GdalMetaDataRegular' }); + return Object.assign({}, GdalMetaDataRegularFromJSONTyped(json, true), { type: 'GdalMetaDataRegular' }); case 'GdalMetadataNetCdfCf': - return Object.assign(Object.assign({}, GdalMetadataNetCdfCfFromJSONTyped(json, true)), { type: 'GdalMetadataNetCdfCf' }); + return Object.assign({}, GdalMetadataNetCdfCfFromJSONTyped(json, true), { type: 'GdalMetadataNetCdfCf' }); case 'GdalStatic': - return Object.assign(Object.assign({}, GdalMetaDataStaticFromJSONTyped(json, true)), { type: 'GdalStatic' }); + return Object.assign({}, GdalMetaDataStaticFromJSONTyped(json, true), { type: 'GdalStatic' }); case 'MockMetaData': - return Object.assign(Object.assign({}, MockMetaDataFromJSONTyped(json, true)), { type: 'MockMetaData' }); + return Object.assign({}, MockMetaDataFromJSONTyped(json, true), { type: 'MockMetaData' }); case 'OgrMetaData': - return Object.assign(Object.assign({}, OgrMetaDataFromJSONTyped(json, true)), { type: 'OgrMetaData' }); + return Object.assign({}, OgrMetaDataFromJSONTyped(json, true), { type: 'OgrMetaData' }); default: throw new Error(`No variant of MetaDataDefinition exists with 'type=${json['type']}'`); } } -export function MetaDataDefinitionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MetaDataDefinitionToJSON(json) { + return MetaDataDefinitionToJSONTyped(json, false); +} +export function MetaDataDefinitionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'GdalMetaDataList': - return GdalMetaDataListToJSON(value); + return Object.assign({}, GdalMetaDataListToJSON(value), { type: 'GdalMetaDataList' }); case 'GdalMetaDataRegular': - return GdalMetaDataRegularToJSON(value); + return Object.assign({}, GdalMetaDataRegularToJSON(value), { type: 'GdalMetaDataRegular' }); case 'GdalMetadataNetCdfCf': - return GdalMetadataNetCdfCfToJSON(value); + return Object.assign({}, GdalMetadataNetCdfCfToJSON(value), { type: 'GdalMetadataNetCdfCf' }); case 'GdalStatic': - return GdalMetaDataStaticToJSON(value); + return Object.assign({}, GdalMetaDataStaticToJSON(value), { type: 'GdalStatic' }); case 'MockMetaData': - return MockMetaDataToJSON(value); + return Object.assign({}, MockMetaDataToJSON(value), { type: 'MockMetaData' }); case 'OgrMetaData': - return OgrMetaDataToJSON(value); + return Object.assign({}, OgrMetaDataToJSON(value), { type: 'OgrMetaData' }); default: throw new Error(`No variant of MetaDataDefinition exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/MetaDataSuggestion.d.ts b/typescript/dist/esm/models/MetaDataSuggestion.d.ts index 38460fb6..dd1cc615 100644 --- a/typescript/dist/esm/models/MetaDataSuggestion.d.ts +++ b/typescript/dist/esm/models/MetaDataSuggestion.d.ts @@ -38,7 +38,8 @@ export interface MetaDataSuggestion { /** * Check if a given object implements the MetaDataSuggestion interface. */ -export declare function instanceOfMetaDataSuggestion(value: object): boolean; +export declare function instanceOfMetaDataSuggestion(value: object): value is MetaDataSuggestion; export declare function MetaDataSuggestionFromJSON(json: any): MetaDataSuggestion; export declare function MetaDataSuggestionFromJSONTyped(json: any, ignoreDiscriminator: boolean): MetaDataSuggestion; -export declare function MetaDataSuggestionToJSON(value?: MetaDataSuggestion | null): any; +export declare function MetaDataSuggestionToJSON(json: any): MetaDataSuggestion; +export declare function MetaDataSuggestionToJSONTyped(value?: MetaDataSuggestion | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MetaDataSuggestion.js b/typescript/dist/esm/models/MetaDataSuggestion.js index 14bf0381..5d12af32 100644 --- a/typescript/dist/esm/models/MetaDataSuggestion.js +++ b/typescript/dist/esm/models/MetaDataSuggestion.js @@ -16,17 +16,19 @@ import { MetaDataDefinitionFromJSON, MetaDataDefinitionToJSON, } from './MetaDat * Check if a given object implements the MetaDataSuggestion interface. */ export function instanceOfMetaDataSuggestion(value) { - let isInstance = true; - isInstance = isInstance && "layerName" in value; - isInstance = isInstance && "mainFile" in value; - isInstance = isInstance && "metaData" in value; - return isInstance; + if (!('layerName' in value) || value['layerName'] === undefined) + return false; + if (!('mainFile' in value) || value['mainFile'] === undefined) + return false; + if (!('metaData' in value) || value['metaData'] === undefined) + return false; + return true; } export function MetaDataSuggestionFromJSON(json) { return MetaDataSuggestionFromJSONTyped(json, false); } export function MetaDataSuggestionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -35,16 +37,16 @@ export function MetaDataSuggestionFromJSONTyped(json, ignoreDiscriminator) { 'metaData': MetaDataDefinitionFromJSON(json['metaData']), }; } -export function MetaDataSuggestionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MetaDataSuggestionToJSON(json) { + return MetaDataSuggestionToJSONTyped(json, false); +} +export function MetaDataSuggestionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'layerName': value.layerName, - 'mainFile': value.mainFile, - 'metaData': MetaDataDefinitionToJSON(value.metaData), + 'layerName': value['layerName'], + 'mainFile': value['mainFile'], + 'metaData': MetaDataDefinitionToJSON(value['metaData']), }; } diff --git a/typescript/dist/esm/models/MlModel.d.ts b/typescript/dist/esm/models/MlModel.d.ts index 73c636bf..865caa00 100644 --- a/typescript/dist/esm/models/MlModel.d.ts +++ b/typescript/dist/esm/models/MlModel.d.ts @@ -50,7 +50,8 @@ export interface MlModel { /** * Check if a given object implements the MlModel interface. */ -export declare function instanceOfMlModel(value: object): boolean; +export declare function instanceOfMlModel(value: object): value is MlModel; export declare function MlModelFromJSON(json: any): MlModel; export declare function MlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModel; -export declare function MlModelToJSON(value?: MlModel | null): any; +export declare function MlModelToJSON(json: any): MlModel; +export declare function MlModelToJSONTyped(value?: MlModel | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MlModel.js b/typescript/dist/esm/models/MlModel.js index f994ca64..5d2e1efa 100644 --- a/typescript/dist/esm/models/MlModel.js +++ b/typescript/dist/esm/models/MlModel.js @@ -16,19 +16,23 @@ import { MlModelMetadataFromJSON, MlModelMetadataToJSON, } from './MlModelMetada * Check if a given object implements the MlModel interface. */ export function instanceOfMlModel(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "metadata" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "upload" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('metadata' in value) || value['metadata'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('upload' in value) || value['upload'] === undefined) + return false; + return true; } export function MlModelFromJSON(json) { return MlModelFromJSONTyped(json, false); } export function MlModelFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,18 +43,18 @@ export function MlModelFromJSONTyped(json, ignoreDiscriminator) { 'upload': json['upload'], }; } -export function MlModelToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MlModelToJSON(json) { + return MlModelToJSONTyped(json, false); +} +export function MlModelToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'displayName': value.displayName, - 'metadata': MlModelMetadataToJSON(value.metadata), - 'name': value.name, - 'upload': value.upload, + 'description': value['description'], + 'displayName': value['displayName'], + 'metadata': MlModelMetadataToJSON(value['metadata']), + 'name': value['name'], + 'upload': value['upload'], }; } diff --git a/typescript/dist/esm/models/MlModelMetadata.d.ts b/typescript/dist/esm/models/MlModelMetadata.d.ts index 707778e9..7316b1cc 100644 --- a/typescript/dist/esm/models/MlModelMetadata.d.ts +++ b/typescript/dist/esm/models/MlModelMetadata.d.ts @@ -44,7 +44,8 @@ export interface MlModelMetadata { /** * Check if a given object implements the MlModelMetadata interface. */ -export declare function instanceOfMlModelMetadata(value: object): boolean; +export declare function instanceOfMlModelMetadata(value: object): value is MlModelMetadata; export declare function MlModelMetadataFromJSON(json: any): MlModelMetadata; export declare function MlModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelMetadata; -export declare function MlModelMetadataToJSON(value?: MlModelMetadata | null): any; +export declare function MlModelMetadataToJSON(json: any): MlModelMetadata; +export declare function MlModelMetadataToJSONTyped(value?: MlModelMetadata | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MlModelMetadata.js b/typescript/dist/esm/models/MlModelMetadata.js index 07858d84..cd54e11c 100644 --- a/typescript/dist/esm/models/MlModelMetadata.js +++ b/typescript/dist/esm/models/MlModelMetadata.js @@ -16,18 +16,21 @@ import { RasterDataTypeFromJSON, RasterDataTypeToJSON, } from './RasterDataType' * Check if a given object implements the MlModelMetadata interface. */ export function instanceOfMlModelMetadata(value) { - let isInstance = true; - isInstance = isInstance && "fileName" in value; - isInstance = isInstance && "inputType" in value; - isInstance = isInstance && "numInputBands" in value; - isInstance = isInstance && "outputType" in value; - return isInstance; + if (!('fileName' in value) || value['fileName'] === undefined) + return false; + if (!('inputType' in value) || value['inputType'] === undefined) + return false; + if (!('numInputBands' in value) || value['numInputBands'] === undefined) + return false; + if (!('outputType' in value) || value['outputType'] === undefined) + return false; + return true; } export function MlModelMetadataFromJSON(json) { return MlModelMetadataFromJSONTyped(json, false); } export function MlModelMetadataFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,17 @@ export function MlModelMetadataFromJSONTyped(json, ignoreDiscriminator) { 'outputType': RasterDataTypeFromJSON(json['outputType']), }; } -export function MlModelMetadataToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MlModelMetadataToJSON(json) { + return MlModelMetadataToJSONTyped(json, false); +} +export function MlModelMetadataToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'fileName': value.fileName, - 'inputType': RasterDataTypeToJSON(value.inputType), - 'numInputBands': value.numInputBands, - 'outputType': RasterDataTypeToJSON(value.outputType), + 'fileName': value['fileName'], + 'inputType': RasterDataTypeToJSON(value['inputType']), + 'numInputBands': value['numInputBands'], + 'outputType': RasterDataTypeToJSON(value['outputType']), }; } diff --git a/typescript/dist/esm/models/MlModelNameResponse.d.ts b/typescript/dist/esm/models/MlModelNameResponse.d.ts index 750bd6e1..9d610baa 100644 --- a/typescript/dist/esm/models/MlModelNameResponse.d.ts +++ b/typescript/dist/esm/models/MlModelNameResponse.d.ts @@ -25,7 +25,8 @@ export interface MlModelNameResponse { /** * Check if a given object implements the MlModelNameResponse interface. */ -export declare function instanceOfMlModelNameResponse(value: object): boolean; +export declare function instanceOfMlModelNameResponse(value: object): value is MlModelNameResponse; export declare function MlModelNameResponseFromJSON(json: any): MlModelNameResponse; export declare function MlModelNameResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelNameResponse; -export declare function MlModelNameResponseToJSON(value?: MlModelNameResponse | null): any; +export declare function MlModelNameResponseToJSON(json: any): MlModelNameResponse; +export declare function MlModelNameResponseToJSONTyped(value?: MlModelNameResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MlModelNameResponse.js b/typescript/dist/esm/models/MlModelNameResponse.js index f32041ce..3c954dcd 100644 --- a/typescript/dist/esm/models/MlModelNameResponse.js +++ b/typescript/dist/esm/models/MlModelNameResponse.js @@ -15,29 +15,29 @@ * Check if a given object implements the MlModelNameResponse interface. */ export function instanceOfMlModelNameResponse(value) { - let isInstance = true; - isInstance = isInstance && "mlModelName" in value; - return isInstance; + if (!('mlModelName' in value) || value['mlModelName'] === undefined) + return false; + return true; } export function MlModelNameResponseFromJSON(json) { return MlModelNameResponseFromJSONTyped(json, false); } export function MlModelNameResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'mlModelName': json['mlModelName'], }; } -export function MlModelNameResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MlModelNameResponseToJSON(json) { + return MlModelNameResponseToJSONTyped(json, false); +} +export function MlModelNameResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'mlModelName': value.mlModelName, + 'mlModelName': value['mlModelName'], }; } diff --git a/typescript/dist/esm/models/MlModelResource.d.ts b/typescript/dist/esm/models/MlModelResource.d.ts index a72112d5..964b33e5 100644 --- a/typescript/dist/esm/models/MlModelResource.d.ts +++ b/typescript/dist/esm/models/MlModelResource.d.ts @@ -38,7 +38,8 @@ export type MlModelResourceTypeEnum = typeof MlModelResourceTypeEnum[keyof typeo /** * Check if a given object implements the MlModelResource interface. */ -export declare function instanceOfMlModelResource(value: object): boolean; +export declare function instanceOfMlModelResource(value: object): value is MlModelResource; export declare function MlModelResourceFromJSON(json: any): MlModelResource; export declare function MlModelResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelResource; -export declare function MlModelResourceToJSON(value?: MlModelResource | null): any; +export declare function MlModelResourceToJSON(json: any): MlModelResource; +export declare function MlModelResourceToJSONTyped(value?: MlModelResource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MlModelResource.js b/typescript/dist/esm/models/MlModelResource.js index beba5016..d693ac46 100644 --- a/typescript/dist/esm/models/MlModelResource.js +++ b/typescript/dist/esm/models/MlModelResource.js @@ -21,16 +21,17 @@ export const MlModelResourceTypeEnum = { * Check if a given object implements the MlModelResource interface. */ export function instanceOfMlModelResource(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function MlModelResourceFromJSON(json) { return MlModelResourceFromJSONTyped(json, false); } export function MlModelResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,15 +39,15 @@ export function MlModelResourceFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function MlModelResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MlModelResourceToJSON(json) { + return MlModelResourceToJSONTyped(json, false); +} +export function MlModelResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/MockDatasetDataSourceLoadingInfo.d.ts b/typescript/dist/esm/models/MockDatasetDataSourceLoadingInfo.d.ts index 2bf35129..4aaed260 100644 --- a/typescript/dist/esm/models/MockDatasetDataSourceLoadingInfo.d.ts +++ b/typescript/dist/esm/models/MockDatasetDataSourceLoadingInfo.d.ts @@ -26,7 +26,8 @@ export interface MockDatasetDataSourceLoadingInfo { /** * Check if a given object implements the MockDatasetDataSourceLoadingInfo interface. */ -export declare function instanceOfMockDatasetDataSourceLoadingInfo(value: object): boolean; +export declare function instanceOfMockDatasetDataSourceLoadingInfo(value: object): value is MockDatasetDataSourceLoadingInfo; export declare function MockDatasetDataSourceLoadingInfoFromJSON(json: any): MockDatasetDataSourceLoadingInfo; export declare function MockDatasetDataSourceLoadingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): MockDatasetDataSourceLoadingInfo; -export declare function MockDatasetDataSourceLoadingInfoToJSON(value?: MockDatasetDataSourceLoadingInfo | null): any; +export declare function MockDatasetDataSourceLoadingInfoToJSON(json: any): MockDatasetDataSourceLoadingInfo; +export declare function MockDatasetDataSourceLoadingInfoToJSONTyped(value?: MockDatasetDataSourceLoadingInfo | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MockDatasetDataSourceLoadingInfo.js b/typescript/dist/esm/models/MockDatasetDataSourceLoadingInfo.js index 0d9fcf44..1468e498 100644 --- a/typescript/dist/esm/models/MockDatasetDataSourceLoadingInfo.js +++ b/typescript/dist/esm/models/MockDatasetDataSourceLoadingInfo.js @@ -16,29 +16,29 @@ import { Coordinate2DFromJSON, Coordinate2DToJSON, } from './Coordinate2D'; * Check if a given object implements the MockDatasetDataSourceLoadingInfo interface. */ export function instanceOfMockDatasetDataSourceLoadingInfo(value) { - let isInstance = true; - isInstance = isInstance && "points" in value; - return isInstance; + if (!('points' in value) || value['points'] === undefined) + return false; + return true; } export function MockDatasetDataSourceLoadingInfoFromJSON(json) { return MockDatasetDataSourceLoadingInfoFromJSONTyped(json, false); } export function MockDatasetDataSourceLoadingInfoFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'points': (json['points'].map(Coordinate2DFromJSON)), }; } -export function MockDatasetDataSourceLoadingInfoToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MockDatasetDataSourceLoadingInfoToJSON(json) { + return MockDatasetDataSourceLoadingInfoToJSONTyped(json, false); +} +export function MockDatasetDataSourceLoadingInfoToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'points': (value.points.map(Coordinate2DToJSON)), + 'points': (value['points'].map(Coordinate2DToJSON)), }; } diff --git a/typescript/dist/esm/models/MockMetaData.d.ts b/typescript/dist/esm/models/MockMetaData.d.ts index e36586fb..06c65faa 100644 --- a/typescript/dist/esm/models/MockMetaData.d.ts +++ b/typescript/dist/esm/models/MockMetaData.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { MockDatasetDataSourceLoadingInfo } from './MockDatasetDataSourceLoadingInfo'; import type { VectorResultDescriptor } from './VectorResultDescriptor'; +import type { MockDatasetDataSourceLoadingInfo } from './MockDatasetDataSourceLoadingInfo'; /** * * @export @@ -41,17 +41,13 @@ export interface MockMetaData { */ export declare const MockMetaDataTypeEnum: { readonly MockMetaData: "MockMetaData"; - readonly OgrMetaData: "OgrMetaData"; - readonly GdalMetaDataRegular: "GdalMetaDataRegular"; - readonly GdalStatic: "GdalStatic"; - readonly GdalMetadataNetCdfCf: "GdalMetadataNetCdfCf"; - readonly GdalMetaDataList: "GdalMetaDataList"; }; export type MockMetaDataTypeEnum = typeof MockMetaDataTypeEnum[keyof typeof MockMetaDataTypeEnum]; /** * Check if a given object implements the MockMetaData interface. */ -export declare function instanceOfMockMetaData(value: object): boolean; +export declare function instanceOfMockMetaData(value: object): value is MockMetaData; export declare function MockMetaDataFromJSON(json: any): MockMetaData; export declare function MockMetaDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): MockMetaData; -export declare function MockMetaDataToJSON(value?: MockMetaData | null): any; +export declare function MockMetaDataToJSON(json: any): MockMetaData; +export declare function MockMetaDataToJSONTyped(value?: MockMetaData | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MockMetaData.js b/typescript/dist/esm/models/MockMetaData.js index e202081b..dbb469ae 100644 --- a/typescript/dist/esm/models/MockMetaData.js +++ b/typescript/dist/esm/models/MockMetaData.js @@ -11,34 +11,31 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { MockDatasetDataSourceLoadingInfoFromJSON, MockDatasetDataSourceLoadingInfoToJSON, } from './MockDatasetDataSourceLoadingInfo'; import { VectorResultDescriptorFromJSON, VectorResultDescriptorToJSON, } from './VectorResultDescriptor'; +import { MockDatasetDataSourceLoadingInfoFromJSON, MockDatasetDataSourceLoadingInfoToJSON, } from './MockDatasetDataSourceLoadingInfo'; /** * @export */ export const MockMetaDataTypeEnum = { - MockMetaData: 'MockMetaData', - OgrMetaData: 'OgrMetaData', - GdalMetaDataRegular: 'GdalMetaDataRegular', - GdalStatic: 'GdalStatic', - GdalMetadataNetCdfCf: 'GdalMetadataNetCdfCf', - GdalMetaDataList: 'GdalMetaDataList' + MockMetaData: 'MockMetaData' }; /** * Check if a given object implements the MockMetaData interface. */ export function instanceOfMockMetaData(value) { - let isInstance = true; - isInstance = isInstance && "loadingInfo" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('loadingInfo' in value) || value['loadingInfo'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function MockMetaDataFromJSON(json) { return MockMetaDataFromJSONTyped(json, false); } export function MockMetaDataFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -47,16 +44,16 @@ export function MockMetaDataFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function MockMetaDataToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MockMetaDataToJSON(json) { + return MockMetaDataToJSONTyped(json, false); +} +export function MockMetaDataToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'loadingInfo': MockDatasetDataSourceLoadingInfoToJSON(value.loadingInfo), - 'resultDescriptor': VectorResultDescriptorToJSON(value.resultDescriptor), - 'type': value.type, + 'loadingInfo': MockDatasetDataSourceLoadingInfoToJSON(value['loadingInfo']), + 'resultDescriptor': VectorResultDescriptorToJSON(value['resultDescriptor']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/MultiBandRasterColorizer.d.ts b/typescript/dist/esm/models/MultiBandRasterColorizer.d.ts index c80dbea0..a937f8e1 100644 --- a/typescript/dist/esm/models/MultiBandRasterColorizer.d.ts +++ b/typescript/dist/esm/models/MultiBandRasterColorizer.d.ts @@ -110,7 +110,8 @@ export type MultiBandRasterColorizerTypeEnum = typeof MultiBandRasterColorizerTy /** * Check if a given object implements the MultiBandRasterColorizer interface. */ -export declare function instanceOfMultiBandRasterColorizer(value: object): boolean; +export declare function instanceOfMultiBandRasterColorizer(value: object): value is MultiBandRasterColorizer; export declare function MultiBandRasterColorizerFromJSON(json: any): MultiBandRasterColorizer; export declare function MultiBandRasterColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiBandRasterColorizer; -export declare function MultiBandRasterColorizerToJSON(value?: MultiBandRasterColorizer | null): any; +export declare function MultiBandRasterColorizerToJSON(json: any): MultiBandRasterColorizer; +export declare function MultiBandRasterColorizerToJSONTyped(value?: MultiBandRasterColorizer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MultiBandRasterColorizer.js b/typescript/dist/esm/models/MultiBandRasterColorizer.js index 292199b4..b2c1725c 100644 --- a/typescript/dist/esm/models/MultiBandRasterColorizer.js +++ b/typescript/dist/esm/models/MultiBandRasterColorizer.js @@ -11,7 +11,6 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * @export */ @@ -22,64 +21,73 @@ export const MultiBandRasterColorizerTypeEnum = { * Check if a given object implements the MultiBandRasterColorizer interface. */ export function instanceOfMultiBandRasterColorizer(value) { - let isInstance = true; - isInstance = isInstance && "blueBand" in value; - isInstance = isInstance && "blueMax" in value; - isInstance = isInstance && "blueMin" in value; - isInstance = isInstance && "greenBand" in value; - isInstance = isInstance && "greenMax" in value; - isInstance = isInstance && "greenMin" in value; - isInstance = isInstance && "redBand" in value; - isInstance = isInstance && "redMax" in value; - isInstance = isInstance && "redMin" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('blueBand' in value) || value['blueBand'] === undefined) + return false; + if (!('blueMax' in value) || value['blueMax'] === undefined) + return false; + if (!('blueMin' in value) || value['blueMin'] === undefined) + return false; + if (!('greenBand' in value) || value['greenBand'] === undefined) + return false; + if (!('greenMax' in value) || value['greenMax'] === undefined) + return false; + if (!('greenMin' in value) || value['greenMin'] === undefined) + return false; + if (!('redBand' in value) || value['redBand'] === undefined) + return false; + if (!('redMax' in value) || value['redMax'] === undefined) + return false; + if (!('redMin' in value) || value['redMin'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function MultiBandRasterColorizerFromJSON(json) { return MultiBandRasterColorizerFromJSONTyped(json, false); } export function MultiBandRasterColorizerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'blueBand': json['blueBand'], 'blueMax': json['blueMax'], 'blueMin': json['blueMin'], - 'blueScale': !exists(json, 'blueScale') ? undefined : json['blueScale'], + 'blueScale': json['blueScale'] == null ? undefined : json['blueScale'], 'greenBand': json['greenBand'], 'greenMax': json['greenMax'], 'greenMin': json['greenMin'], - 'greenScale': !exists(json, 'greenScale') ? undefined : json['greenScale'], - 'noDataColor': !exists(json, 'noDataColor') ? undefined : json['noDataColor'], + 'greenScale': json['greenScale'] == null ? undefined : json['greenScale'], + 'noDataColor': json['noDataColor'] == null ? undefined : json['noDataColor'], 'redBand': json['redBand'], 'redMax': json['redMax'], 'redMin': json['redMin'], - 'redScale': !exists(json, 'redScale') ? undefined : json['redScale'], + 'redScale': json['redScale'] == null ? undefined : json['redScale'], 'type': json['type'], }; } -export function MultiBandRasterColorizerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MultiBandRasterColorizerToJSON(json) { + return MultiBandRasterColorizerToJSONTyped(json, false); +} +export function MultiBandRasterColorizerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'blueBand': value.blueBand, - 'blueMax': value.blueMax, - 'blueMin': value.blueMin, - 'blueScale': value.blueScale, - 'greenBand': value.greenBand, - 'greenMax': value.greenMax, - 'greenMin': value.greenMin, - 'greenScale': value.greenScale, - 'noDataColor': value.noDataColor, - 'redBand': value.redBand, - 'redMax': value.redMax, - 'redMin': value.redMin, - 'redScale': value.redScale, - 'type': value.type, + 'blueBand': value['blueBand'], + 'blueMax': value['blueMax'], + 'blueMin': value['blueMin'], + 'blueScale': value['blueScale'], + 'greenBand': value['greenBand'], + 'greenMax': value['greenMax'], + 'greenMin': value['greenMin'], + 'greenScale': value['greenScale'], + 'noDataColor': value['noDataColor'], + 'redBand': value['redBand'], + 'redMax': value['redMax'], + 'redMin': value['redMin'], + 'redScale': value['redScale'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/MultiLineString.d.ts b/typescript/dist/esm/models/MultiLineString.d.ts index 337af6e5..f9f4be33 100644 --- a/typescript/dist/esm/models/MultiLineString.d.ts +++ b/typescript/dist/esm/models/MultiLineString.d.ts @@ -26,7 +26,8 @@ export interface MultiLineString { /** * Check if a given object implements the MultiLineString interface. */ -export declare function instanceOfMultiLineString(value: object): boolean; +export declare function instanceOfMultiLineString(value: object): value is MultiLineString; export declare function MultiLineStringFromJSON(json: any): MultiLineString; export declare function MultiLineStringFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiLineString; -export declare function MultiLineStringToJSON(value?: MultiLineString | null): any; +export declare function MultiLineStringToJSON(json: any): MultiLineString; +export declare function MultiLineStringToJSONTyped(value?: MultiLineString | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MultiLineString.js b/typescript/dist/esm/models/MultiLineString.js index 4703b56c..8eaf2809 100644 --- a/typescript/dist/esm/models/MultiLineString.js +++ b/typescript/dist/esm/models/MultiLineString.js @@ -15,29 +15,29 @@ * Check if a given object implements the MultiLineString interface. */ export function instanceOfMultiLineString(value) { - let isInstance = true; - isInstance = isInstance && "coordinates" in value; - return isInstance; + if (!('coordinates' in value) || value['coordinates'] === undefined) + return false; + return true; } export function MultiLineStringFromJSON(json) { return MultiLineStringFromJSONTyped(json, false); } export function MultiLineStringFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'coordinates': json['coordinates'], }; } -export function MultiLineStringToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MultiLineStringToJSON(json) { + return MultiLineStringToJSONTyped(json, false); +} +export function MultiLineStringToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'coordinates': value.coordinates, + 'coordinates': value['coordinates'], }; } diff --git a/typescript/dist/esm/models/MultiPoint.d.ts b/typescript/dist/esm/models/MultiPoint.d.ts index 80e81b17..28b2c040 100644 --- a/typescript/dist/esm/models/MultiPoint.d.ts +++ b/typescript/dist/esm/models/MultiPoint.d.ts @@ -26,7 +26,8 @@ export interface MultiPoint { /** * Check if a given object implements the MultiPoint interface. */ -export declare function instanceOfMultiPoint(value: object): boolean; +export declare function instanceOfMultiPoint(value: object): value is MultiPoint; export declare function MultiPointFromJSON(json: any): MultiPoint; export declare function MultiPointFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiPoint; -export declare function MultiPointToJSON(value?: MultiPoint | null): any; +export declare function MultiPointToJSON(json: any): MultiPoint; +export declare function MultiPointToJSONTyped(value?: MultiPoint | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MultiPoint.js b/typescript/dist/esm/models/MultiPoint.js index 722bd401..b2b3b005 100644 --- a/typescript/dist/esm/models/MultiPoint.js +++ b/typescript/dist/esm/models/MultiPoint.js @@ -16,29 +16,29 @@ import { Coordinate2DFromJSON, Coordinate2DToJSON, } from './Coordinate2D'; * Check if a given object implements the MultiPoint interface. */ export function instanceOfMultiPoint(value) { - let isInstance = true; - isInstance = isInstance && "coordinates" in value; - return isInstance; + if (!('coordinates' in value) || value['coordinates'] === undefined) + return false; + return true; } export function MultiPointFromJSON(json) { return MultiPointFromJSONTyped(json, false); } export function MultiPointFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'coordinates': (json['coordinates'].map(Coordinate2DFromJSON)), }; } -export function MultiPointToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MultiPointToJSON(json) { + return MultiPointToJSONTyped(json, false); +} +export function MultiPointToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'coordinates': (value.coordinates.map(Coordinate2DToJSON)), + 'coordinates': (value['coordinates'].map(Coordinate2DToJSON)), }; } diff --git a/typescript/dist/esm/models/MultiPolygon.d.ts b/typescript/dist/esm/models/MultiPolygon.d.ts index e6dbe06d..1055bc0b 100644 --- a/typescript/dist/esm/models/MultiPolygon.d.ts +++ b/typescript/dist/esm/models/MultiPolygon.d.ts @@ -26,7 +26,8 @@ export interface MultiPolygon { /** * Check if a given object implements the MultiPolygon interface. */ -export declare function instanceOfMultiPolygon(value: object): boolean; +export declare function instanceOfMultiPolygon(value: object): value is MultiPolygon; export declare function MultiPolygonFromJSON(json: any): MultiPolygon; export declare function MultiPolygonFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiPolygon; -export declare function MultiPolygonToJSON(value?: MultiPolygon | null): any; +export declare function MultiPolygonToJSON(json: any): MultiPolygon; +export declare function MultiPolygonToJSONTyped(value?: MultiPolygon | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/MultiPolygon.js b/typescript/dist/esm/models/MultiPolygon.js index c5943c8e..443bb540 100644 --- a/typescript/dist/esm/models/MultiPolygon.js +++ b/typescript/dist/esm/models/MultiPolygon.js @@ -15,29 +15,29 @@ * Check if a given object implements the MultiPolygon interface. */ export function instanceOfMultiPolygon(value) { - let isInstance = true; - isInstance = isInstance && "polygons" in value; - return isInstance; + if (!('polygons' in value) || value['polygons'] === undefined) + return false; + return true; } export function MultiPolygonFromJSON(json) { return MultiPolygonFromJSONTyped(json, false); } export function MultiPolygonFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'polygons': json['polygons'], }; } -export function MultiPolygonToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MultiPolygonToJSON(json) { + return MultiPolygonToJSONTyped(json, false); +} +export function MultiPolygonToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'polygons': value.polygons, + 'polygons': value['polygons'], }; } diff --git a/typescript/dist/esm/models/NumberParam.d.ts b/typescript/dist/esm/models/NumberParam.d.ts index 333d7c0c..b142db7b 100644 --- a/typescript/dist/esm/models/NumberParam.d.ts +++ b/typescript/dist/esm/models/NumberParam.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DerivedNumber } from './DerivedNumber'; -import { StaticNumberParam } from './StaticNumberParam'; +import type { DerivedNumber } from './DerivedNumber'; +import type { StaticNumberParam } from './StaticNumberParam'; /** * @type NumberParam * @@ -23,4 +23,5 @@ export type NumberParam = { } & StaticNumberParam; export declare function NumberParamFromJSON(json: any): NumberParam; export declare function NumberParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): NumberParam; -export declare function NumberParamToJSON(value?: NumberParam | null): any; +export declare function NumberParamToJSON(json: any): any; +export declare function NumberParamToJSONTyped(value?: NumberParam | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/NumberParam.js b/typescript/dist/esm/models/NumberParam.js index d9662321..c93dcead 100644 --- a/typescript/dist/esm/models/NumberParam.js +++ b/typescript/dist/esm/models/NumberParam.js @@ -17,30 +17,30 @@ export function NumberParamFromJSON(json) { return NumberParamFromJSONTyped(json, false); } export function NumberParamFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'derived': - return Object.assign(Object.assign({}, DerivedNumberFromJSONTyped(json, true)), { type: 'derived' }); + return Object.assign({}, DerivedNumberFromJSONTyped(json, true), { type: 'derived' }); case 'static': - return Object.assign(Object.assign({}, StaticNumberParamFromJSONTyped(json, true)), { type: 'static' }); + return Object.assign({}, StaticNumberParamFromJSONTyped(json, true), { type: 'static' }); default: throw new Error(`No variant of NumberParam exists with 'type=${json['type']}'`); } } -export function NumberParamToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function NumberParamToJSON(json) { + return NumberParamToJSONTyped(json, false); +} +export function NumberParamToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'derived': - return DerivedNumberToJSON(value); + return Object.assign({}, DerivedNumberToJSON(value), { type: 'derived' }); case 'static': - return StaticNumberParamToJSON(value); + return Object.assign({}, StaticNumberParamToJSON(value), { type: 'static' }); default: throw new Error(`No variant of NumberParam exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/OgrMetaData.d.ts b/typescript/dist/esm/models/OgrMetaData.d.ts index c6059211..d1ac707b 100644 --- a/typescript/dist/esm/models/OgrMetaData.d.ts +++ b/typescript/dist/esm/models/OgrMetaData.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { OgrSourceDataset } from './OgrSourceDataset'; import type { VectorResultDescriptor } from './VectorResultDescriptor'; +import type { OgrSourceDataset } from './OgrSourceDataset'; /** * * @export @@ -46,7 +46,8 @@ export type OgrMetaDataTypeEnum = typeof OgrMetaDataTypeEnum[keyof typeof OgrMet /** * Check if a given object implements the OgrMetaData interface. */ -export declare function instanceOfOgrMetaData(value: object): boolean; +export declare function instanceOfOgrMetaData(value: object): value is OgrMetaData; export declare function OgrMetaDataFromJSON(json: any): OgrMetaData; export declare function OgrMetaDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrMetaData; -export declare function OgrMetaDataToJSON(value?: OgrMetaData | null): any; +export declare function OgrMetaDataToJSON(json: any): OgrMetaData; +export declare function OgrMetaDataToJSONTyped(value?: OgrMetaData | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrMetaData.js b/typescript/dist/esm/models/OgrMetaData.js index 0f521c4f..9d291fe2 100644 --- a/typescript/dist/esm/models/OgrMetaData.js +++ b/typescript/dist/esm/models/OgrMetaData.js @@ -11,8 +11,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { OgrSourceDatasetFromJSON, OgrSourceDatasetToJSON, } from './OgrSourceDataset'; import { VectorResultDescriptorFromJSON, VectorResultDescriptorToJSON, } from './VectorResultDescriptor'; +import { OgrSourceDatasetFromJSON, OgrSourceDatasetToJSON, } from './OgrSourceDataset'; /** * @export */ @@ -23,17 +23,19 @@ export const OgrMetaDataTypeEnum = { * Check if a given object implements the OgrMetaData interface. */ export function instanceOfOgrMetaData(value) { - let isInstance = true; - isInstance = isInstance && "loadingInfo" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('loadingInfo' in value) || value['loadingInfo'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function OgrMetaDataFromJSON(json) { return OgrMetaDataFromJSONTyped(json, false); } export function OgrMetaDataFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,16 +44,16 @@ export function OgrMetaDataFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function OgrMetaDataToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrMetaDataToJSON(json) { + return OgrMetaDataToJSONTyped(json, false); +} +export function OgrMetaDataToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'loadingInfo': OgrSourceDatasetToJSON(value.loadingInfo), - 'resultDescriptor': VectorResultDescriptorToJSON(value.resultDescriptor), - 'type': value.type, + 'loadingInfo': OgrSourceDatasetToJSON(value['loadingInfo']), + 'resultDescriptor': VectorResultDescriptorToJSON(value['resultDescriptor']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/OgrSourceColumnSpec.d.ts b/typescript/dist/esm/models/OgrSourceColumnSpec.d.ts index f7c7d44a..07ea4385 100644 --- a/typescript/dist/esm/models/OgrSourceColumnSpec.d.ts +++ b/typescript/dist/esm/models/OgrSourceColumnSpec.d.ts @@ -76,7 +76,8 @@ export interface OgrSourceColumnSpec { /** * Check if a given object implements the OgrSourceColumnSpec interface. */ -export declare function instanceOfOgrSourceColumnSpec(value: object): boolean; +export declare function instanceOfOgrSourceColumnSpec(value: object): value is OgrSourceColumnSpec; export declare function OgrSourceColumnSpecFromJSON(json: any): OgrSourceColumnSpec; export declare function OgrSourceColumnSpecFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceColumnSpec; -export declare function OgrSourceColumnSpecToJSON(value?: OgrSourceColumnSpec | null): any; +export declare function OgrSourceColumnSpecToJSON(json: any): OgrSourceColumnSpec; +export declare function OgrSourceColumnSpecToJSONTyped(value?: OgrSourceColumnSpec | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceColumnSpec.js b/typescript/dist/esm/models/OgrSourceColumnSpec.js index 0c7b3f82..98c80674 100644 --- a/typescript/dist/esm/models/OgrSourceColumnSpec.js +++ b/typescript/dist/esm/models/OgrSourceColumnSpec.js @@ -11,51 +11,50 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { FormatSpecificsFromJSON, FormatSpecificsToJSON, } from './FormatSpecifics'; /** * Check if a given object implements the OgrSourceColumnSpec interface. */ export function instanceOfOgrSourceColumnSpec(value) { - let isInstance = true; - isInstance = isInstance && "x" in value; - return isInstance; + if (!('x' in value) || value['x'] === undefined) + return false; + return true; } export function OgrSourceColumnSpecFromJSON(json) { return OgrSourceColumnSpecFromJSONTyped(json, false); } export function OgrSourceColumnSpecFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bool': !exists(json, 'bool') ? undefined : json['bool'], - 'datetime': !exists(json, 'datetime') ? undefined : json['datetime'], - '_float': !exists(json, 'float') ? undefined : json['float'], - 'formatSpecifics': !exists(json, 'formatSpecifics') ? undefined : FormatSpecificsFromJSON(json['formatSpecifics']), - '_int': !exists(json, 'int') ? undefined : json['int'], - 'rename': !exists(json, 'rename') ? undefined : json['rename'], - 'text': !exists(json, 'text') ? undefined : json['text'], + 'bool': json['bool'] == null ? undefined : json['bool'], + 'datetime': json['datetime'] == null ? undefined : json['datetime'], + '_float': json['float'] == null ? undefined : json['float'], + 'formatSpecifics': json['formatSpecifics'] == null ? undefined : FormatSpecificsFromJSON(json['formatSpecifics']), + '_int': json['int'] == null ? undefined : json['int'], + 'rename': json['rename'] == null ? undefined : json['rename'], + 'text': json['text'] == null ? undefined : json['text'], 'x': json['x'], - 'y': !exists(json, 'y') ? undefined : json['y'], + 'y': json['y'] == null ? undefined : json['y'], }; } -export function OgrSourceColumnSpecToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceColumnSpecToJSON(json) { + return OgrSourceColumnSpecToJSONTyped(json, false); +} +export function OgrSourceColumnSpecToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bool': value.bool, - 'datetime': value.datetime, - 'float': value._float, - 'formatSpecifics': FormatSpecificsToJSON(value.formatSpecifics), - 'int': value._int, - 'rename': value.rename, - 'text': value.text, - 'x': value.x, - 'y': value.y, + 'bool': value['bool'], + 'datetime': value['datetime'], + 'float': value['_float'], + 'formatSpecifics': FormatSpecificsToJSON(value['formatSpecifics']), + 'int': value['_int'], + 'rename': value['rename'], + 'text': value['text'], + 'x': value['x'], + 'y': value['y'], }; } diff --git a/typescript/dist/esm/models/OgrSourceDataset.d.ts b/typescript/dist/esm/models/OgrSourceDataset.d.ts index 6e5b7de6..3575bd77 100644 --- a/typescript/dist/esm/models/OgrSourceDataset.d.ts +++ b/typescript/dist/esm/models/OgrSourceDataset.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { OgrSourceColumnSpec } from './OgrSourceColumnSpec'; -import type { OgrSourceDatasetTimeType } from './OgrSourceDatasetTimeType'; import type { OgrSourceErrorSpec } from './OgrSourceErrorSpec'; -import type { TypedGeometry } from './TypedGeometry'; import type { VectorDataType } from './VectorDataType'; +import type { TypedGeometry } from './TypedGeometry'; +import type { OgrSourceColumnSpec } from './OgrSourceColumnSpec'; +import type { OgrSourceDatasetTimeType } from './OgrSourceDatasetTimeType'; /** * * @export @@ -96,7 +96,8 @@ export interface OgrSourceDataset { /** * Check if a given object implements the OgrSourceDataset interface. */ -export declare function instanceOfOgrSourceDataset(value: object): boolean; +export declare function instanceOfOgrSourceDataset(value: object): value is OgrSourceDataset; export declare function OgrSourceDatasetFromJSON(json: any): OgrSourceDataset; export declare function OgrSourceDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDataset; -export declare function OgrSourceDatasetToJSON(value?: OgrSourceDataset | null): any; +export declare function OgrSourceDatasetToJSON(json: any): OgrSourceDataset; +export declare function OgrSourceDatasetToJSONTyped(value?: OgrSourceDataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceDataset.js b/typescript/dist/esm/models/OgrSourceDataset.js index bcfb9803..c0eb1818 100644 --- a/typescript/dist/esm/models/OgrSourceDataset.js +++ b/typescript/dist/esm/models/OgrSourceDataset.js @@ -11,63 +11,64 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { OgrSourceColumnSpecFromJSON, OgrSourceColumnSpecToJSON, } from './OgrSourceColumnSpec'; -import { OgrSourceDatasetTimeTypeFromJSON, OgrSourceDatasetTimeTypeToJSON, } from './OgrSourceDatasetTimeType'; import { OgrSourceErrorSpecFromJSON, OgrSourceErrorSpecToJSON, } from './OgrSourceErrorSpec'; -import { TypedGeometryFromJSON, TypedGeometryToJSON, } from './TypedGeometry'; import { VectorDataTypeFromJSON, VectorDataTypeToJSON, } from './VectorDataType'; +import { TypedGeometryFromJSON, TypedGeometryToJSON, } from './TypedGeometry'; +import { OgrSourceColumnSpecFromJSON, OgrSourceColumnSpecToJSON, } from './OgrSourceColumnSpec'; +import { OgrSourceDatasetTimeTypeFromJSON, OgrSourceDatasetTimeTypeToJSON, } from './OgrSourceDatasetTimeType'; /** * Check if a given object implements the OgrSourceDataset interface. */ export function instanceOfOgrSourceDataset(value) { - let isInstance = true; - isInstance = isInstance && "fileName" in value; - isInstance = isInstance && "layerName" in value; - isInstance = isInstance && "onError" in value; - return isInstance; + if (!('fileName' in value) || value['fileName'] === undefined) + return false; + if (!('layerName' in value) || value['layerName'] === undefined) + return false; + if (!('onError' in value) || value['onError'] === undefined) + return false; + return true; } export function OgrSourceDatasetFromJSON(json) { return OgrSourceDatasetFromJSONTyped(json, false); } export function OgrSourceDatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'attributeQuery': !exists(json, 'attributeQuery') ? undefined : json['attributeQuery'], - 'cacheTtl': !exists(json, 'cacheTtl') ? undefined : json['cacheTtl'], - 'columns': !exists(json, 'columns') ? undefined : OgrSourceColumnSpecFromJSON(json['columns']), - 'dataType': !exists(json, 'dataType') ? undefined : VectorDataTypeFromJSON(json['dataType']), - 'defaultGeometry': !exists(json, 'defaultGeometry') ? undefined : TypedGeometryFromJSON(json['defaultGeometry']), + 'attributeQuery': json['attributeQuery'] == null ? undefined : json['attributeQuery'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], + 'columns': json['columns'] == null ? undefined : OgrSourceColumnSpecFromJSON(json['columns']), + 'dataType': json['dataType'] == null ? undefined : VectorDataTypeFromJSON(json['dataType']), + 'defaultGeometry': json['defaultGeometry'] == null ? undefined : TypedGeometryFromJSON(json['defaultGeometry']), 'fileName': json['fileName'], - 'forceOgrSpatialFilter': !exists(json, 'forceOgrSpatialFilter') ? undefined : json['forceOgrSpatialFilter'], - 'forceOgrTimeFilter': !exists(json, 'forceOgrTimeFilter') ? undefined : json['forceOgrTimeFilter'], + 'forceOgrSpatialFilter': json['forceOgrSpatialFilter'] == null ? undefined : json['forceOgrSpatialFilter'], + 'forceOgrTimeFilter': json['forceOgrTimeFilter'] == null ? undefined : json['forceOgrTimeFilter'], 'layerName': json['layerName'], 'onError': OgrSourceErrorSpecFromJSON(json['onError']), - 'sqlQuery': !exists(json, 'sqlQuery') ? undefined : json['sqlQuery'], - 'time': !exists(json, 'time') ? undefined : OgrSourceDatasetTimeTypeFromJSON(json['time']), + 'sqlQuery': json['sqlQuery'] == null ? undefined : json['sqlQuery'], + 'time': json['time'] == null ? undefined : OgrSourceDatasetTimeTypeFromJSON(json['time']), }; } -export function OgrSourceDatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetToJSON(json) { + return OgrSourceDatasetToJSONTyped(json, false); +} +export function OgrSourceDatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'attributeQuery': value.attributeQuery, - 'cacheTtl': value.cacheTtl, - 'columns': OgrSourceColumnSpecToJSON(value.columns), - 'dataType': VectorDataTypeToJSON(value.dataType), - 'defaultGeometry': TypedGeometryToJSON(value.defaultGeometry), - 'fileName': value.fileName, - 'forceOgrSpatialFilter': value.forceOgrSpatialFilter, - 'forceOgrTimeFilter': value.forceOgrTimeFilter, - 'layerName': value.layerName, - 'onError': OgrSourceErrorSpecToJSON(value.onError), - 'sqlQuery': value.sqlQuery, - 'time': OgrSourceDatasetTimeTypeToJSON(value.time), + 'attributeQuery': value['attributeQuery'], + 'cacheTtl': value['cacheTtl'], + 'columns': OgrSourceColumnSpecToJSON(value['columns']), + 'dataType': VectorDataTypeToJSON(value['dataType']), + 'defaultGeometry': TypedGeometryToJSON(value['defaultGeometry']), + 'fileName': value['fileName'], + 'forceOgrSpatialFilter': value['forceOgrSpatialFilter'], + 'forceOgrTimeFilter': value['forceOgrTimeFilter'], + 'layerName': value['layerName'], + 'onError': OgrSourceErrorSpecToJSON(value['onError']), + 'sqlQuery': value['sqlQuery'], + 'time': OgrSourceDatasetTimeTypeToJSON(value['time']), }; } diff --git a/typescript/dist/esm/models/OgrSourceDatasetTimeType.d.ts b/typescript/dist/esm/models/OgrSourceDatasetTimeType.d.ts index 51015e5d..38c8ecda 100644 --- a/typescript/dist/esm/models/OgrSourceDatasetTimeType.d.ts +++ b/typescript/dist/esm/models/OgrSourceDatasetTimeType.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { OgrSourceDatasetTimeTypeNone } from './OgrSourceDatasetTimeTypeNone'; -import { OgrSourceDatasetTimeTypeStart } from './OgrSourceDatasetTimeTypeStart'; -import { OgrSourceDatasetTimeTypeStartDuration } from './OgrSourceDatasetTimeTypeStartDuration'; -import { OgrSourceDatasetTimeTypeStartEnd } from './OgrSourceDatasetTimeTypeStartEnd'; +import type { OgrSourceDatasetTimeTypeNone } from './OgrSourceDatasetTimeTypeNone'; +import type { OgrSourceDatasetTimeTypeStart } from './OgrSourceDatasetTimeTypeStart'; +import type { OgrSourceDatasetTimeTypeStartDuration } from './OgrSourceDatasetTimeTypeStartDuration'; +import type { OgrSourceDatasetTimeTypeStartEnd } from './OgrSourceDatasetTimeTypeStartEnd'; /** * @type OgrSourceDatasetTimeType * @@ -29,4 +29,5 @@ export type OgrSourceDatasetTimeType = { } & OgrSourceDatasetTimeTypeStartEnd; export declare function OgrSourceDatasetTimeTypeFromJSON(json: any): OgrSourceDatasetTimeType; export declare function OgrSourceDatasetTimeTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeType; -export declare function OgrSourceDatasetTimeTypeToJSON(value?: OgrSourceDatasetTimeType | null): any; +export declare function OgrSourceDatasetTimeTypeToJSON(json: any): any; +export declare function OgrSourceDatasetTimeTypeToJSONTyped(value?: OgrSourceDatasetTimeType | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceDatasetTimeType.js b/typescript/dist/esm/models/OgrSourceDatasetTimeType.js index e763a0a0..a82dd34d 100644 --- a/typescript/dist/esm/models/OgrSourceDatasetTimeType.js +++ b/typescript/dist/esm/models/OgrSourceDatasetTimeType.js @@ -19,38 +19,38 @@ export function OgrSourceDatasetTimeTypeFromJSON(json) { return OgrSourceDatasetTimeTypeFromJSONTyped(json, false); } export function OgrSourceDatasetTimeTypeFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'none': - return Object.assign(Object.assign({}, OgrSourceDatasetTimeTypeNoneFromJSONTyped(json, true)), { type: 'none' }); + return Object.assign({}, OgrSourceDatasetTimeTypeNoneFromJSONTyped(json, true), { type: 'none' }); case 'start': - return Object.assign(Object.assign({}, OgrSourceDatasetTimeTypeStartFromJSONTyped(json, true)), { type: 'start' }); + return Object.assign({}, OgrSourceDatasetTimeTypeStartFromJSONTyped(json, true), { type: 'start' }); case 'start+duration': - return Object.assign(Object.assign({}, OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json, true)), { type: 'start+duration' }); + return Object.assign({}, OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json, true), { type: 'start+duration' }); case 'start+end': - return Object.assign(Object.assign({}, OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json, true)), { type: 'start+end' }); + return Object.assign({}, OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json, true), { type: 'start+end' }); default: throw new Error(`No variant of OgrSourceDatasetTimeType exists with 'type=${json['type']}'`); } } -export function OgrSourceDatasetTimeTypeToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetTimeTypeToJSON(json) { + return OgrSourceDatasetTimeTypeToJSONTyped(json, false); +} +export function OgrSourceDatasetTimeTypeToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'none': - return OgrSourceDatasetTimeTypeNoneToJSON(value); + return Object.assign({}, OgrSourceDatasetTimeTypeNoneToJSON(value), { type: 'none' }); case 'start': - return OgrSourceDatasetTimeTypeStartToJSON(value); + return Object.assign({}, OgrSourceDatasetTimeTypeStartToJSON(value), { type: 'start' }); case 'start+duration': - return OgrSourceDatasetTimeTypeStartDurationToJSON(value); + return Object.assign({}, OgrSourceDatasetTimeTypeStartDurationToJSON(value), { type: 'start+duration' }); case 'start+end': - return OgrSourceDatasetTimeTypeStartEndToJSON(value); + return Object.assign({}, OgrSourceDatasetTimeTypeStartEndToJSON(value), { type: 'start+end' }); default: throw new Error(`No variant of OgrSourceDatasetTimeType exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeNone.d.ts b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeNone.d.ts index 203a9b35..01edfb5a 100644 --- a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeNone.d.ts +++ b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeNone.d.ts @@ -27,15 +27,13 @@ export interface OgrSourceDatasetTimeTypeNone { */ export declare const OgrSourceDatasetTimeTypeNoneTypeEnum: { readonly None: "none"; - readonly Start: "start"; - readonly Startend: "start+end"; - readonly Startduration: "start+duration"; }; export type OgrSourceDatasetTimeTypeNoneTypeEnum = typeof OgrSourceDatasetTimeTypeNoneTypeEnum[keyof typeof OgrSourceDatasetTimeTypeNoneTypeEnum]; /** * Check if a given object implements the OgrSourceDatasetTimeTypeNone interface. */ -export declare function instanceOfOgrSourceDatasetTimeTypeNone(value: object): boolean; +export declare function instanceOfOgrSourceDatasetTimeTypeNone(value: object): value is OgrSourceDatasetTimeTypeNone; export declare function OgrSourceDatasetTimeTypeNoneFromJSON(json: any): OgrSourceDatasetTimeTypeNone; export declare function OgrSourceDatasetTimeTypeNoneFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeNone; -export declare function OgrSourceDatasetTimeTypeNoneToJSON(value?: OgrSourceDatasetTimeTypeNone | null): any; +export declare function OgrSourceDatasetTimeTypeNoneToJSON(json: any): OgrSourceDatasetTimeTypeNone; +export declare function OgrSourceDatasetTimeTypeNoneToJSONTyped(value?: OgrSourceDatasetTimeTypeNone | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeNone.js b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeNone.js index a07e7154..00f81cd3 100644 --- a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeNone.js +++ b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeNone.js @@ -15,38 +15,35 @@ * @export */ export const OgrSourceDatasetTimeTypeNoneTypeEnum = { - None: 'none', - Start: 'start', - Startend: 'start+end', - Startduration: 'start+duration' + None: 'none' }; /** * Check if a given object implements the OgrSourceDatasetTimeTypeNone interface. */ export function instanceOfOgrSourceDatasetTimeTypeNone(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function OgrSourceDatasetTimeTypeNoneFromJSON(json) { return OgrSourceDatasetTimeTypeNoneFromJSONTyped(json, false); } export function OgrSourceDatasetTimeTypeNoneFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'type': json['type'], }; } -export function OgrSourceDatasetTimeTypeNoneToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetTimeTypeNoneToJSON(json) { + return OgrSourceDatasetTimeTypeNoneToJSONTyped(json, false); +} +export function OgrSourceDatasetTimeTypeNoneToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'type': value.type, + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStart.d.ts b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStart.d.ts index 531be6c5..c8129475 100644 --- a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStart.d.ts +++ b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStart.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { OgrSourceDurationSpec } from './OgrSourceDurationSpec'; import type { OgrSourceTimeFormat } from './OgrSourceTimeFormat'; +import type { OgrSourceDurationSpec } from './OgrSourceDurationSpec'; /** * * @export @@ -52,7 +52,8 @@ export type OgrSourceDatasetTimeTypeStartTypeEnum = typeof OgrSourceDatasetTimeT /** * Check if a given object implements the OgrSourceDatasetTimeTypeStart interface. */ -export declare function instanceOfOgrSourceDatasetTimeTypeStart(value: object): boolean; +export declare function instanceOfOgrSourceDatasetTimeTypeStart(value: object): value is OgrSourceDatasetTimeTypeStart; export declare function OgrSourceDatasetTimeTypeStartFromJSON(json: any): OgrSourceDatasetTimeTypeStart; export declare function OgrSourceDatasetTimeTypeStartFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeStart; -export declare function OgrSourceDatasetTimeTypeStartToJSON(value?: OgrSourceDatasetTimeTypeStart | null): any; +export declare function OgrSourceDatasetTimeTypeStartToJSON(json: any): OgrSourceDatasetTimeTypeStart; +export declare function OgrSourceDatasetTimeTypeStartToJSONTyped(value?: OgrSourceDatasetTimeTypeStart | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStart.js b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStart.js index 1bf3e281..a8f06a16 100644 --- a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStart.js +++ b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStart.js @@ -11,8 +11,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { OgrSourceDurationSpecFromJSON, OgrSourceDurationSpecToJSON, } from './OgrSourceDurationSpec'; import { OgrSourceTimeFormatFromJSON, OgrSourceTimeFormatToJSON, } from './OgrSourceTimeFormat'; +import { OgrSourceDurationSpecFromJSON, OgrSourceDurationSpecToJSON, } from './OgrSourceDurationSpec'; /** * @export */ @@ -23,18 +23,21 @@ export const OgrSourceDatasetTimeTypeStartTypeEnum = { * Check if a given object implements the OgrSourceDatasetTimeTypeStart interface. */ export function instanceOfOgrSourceDatasetTimeTypeStart(value) { - let isInstance = true; - isInstance = isInstance && "duration" in value; - isInstance = isInstance && "startField" in value; - isInstance = isInstance && "startFormat" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('duration' in value) || value['duration'] === undefined) + return false; + if (!('startField' in value) || value['startField'] === undefined) + return false; + if (!('startFormat' in value) || value['startFormat'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function OgrSourceDatasetTimeTypeStartFromJSON(json) { return OgrSourceDatasetTimeTypeStartFromJSONTyped(json, false); } export function OgrSourceDatasetTimeTypeStartFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -44,17 +47,17 @@ export function OgrSourceDatasetTimeTypeStartFromJSONTyped(json, ignoreDiscrimin 'type': json['type'], }; } -export function OgrSourceDatasetTimeTypeStartToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetTimeTypeStartToJSON(json) { + return OgrSourceDatasetTimeTypeStartToJSONTyped(json, false); +} +export function OgrSourceDatasetTimeTypeStartToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'duration': OgrSourceDurationSpecToJSON(value.duration), - 'startField': value.startField, - 'startFormat': OgrSourceTimeFormatToJSON(value.startFormat), - 'type': value.type, + 'duration': OgrSourceDurationSpecToJSON(value['duration']), + 'startField': value['startField'], + 'startFormat': OgrSourceTimeFormatToJSON(value['startFormat']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartDuration.d.ts b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartDuration.d.ts index 82606c14..dbf2d217 100644 --- a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartDuration.d.ts +++ b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartDuration.d.ts @@ -51,7 +51,8 @@ export type OgrSourceDatasetTimeTypeStartDurationTypeEnum = typeof OgrSourceData /** * Check if a given object implements the OgrSourceDatasetTimeTypeStartDuration interface. */ -export declare function instanceOfOgrSourceDatasetTimeTypeStartDuration(value: object): boolean; +export declare function instanceOfOgrSourceDatasetTimeTypeStartDuration(value: object): value is OgrSourceDatasetTimeTypeStartDuration; export declare function OgrSourceDatasetTimeTypeStartDurationFromJSON(json: any): OgrSourceDatasetTimeTypeStartDuration; export declare function OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeStartDuration; -export declare function OgrSourceDatasetTimeTypeStartDurationToJSON(value?: OgrSourceDatasetTimeTypeStartDuration | null): any; +export declare function OgrSourceDatasetTimeTypeStartDurationToJSON(json: any): OgrSourceDatasetTimeTypeStartDuration; +export declare function OgrSourceDatasetTimeTypeStartDurationToJSONTyped(value?: OgrSourceDatasetTimeTypeStartDuration | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartDuration.js b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartDuration.js index ba899596..216ea5a9 100644 --- a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartDuration.js +++ b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartDuration.js @@ -22,18 +22,21 @@ export const OgrSourceDatasetTimeTypeStartDurationTypeEnum = { * Check if a given object implements the OgrSourceDatasetTimeTypeStartDuration interface. */ export function instanceOfOgrSourceDatasetTimeTypeStartDuration(value) { - let isInstance = true; - isInstance = isInstance && "durationField" in value; - isInstance = isInstance && "startField" in value; - isInstance = isInstance && "startFormat" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('durationField' in value) || value['durationField'] === undefined) + return false; + if (!('startField' in value) || value['startField'] === undefined) + return false; + if (!('startFormat' in value) || value['startFormat'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function OgrSourceDatasetTimeTypeStartDurationFromJSON(json) { return OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json, false); } export function OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +46,17 @@ export function OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json, ignoreD 'type': json['type'], }; } -export function OgrSourceDatasetTimeTypeStartDurationToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetTimeTypeStartDurationToJSON(json) { + return OgrSourceDatasetTimeTypeStartDurationToJSONTyped(json, false); +} +export function OgrSourceDatasetTimeTypeStartDurationToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'durationField': value.durationField, - 'startField': value.startField, - 'startFormat': OgrSourceTimeFormatToJSON(value.startFormat), - 'type': value.type, + 'durationField': value['durationField'], + 'startField': value['startField'], + 'startFormat': OgrSourceTimeFormatToJSON(value['startFormat']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartEnd.d.ts b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartEnd.d.ts index 8b43d91e..df756dfe 100644 --- a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartEnd.d.ts +++ b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartEnd.d.ts @@ -57,7 +57,8 @@ export type OgrSourceDatasetTimeTypeStartEndTypeEnum = typeof OgrSourceDatasetTi /** * Check if a given object implements the OgrSourceDatasetTimeTypeStartEnd interface. */ -export declare function instanceOfOgrSourceDatasetTimeTypeStartEnd(value: object): boolean; +export declare function instanceOfOgrSourceDatasetTimeTypeStartEnd(value: object): value is OgrSourceDatasetTimeTypeStartEnd; export declare function OgrSourceDatasetTimeTypeStartEndFromJSON(json: any): OgrSourceDatasetTimeTypeStartEnd; export declare function OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeStartEnd; -export declare function OgrSourceDatasetTimeTypeStartEndToJSON(value?: OgrSourceDatasetTimeTypeStartEnd | null): any; +export declare function OgrSourceDatasetTimeTypeStartEndToJSON(json: any): OgrSourceDatasetTimeTypeStartEnd; +export declare function OgrSourceDatasetTimeTypeStartEndToJSONTyped(value?: OgrSourceDatasetTimeTypeStartEnd | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartEnd.js b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartEnd.js index cd3c08bd..246be83d 100644 --- a/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartEnd.js +++ b/typescript/dist/esm/models/OgrSourceDatasetTimeTypeStartEnd.js @@ -22,19 +22,23 @@ export const OgrSourceDatasetTimeTypeStartEndTypeEnum = { * Check if a given object implements the OgrSourceDatasetTimeTypeStartEnd interface. */ export function instanceOfOgrSourceDatasetTimeTypeStartEnd(value) { - let isInstance = true; - isInstance = isInstance && "endField" in value; - isInstance = isInstance && "endFormat" in value; - isInstance = isInstance && "startField" in value; - isInstance = isInstance && "startFormat" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('endField' in value) || value['endField'] === undefined) + return false; + if (!('endFormat' in value) || value['endFormat'] === undefined) + return false; + if (!('startField' in value) || value['startField'] === undefined) + return false; + if (!('startFormat' in value) || value['startFormat'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function OgrSourceDatasetTimeTypeStartEndFromJSON(json) { return OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json, false); } export function OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -45,18 +49,18 @@ export function OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json, ignoreDiscri 'type': json['type'], }; } -export function OgrSourceDatasetTimeTypeStartEndToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetTimeTypeStartEndToJSON(json) { + return OgrSourceDatasetTimeTypeStartEndToJSONTyped(json, false); +} +export function OgrSourceDatasetTimeTypeStartEndToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'endField': value.endField, - 'endFormat': OgrSourceTimeFormatToJSON(value.endFormat), - 'startField': value.startField, - 'startFormat': OgrSourceTimeFormatToJSON(value.startFormat), - 'type': value.type, + 'endField': value['endField'], + 'endFormat': OgrSourceTimeFormatToJSON(value['endFormat']), + 'startField': value['startField'], + 'startFormat': OgrSourceTimeFormatToJSON(value['startFormat']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/OgrSourceDurationSpec.d.ts b/typescript/dist/esm/models/OgrSourceDurationSpec.d.ts index b1f02113..94797f25 100644 --- a/typescript/dist/esm/models/OgrSourceDurationSpec.d.ts +++ b/typescript/dist/esm/models/OgrSourceDurationSpec.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { OgrSourceDurationSpecInfinite } from './OgrSourceDurationSpecInfinite'; -import { OgrSourceDurationSpecValue } from './OgrSourceDurationSpecValue'; -import { OgrSourceDurationSpecZero } from './OgrSourceDurationSpecZero'; +import type { OgrSourceDurationSpecInfinite } from './OgrSourceDurationSpecInfinite'; +import type { OgrSourceDurationSpecValue } from './OgrSourceDurationSpecValue'; +import type { OgrSourceDurationSpecZero } from './OgrSourceDurationSpecZero'; /** * @type OgrSourceDurationSpec * @@ -26,4 +26,5 @@ export type OgrSourceDurationSpec = { } & OgrSourceDurationSpecZero; export declare function OgrSourceDurationSpecFromJSON(json: any): OgrSourceDurationSpec; export declare function OgrSourceDurationSpecFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpec; -export declare function OgrSourceDurationSpecToJSON(value?: OgrSourceDurationSpec | null): any; +export declare function OgrSourceDurationSpecToJSON(json: any): any; +export declare function OgrSourceDurationSpecToJSONTyped(value?: OgrSourceDurationSpec | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceDurationSpec.js b/typescript/dist/esm/models/OgrSourceDurationSpec.js index 75ca9148..abf9472d 100644 --- a/typescript/dist/esm/models/OgrSourceDurationSpec.js +++ b/typescript/dist/esm/models/OgrSourceDurationSpec.js @@ -18,34 +18,34 @@ export function OgrSourceDurationSpecFromJSON(json) { return OgrSourceDurationSpecFromJSONTyped(json, false); } export function OgrSourceDurationSpecFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'infinite': - return Object.assign(Object.assign({}, OgrSourceDurationSpecInfiniteFromJSONTyped(json, true)), { type: 'infinite' }); + return Object.assign({}, OgrSourceDurationSpecInfiniteFromJSONTyped(json, true), { type: 'infinite' }); case 'value': - return Object.assign(Object.assign({}, OgrSourceDurationSpecValueFromJSONTyped(json, true)), { type: 'value' }); + return Object.assign({}, OgrSourceDurationSpecValueFromJSONTyped(json, true), { type: 'value' }); case 'zero': - return Object.assign(Object.assign({}, OgrSourceDurationSpecZeroFromJSONTyped(json, true)), { type: 'zero' }); + return Object.assign({}, OgrSourceDurationSpecZeroFromJSONTyped(json, true), { type: 'zero' }); default: throw new Error(`No variant of OgrSourceDurationSpec exists with 'type=${json['type']}'`); } } -export function OgrSourceDurationSpecToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDurationSpecToJSON(json) { + return OgrSourceDurationSpecToJSONTyped(json, false); +} +export function OgrSourceDurationSpecToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'infinite': - return OgrSourceDurationSpecInfiniteToJSON(value); + return Object.assign({}, OgrSourceDurationSpecInfiniteToJSON(value), { type: 'infinite' }); case 'value': - return OgrSourceDurationSpecValueToJSON(value); + return Object.assign({}, OgrSourceDurationSpecValueToJSON(value), { type: 'value' }); case 'zero': - return OgrSourceDurationSpecZeroToJSON(value); + return Object.assign({}, OgrSourceDurationSpecZeroToJSON(value), { type: 'zero' }); default: throw new Error(`No variant of OgrSourceDurationSpec exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/OgrSourceDurationSpecInfinite.d.ts b/typescript/dist/esm/models/OgrSourceDurationSpecInfinite.d.ts index 016d6fdf..52c6c84a 100644 --- a/typescript/dist/esm/models/OgrSourceDurationSpecInfinite.d.ts +++ b/typescript/dist/esm/models/OgrSourceDurationSpecInfinite.d.ts @@ -27,14 +27,13 @@ export interface OgrSourceDurationSpecInfinite { */ export declare const OgrSourceDurationSpecInfiniteTypeEnum: { readonly Infinite: "infinite"; - readonly Zero: "zero"; - readonly Value: "value"; }; export type OgrSourceDurationSpecInfiniteTypeEnum = typeof OgrSourceDurationSpecInfiniteTypeEnum[keyof typeof OgrSourceDurationSpecInfiniteTypeEnum]; /** * Check if a given object implements the OgrSourceDurationSpecInfinite interface. */ -export declare function instanceOfOgrSourceDurationSpecInfinite(value: object): boolean; +export declare function instanceOfOgrSourceDurationSpecInfinite(value: object): value is OgrSourceDurationSpecInfinite; export declare function OgrSourceDurationSpecInfiniteFromJSON(json: any): OgrSourceDurationSpecInfinite; export declare function OgrSourceDurationSpecInfiniteFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpecInfinite; -export declare function OgrSourceDurationSpecInfiniteToJSON(value?: OgrSourceDurationSpecInfinite | null): any; +export declare function OgrSourceDurationSpecInfiniteToJSON(json: any): OgrSourceDurationSpecInfinite; +export declare function OgrSourceDurationSpecInfiniteToJSONTyped(value?: OgrSourceDurationSpecInfinite | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceDurationSpecInfinite.js b/typescript/dist/esm/models/OgrSourceDurationSpecInfinite.js index c7a2741e..362fdcf3 100644 --- a/typescript/dist/esm/models/OgrSourceDurationSpecInfinite.js +++ b/typescript/dist/esm/models/OgrSourceDurationSpecInfinite.js @@ -15,37 +15,35 @@ * @export */ export const OgrSourceDurationSpecInfiniteTypeEnum = { - Infinite: 'infinite', - Zero: 'zero', - Value: 'value' + Infinite: 'infinite' }; /** * Check if a given object implements the OgrSourceDurationSpecInfinite interface. */ export function instanceOfOgrSourceDurationSpecInfinite(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function OgrSourceDurationSpecInfiniteFromJSON(json) { return OgrSourceDurationSpecInfiniteFromJSONTyped(json, false); } export function OgrSourceDurationSpecInfiniteFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'type': json['type'], }; } -export function OgrSourceDurationSpecInfiniteToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDurationSpecInfiniteToJSON(json) { + return OgrSourceDurationSpecInfiniteToJSONTyped(json, false); +} +export function OgrSourceDurationSpecInfiniteToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'type': value.type, + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/OgrSourceDurationSpecValue.d.ts b/typescript/dist/esm/models/OgrSourceDurationSpecValue.d.ts index f3d08292..1eb1a2f0 100644 --- a/typescript/dist/esm/models/OgrSourceDurationSpecValue.d.ts +++ b/typescript/dist/esm/models/OgrSourceDurationSpecValue.d.ts @@ -45,7 +45,8 @@ export type OgrSourceDurationSpecValueTypeEnum = typeof OgrSourceDurationSpecVal /** * Check if a given object implements the OgrSourceDurationSpecValue interface. */ -export declare function instanceOfOgrSourceDurationSpecValue(value: object): boolean; +export declare function instanceOfOgrSourceDurationSpecValue(value: object): value is OgrSourceDurationSpecValue; export declare function OgrSourceDurationSpecValueFromJSON(json: any): OgrSourceDurationSpecValue; export declare function OgrSourceDurationSpecValueFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpecValue; -export declare function OgrSourceDurationSpecValueToJSON(value?: OgrSourceDurationSpecValue | null): any; +export declare function OgrSourceDurationSpecValueToJSON(json: any): OgrSourceDurationSpecValue; +export declare function OgrSourceDurationSpecValueToJSONTyped(value?: OgrSourceDurationSpecValue | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceDurationSpecValue.js b/typescript/dist/esm/models/OgrSourceDurationSpecValue.js index c6aaf43f..3ff8ab78 100644 --- a/typescript/dist/esm/models/OgrSourceDurationSpecValue.js +++ b/typescript/dist/esm/models/OgrSourceDurationSpecValue.js @@ -22,17 +22,19 @@ export const OgrSourceDurationSpecValueTypeEnum = { * Check if a given object implements the OgrSourceDurationSpecValue interface. */ export function instanceOfOgrSourceDurationSpecValue(value) { - let isInstance = true; - isInstance = isInstance && "granularity" in value; - isInstance = isInstance && "step" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('granularity' in value) || value['granularity'] === undefined) + return false; + if (!('step' in value) || value['step'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function OgrSourceDurationSpecValueFromJSON(json) { return OgrSourceDurationSpecValueFromJSONTyped(json, false); } export function OgrSourceDurationSpecValueFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,16 +43,16 @@ export function OgrSourceDurationSpecValueFromJSONTyped(json, ignoreDiscriminato 'type': json['type'], }; } -export function OgrSourceDurationSpecValueToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDurationSpecValueToJSON(json) { + return OgrSourceDurationSpecValueToJSONTyped(json, false); +} +export function OgrSourceDurationSpecValueToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'granularity': TimeGranularityToJSON(value.granularity), - 'step': value.step, - 'type': value.type, + 'granularity': TimeGranularityToJSON(value['granularity']), + 'step': value['step'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/OgrSourceDurationSpecZero.d.ts b/typescript/dist/esm/models/OgrSourceDurationSpecZero.d.ts index 8ac91d5d..c528ed41 100644 --- a/typescript/dist/esm/models/OgrSourceDurationSpecZero.d.ts +++ b/typescript/dist/esm/models/OgrSourceDurationSpecZero.d.ts @@ -32,7 +32,8 @@ export type OgrSourceDurationSpecZeroTypeEnum = typeof OgrSourceDurationSpecZero /** * Check if a given object implements the OgrSourceDurationSpecZero interface. */ -export declare function instanceOfOgrSourceDurationSpecZero(value: object): boolean; +export declare function instanceOfOgrSourceDurationSpecZero(value: object): value is OgrSourceDurationSpecZero; export declare function OgrSourceDurationSpecZeroFromJSON(json: any): OgrSourceDurationSpecZero; export declare function OgrSourceDurationSpecZeroFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpecZero; -export declare function OgrSourceDurationSpecZeroToJSON(value?: OgrSourceDurationSpecZero | null): any; +export declare function OgrSourceDurationSpecZeroToJSON(json: any): OgrSourceDurationSpecZero; +export declare function OgrSourceDurationSpecZeroToJSONTyped(value?: OgrSourceDurationSpecZero | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceDurationSpecZero.js b/typescript/dist/esm/models/OgrSourceDurationSpecZero.js index 9af43899..52840a3a 100644 --- a/typescript/dist/esm/models/OgrSourceDurationSpecZero.js +++ b/typescript/dist/esm/models/OgrSourceDurationSpecZero.js @@ -21,29 +21,29 @@ export const OgrSourceDurationSpecZeroTypeEnum = { * Check if a given object implements the OgrSourceDurationSpecZero interface. */ export function instanceOfOgrSourceDurationSpecZero(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function OgrSourceDurationSpecZeroFromJSON(json) { return OgrSourceDurationSpecZeroFromJSONTyped(json, false); } export function OgrSourceDurationSpecZeroFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'type': json['type'], }; } -export function OgrSourceDurationSpecZeroToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDurationSpecZeroToJSON(json) { + return OgrSourceDurationSpecZeroToJSONTyped(json, false); +} +export function OgrSourceDurationSpecZeroToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'type': value.type, + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/OgrSourceErrorSpec.d.ts b/typescript/dist/esm/models/OgrSourceErrorSpec.d.ts index 95c78fbc..29385775 100644 --- a/typescript/dist/esm/models/OgrSourceErrorSpec.d.ts +++ b/typescript/dist/esm/models/OgrSourceErrorSpec.d.ts @@ -18,6 +18,8 @@ export declare const OgrSourceErrorSpec: { readonly Abort: "abort"; }; export type OgrSourceErrorSpec = typeof OgrSourceErrorSpec[keyof typeof OgrSourceErrorSpec]; +export declare function instanceOfOgrSourceErrorSpec(value: any): boolean; export declare function OgrSourceErrorSpecFromJSON(json: any): OgrSourceErrorSpec; export declare function OgrSourceErrorSpecFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceErrorSpec; export declare function OgrSourceErrorSpecToJSON(value?: OgrSourceErrorSpec | null): any; +export declare function OgrSourceErrorSpecToJSONTyped(value: any, ignoreDiscriminator: boolean): OgrSourceErrorSpec; diff --git a/typescript/dist/esm/models/OgrSourceErrorSpec.js b/typescript/dist/esm/models/OgrSourceErrorSpec.js index d20a3f96..c9f8e79d 100644 --- a/typescript/dist/esm/models/OgrSourceErrorSpec.js +++ b/typescript/dist/esm/models/OgrSourceErrorSpec.js @@ -19,6 +19,16 @@ export const OgrSourceErrorSpec = { Ignore: 'ignore', Abort: 'abort' }; +export function instanceOfOgrSourceErrorSpec(value) { + for (const key in OgrSourceErrorSpec) { + if (Object.prototype.hasOwnProperty.call(OgrSourceErrorSpec, key)) { + if (OgrSourceErrorSpec[key] === value) { + return true; + } + } + } + return false; +} export function OgrSourceErrorSpecFromJSON(json) { return OgrSourceErrorSpecFromJSONTyped(json, false); } @@ -28,3 +38,6 @@ export function OgrSourceErrorSpecFromJSONTyped(json, ignoreDiscriminator) { export function OgrSourceErrorSpecToJSON(value) { return value; } +export function OgrSourceErrorSpecToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/OgrSourceTimeFormat.d.ts b/typescript/dist/esm/models/OgrSourceTimeFormat.d.ts index b56aa051..8f523183 100644 --- a/typescript/dist/esm/models/OgrSourceTimeFormat.d.ts +++ b/typescript/dist/esm/models/OgrSourceTimeFormat.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { OgrSourceTimeFormatAuto } from './OgrSourceTimeFormatAuto'; -import { OgrSourceTimeFormatCustom } from './OgrSourceTimeFormatCustom'; -import { OgrSourceTimeFormatUnixTimeStamp } from './OgrSourceTimeFormatUnixTimeStamp'; +import type { OgrSourceTimeFormatAuto } from './OgrSourceTimeFormatAuto'; +import type { OgrSourceTimeFormatCustom } from './OgrSourceTimeFormatCustom'; +import type { OgrSourceTimeFormatUnixTimeStamp } from './OgrSourceTimeFormatUnixTimeStamp'; /** * @type OgrSourceTimeFormat * @@ -26,4 +26,5 @@ export type OgrSourceTimeFormat = { } & OgrSourceTimeFormatUnixTimeStamp; export declare function OgrSourceTimeFormatFromJSON(json: any): OgrSourceTimeFormat; export declare function OgrSourceTimeFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormat; -export declare function OgrSourceTimeFormatToJSON(value?: OgrSourceTimeFormat | null): any; +export declare function OgrSourceTimeFormatToJSON(json: any): any; +export declare function OgrSourceTimeFormatToJSONTyped(value?: OgrSourceTimeFormat | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceTimeFormat.js b/typescript/dist/esm/models/OgrSourceTimeFormat.js index c962dd74..d01b02ca 100644 --- a/typescript/dist/esm/models/OgrSourceTimeFormat.js +++ b/typescript/dist/esm/models/OgrSourceTimeFormat.js @@ -18,34 +18,34 @@ export function OgrSourceTimeFormatFromJSON(json) { return OgrSourceTimeFormatFromJSONTyped(json, false); } export function OgrSourceTimeFormatFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['format']) { case 'auto': - return Object.assign(Object.assign({}, OgrSourceTimeFormatAutoFromJSONTyped(json, true)), { format: 'auto' }); + return Object.assign({}, OgrSourceTimeFormatAutoFromJSONTyped(json, true), { format: 'auto' }); case 'custom': - return Object.assign(Object.assign({}, OgrSourceTimeFormatCustomFromJSONTyped(json, true)), { format: 'custom' }); + return Object.assign({}, OgrSourceTimeFormatCustomFromJSONTyped(json, true), { format: 'custom' }); case 'unixTimeStamp': - return Object.assign(Object.assign({}, OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json, true)), { format: 'unixTimeStamp' }); + return Object.assign({}, OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json, true), { format: 'unixTimeStamp' }); default: throw new Error(`No variant of OgrSourceTimeFormat exists with 'format=${json['format']}'`); } } -export function OgrSourceTimeFormatToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceTimeFormatToJSON(json) { + return OgrSourceTimeFormatToJSONTyped(json, false); +} +export function OgrSourceTimeFormatToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['format']) { case 'auto': - return OgrSourceTimeFormatAutoToJSON(value); + return Object.assign({}, OgrSourceTimeFormatAutoToJSON(value), { format: 'auto' }); case 'custom': - return OgrSourceTimeFormatCustomToJSON(value); + return Object.assign({}, OgrSourceTimeFormatCustomToJSON(value), { format: 'custom' }); case 'unixTimeStamp': - return OgrSourceTimeFormatUnixTimeStampToJSON(value); + return Object.assign({}, OgrSourceTimeFormatUnixTimeStampToJSON(value), { format: 'unixTimeStamp' }); default: throw new Error(`No variant of OgrSourceTimeFormat exists with 'format=${value['format']}'`); } diff --git a/typescript/dist/esm/models/OgrSourceTimeFormatAuto.d.ts b/typescript/dist/esm/models/OgrSourceTimeFormatAuto.d.ts index d2fd2ec4..960fb42b 100644 --- a/typescript/dist/esm/models/OgrSourceTimeFormatAuto.d.ts +++ b/typescript/dist/esm/models/OgrSourceTimeFormatAuto.d.ts @@ -32,7 +32,8 @@ export type OgrSourceTimeFormatAutoFormatEnum = typeof OgrSourceTimeFormatAutoFo /** * Check if a given object implements the OgrSourceTimeFormatAuto interface. */ -export declare function instanceOfOgrSourceTimeFormatAuto(value: object): boolean; +export declare function instanceOfOgrSourceTimeFormatAuto(value: object): value is OgrSourceTimeFormatAuto; export declare function OgrSourceTimeFormatAutoFromJSON(json: any): OgrSourceTimeFormatAuto; export declare function OgrSourceTimeFormatAutoFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormatAuto; -export declare function OgrSourceTimeFormatAutoToJSON(value?: OgrSourceTimeFormatAuto | null): any; +export declare function OgrSourceTimeFormatAutoToJSON(json: any): OgrSourceTimeFormatAuto; +export declare function OgrSourceTimeFormatAutoToJSONTyped(value?: OgrSourceTimeFormatAuto | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceTimeFormatAuto.js b/typescript/dist/esm/models/OgrSourceTimeFormatAuto.js index bdb8a1e1..32b2d546 100644 --- a/typescript/dist/esm/models/OgrSourceTimeFormatAuto.js +++ b/typescript/dist/esm/models/OgrSourceTimeFormatAuto.js @@ -21,29 +21,29 @@ export const OgrSourceTimeFormatAutoFormatEnum = { * Check if a given object implements the OgrSourceTimeFormatAuto interface. */ export function instanceOfOgrSourceTimeFormatAuto(value) { - let isInstance = true; - isInstance = isInstance && "format" in value; - return isInstance; + if (!('format' in value) || value['format'] === undefined) + return false; + return true; } export function OgrSourceTimeFormatAutoFromJSON(json) { return OgrSourceTimeFormatAutoFromJSONTyped(json, false); } export function OgrSourceTimeFormatAutoFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'format': json['format'], }; } -export function OgrSourceTimeFormatAutoToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceTimeFormatAutoToJSON(json) { + return OgrSourceTimeFormatAutoToJSONTyped(json, false); +} +export function OgrSourceTimeFormatAutoToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'format': value.format, + 'format': value['format'], }; } diff --git a/typescript/dist/esm/models/OgrSourceTimeFormatCustom.d.ts b/typescript/dist/esm/models/OgrSourceTimeFormatCustom.d.ts index b71778da..7a998eae 100644 --- a/typescript/dist/esm/models/OgrSourceTimeFormatCustom.d.ts +++ b/typescript/dist/esm/models/OgrSourceTimeFormatCustom.d.ts @@ -38,7 +38,8 @@ export type OgrSourceTimeFormatCustomFormatEnum = typeof OgrSourceTimeFormatCust /** * Check if a given object implements the OgrSourceTimeFormatCustom interface. */ -export declare function instanceOfOgrSourceTimeFormatCustom(value: object): boolean; +export declare function instanceOfOgrSourceTimeFormatCustom(value: object): value is OgrSourceTimeFormatCustom; export declare function OgrSourceTimeFormatCustomFromJSON(json: any): OgrSourceTimeFormatCustom; export declare function OgrSourceTimeFormatCustomFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormatCustom; -export declare function OgrSourceTimeFormatCustomToJSON(value?: OgrSourceTimeFormatCustom | null): any; +export declare function OgrSourceTimeFormatCustomToJSON(json: any): OgrSourceTimeFormatCustom; +export declare function OgrSourceTimeFormatCustomToJSONTyped(value?: OgrSourceTimeFormatCustom | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceTimeFormatCustom.js b/typescript/dist/esm/models/OgrSourceTimeFormatCustom.js index afc0382b..00964400 100644 --- a/typescript/dist/esm/models/OgrSourceTimeFormatCustom.js +++ b/typescript/dist/esm/models/OgrSourceTimeFormatCustom.js @@ -21,16 +21,17 @@ export const OgrSourceTimeFormatCustomFormatEnum = { * Check if a given object implements the OgrSourceTimeFormatCustom interface. */ export function instanceOfOgrSourceTimeFormatCustom(value) { - let isInstance = true; - isInstance = isInstance && "customFormat" in value; - isInstance = isInstance && "format" in value; - return isInstance; + if (!('customFormat' in value) || value['customFormat'] === undefined) + return false; + if (!('format' in value) || value['format'] === undefined) + return false; + return true; } export function OgrSourceTimeFormatCustomFromJSON(json) { return OgrSourceTimeFormatCustomFromJSONTyped(json, false); } export function OgrSourceTimeFormatCustomFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,15 +39,15 @@ export function OgrSourceTimeFormatCustomFromJSONTyped(json, ignoreDiscriminator 'format': json['format'], }; } -export function OgrSourceTimeFormatCustomToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceTimeFormatCustomToJSON(json) { + return OgrSourceTimeFormatCustomToJSONTyped(json, false); +} +export function OgrSourceTimeFormatCustomToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'customFormat': value.customFormat, - 'format': value.format, + 'customFormat': value['customFormat'], + 'format': value['format'], }; } diff --git a/typescript/dist/esm/models/OgrSourceTimeFormatUnixTimeStamp.d.ts b/typescript/dist/esm/models/OgrSourceTimeFormatUnixTimeStamp.d.ts index 74dea859..a59381be 100644 --- a/typescript/dist/esm/models/OgrSourceTimeFormatUnixTimeStamp.d.ts +++ b/typescript/dist/esm/models/OgrSourceTimeFormatUnixTimeStamp.d.ts @@ -39,7 +39,8 @@ export type OgrSourceTimeFormatUnixTimeStampFormatEnum = typeof OgrSourceTimeFor /** * Check if a given object implements the OgrSourceTimeFormatUnixTimeStamp interface. */ -export declare function instanceOfOgrSourceTimeFormatUnixTimeStamp(value: object): boolean; +export declare function instanceOfOgrSourceTimeFormatUnixTimeStamp(value: object): value is OgrSourceTimeFormatUnixTimeStamp; export declare function OgrSourceTimeFormatUnixTimeStampFromJSON(json: any): OgrSourceTimeFormatUnixTimeStamp; export declare function OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormatUnixTimeStamp; -export declare function OgrSourceTimeFormatUnixTimeStampToJSON(value?: OgrSourceTimeFormatUnixTimeStamp | null): any; +export declare function OgrSourceTimeFormatUnixTimeStampToJSON(json: any): OgrSourceTimeFormatUnixTimeStamp; +export declare function OgrSourceTimeFormatUnixTimeStampToJSONTyped(value?: OgrSourceTimeFormatUnixTimeStamp | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OgrSourceTimeFormatUnixTimeStamp.js b/typescript/dist/esm/models/OgrSourceTimeFormatUnixTimeStamp.js index 0cc43af5..00f895b0 100644 --- a/typescript/dist/esm/models/OgrSourceTimeFormatUnixTimeStamp.js +++ b/typescript/dist/esm/models/OgrSourceTimeFormatUnixTimeStamp.js @@ -22,16 +22,17 @@ export const OgrSourceTimeFormatUnixTimeStampFormatEnum = { * Check if a given object implements the OgrSourceTimeFormatUnixTimeStamp interface. */ export function instanceOfOgrSourceTimeFormatUnixTimeStamp(value) { - let isInstance = true; - isInstance = isInstance && "format" in value; - isInstance = isInstance && "timestampType" in value; - return isInstance; + if (!('format' in value) || value['format'] === undefined) + return false; + if (!('timestampType' in value) || value['timestampType'] === undefined) + return false; + return true; } export function OgrSourceTimeFormatUnixTimeStampFromJSON(json) { return OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json, false); } export function OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,15 +40,15 @@ export function OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json, ignoreDiscri 'timestampType': UnixTimeStampTypeFromJSON(json['timestampType']), }; } -export function OgrSourceTimeFormatUnixTimeStampToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceTimeFormatUnixTimeStampToJSON(json) { + return OgrSourceTimeFormatUnixTimeStampToJSONTyped(json, false); +} +export function OgrSourceTimeFormatUnixTimeStampToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'format': value.format, - 'timestampType': UnixTimeStampTypeToJSON(value.timestampType), + 'format': value['format'], + 'timestampType': UnixTimeStampTypeToJSON(value['timestampType']), }; } diff --git a/typescript/dist/esm/models/OperatorQuota.d.ts b/typescript/dist/esm/models/OperatorQuota.d.ts index d49b4a83..6a0db713 100644 --- a/typescript/dist/esm/models/OperatorQuota.d.ts +++ b/typescript/dist/esm/models/OperatorQuota.d.ts @@ -37,7 +37,8 @@ export interface OperatorQuota { /** * Check if a given object implements the OperatorQuota interface. */ -export declare function instanceOfOperatorQuota(value: object): boolean; +export declare function instanceOfOperatorQuota(value: object): value is OperatorQuota; export declare function OperatorQuotaFromJSON(json: any): OperatorQuota; export declare function OperatorQuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): OperatorQuota; -export declare function OperatorQuotaToJSON(value?: OperatorQuota | null): any; +export declare function OperatorQuotaToJSON(json: any): OperatorQuota; +export declare function OperatorQuotaToJSONTyped(value?: OperatorQuota | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/OperatorQuota.js b/typescript/dist/esm/models/OperatorQuota.js index 38f252f8..bea060b8 100644 --- a/typescript/dist/esm/models/OperatorQuota.js +++ b/typescript/dist/esm/models/OperatorQuota.js @@ -15,17 +15,19 @@ * Check if a given object implements the OperatorQuota interface. */ export function instanceOfOperatorQuota(value) { - let isInstance = true; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "operatorName" in value; - isInstance = isInstance && "operatorPath" in value; - return isInstance; + if (!('count' in value) || value['count'] === undefined) + return false; + if (!('operatorName' in value) || value['operatorName'] === undefined) + return false; + if (!('operatorPath' in value) || value['operatorPath'] === undefined) + return false; + return true; } export function OperatorQuotaFromJSON(json) { return OperatorQuotaFromJSONTyped(json, false); } export function OperatorQuotaFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -34,16 +36,16 @@ export function OperatorQuotaFromJSONTyped(json, ignoreDiscriminator) { 'operatorPath': json['operatorPath'], }; } -export function OperatorQuotaToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OperatorQuotaToJSON(json) { + return OperatorQuotaToJSONTyped(json, false); +} +export function OperatorQuotaToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'count': value.count, - 'operatorName': value.operatorName, - 'operatorPath': value.operatorPath, + 'count': value['count'], + 'operatorName': value['operatorName'], + 'operatorPath': value['operatorPath'], }; } diff --git a/typescript/dist/esm/models/OrderBy.d.ts b/typescript/dist/esm/models/OrderBy.d.ts index a7c3f0d8..f3f96c16 100644 --- a/typescript/dist/esm/models/OrderBy.d.ts +++ b/typescript/dist/esm/models/OrderBy.d.ts @@ -18,6 +18,8 @@ export declare const OrderBy: { readonly NameDesc: "NameDesc"; }; export type OrderBy = typeof OrderBy[keyof typeof OrderBy]; +export declare function instanceOfOrderBy(value: any): boolean; export declare function OrderByFromJSON(json: any): OrderBy; export declare function OrderByFromJSONTyped(json: any, ignoreDiscriminator: boolean): OrderBy; export declare function OrderByToJSON(value?: OrderBy | null): any; +export declare function OrderByToJSONTyped(value: any, ignoreDiscriminator: boolean): OrderBy; diff --git a/typescript/dist/esm/models/OrderBy.js b/typescript/dist/esm/models/OrderBy.js index 7ccd343d..d73b6ca1 100644 --- a/typescript/dist/esm/models/OrderBy.js +++ b/typescript/dist/esm/models/OrderBy.js @@ -19,6 +19,16 @@ export const OrderBy = { NameAsc: 'NameAsc', NameDesc: 'NameDesc' }; +export function instanceOfOrderBy(value) { + for (const key in OrderBy) { + if (Object.prototype.hasOwnProperty.call(OrderBy, key)) { + if (OrderBy[key] === value) { + return true; + } + } + } + return false; +} export function OrderByFromJSON(json) { return OrderByFromJSONTyped(json, false); } @@ -28,3 +38,6 @@ export function OrderByFromJSONTyped(json, ignoreDiscriminator) { export function OrderByToJSON(value) { return value; } +export function OrderByToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/PaletteColorizer.d.ts b/typescript/dist/esm/models/PaletteColorizer.d.ts index 5bb17d4f..97b0aa94 100644 --- a/typescript/dist/esm/models/PaletteColorizer.d.ts +++ b/typescript/dist/esm/models/PaletteColorizer.d.ts @@ -54,7 +54,8 @@ export type PaletteColorizerTypeEnum = typeof PaletteColorizerTypeEnum[keyof typ /** * Check if a given object implements the PaletteColorizer interface. */ -export declare function instanceOfPaletteColorizer(value: object): boolean; +export declare function instanceOfPaletteColorizer(value: object): value is PaletteColorizer; export declare function PaletteColorizerFromJSON(json: any): PaletteColorizer; export declare function PaletteColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaletteColorizer; -export declare function PaletteColorizerToJSON(value?: PaletteColorizer | null): any; +export declare function PaletteColorizerToJSON(json: any): PaletteColorizer; +export declare function PaletteColorizerToJSONTyped(value?: PaletteColorizer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/PaletteColorizer.js b/typescript/dist/esm/models/PaletteColorizer.js index 119f69de..fa198587 100644 --- a/typescript/dist/esm/models/PaletteColorizer.js +++ b/typescript/dist/esm/models/PaletteColorizer.js @@ -21,18 +21,21 @@ export const PaletteColorizerTypeEnum = { * Check if a given object implements the PaletteColorizer interface. */ export function instanceOfPaletteColorizer(value) { - let isInstance = true; - isInstance = isInstance && "colors" in value; - isInstance = isInstance && "defaultColor" in value; - isInstance = isInstance && "noDataColor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('colors' in value) || value['colors'] === undefined) + return false; + if (!('defaultColor' in value) || value['defaultColor'] === undefined) + return false; + if (!('noDataColor' in value) || value['noDataColor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function PaletteColorizerFromJSON(json) { return PaletteColorizerFromJSONTyped(json, false); } export function PaletteColorizerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,17 +45,17 @@ export function PaletteColorizerFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function PaletteColorizerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PaletteColorizerToJSON(json) { + return PaletteColorizerToJSONTyped(json, false); +} +export function PaletteColorizerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'colors': value.colors, - 'defaultColor': value.defaultColor, - 'noDataColor': value.noDataColor, - 'type': value.type, + 'colors': value['colors'], + 'defaultColor': value['defaultColor'], + 'noDataColor': value['noDataColor'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/Permission.d.ts b/typescript/dist/esm/models/Permission.d.ts index 536e9c9b..8340d063 100644 --- a/typescript/dist/esm/models/Permission.d.ts +++ b/typescript/dist/esm/models/Permission.d.ts @@ -18,6 +18,8 @@ export declare const Permission: { readonly Owner: "Owner"; }; export type Permission = typeof Permission[keyof typeof Permission]; +export declare function instanceOfPermission(value: any): boolean; export declare function PermissionFromJSON(json: any): Permission; export declare function PermissionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Permission; export declare function PermissionToJSON(value?: Permission | null): any; +export declare function PermissionToJSONTyped(value: any, ignoreDiscriminator: boolean): Permission; diff --git a/typescript/dist/esm/models/Permission.js b/typescript/dist/esm/models/Permission.js index 5b37fb0f..5a42f6bc 100644 --- a/typescript/dist/esm/models/Permission.js +++ b/typescript/dist/esm/models/Permission.js @@ -19,6 +19,16 @@ export const Permission = { Read: 'Read', Owner: 'Owner' }; +export function instanceOfPermission(value) { + for (const key in Permission) { + if (Object.prototype.hasOwnProperty.call(Permission, key)) { + if (Permission[key] === value) { + return true; + } + } + } + return false; +} export function PermissionFromJSON(json) { return PermissionFromJSONTyped(json, false); } @@ -28,3 +38,6 @@ export function PermissionFromJSONTyped(json, ignoreDiscriminator) { export function PermissionToJSON(value) { return value; } +export function PermissionToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/PermissionListOptions.d.ts b/typescript/dist/esm/models/PermissionListOptions.d.ts index 8421c48c..e71ecf61 100644 --- a/typescript/dist/esm/models/PermissionListOptions.d.ts +++ b/typescript/dist/esm/models/PermissionListOptions.d.ts @@ -31,7 +31,8 @@ export interface PermissionListOptions { /** * Check if a given object implements the PermissionListOptions interface. */ -export declare function instanceOfPermissionListOptions(value: object): boolean; +export declare function instanceOfPermissionListOptions(value: object): value is PermissionListOptions; export declare function PermissionListOptionsFromJSON(json: any): PermissionListOptions; export declare function PermissionListOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PermissionListOptions; -export declare function PermissionListOptionsToJSON(value?: PermissionListOptions | null): any; +export declare function PermissionListOptionsToJSON(json: any): PermissionListOptions; +export declare function PermissionListOptionsToJSONTyped(value?: PermissionListOptions | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/PermissionListOptions.js b/typescript/dist/esm/models/PermissionListOptions.js index 851ee8d6..703c9d03 100644 --- a/typescript/dist/esm/models/PermissionListOptions.js +++ b/typescript/dist/esm/models/PermissionListOptions.js @@ -15,16 +15,17 @@ * Check if a given object implements the PermissionListOptions interface. */ export function instanceOfPermissionListOptions(value) { - let isInstance = true; - isInstance = isInstance && "limit" in value; - isInstance = isInstance && "offset" in value; - return isInstance; + if (!('limit' in value) || value['limit'] === undefined) + return false; + if (!('offset' in value) || value['offset'] === undefined) + return false; + return true; } export function PermissionListOptionsFromJSON(json) { return PermissionListOptionsFromJSONTyped(json, false); } export function PermissionListOptionsFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function PermissionListOptionsFromJSONTyped(json, ignoreDiscriminator) { 'offset': json['offset'], }; } -export function PermissionListOptionsToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PermissionListOptionsToJSON(json) { + return PermissionListOptionsToJSONTyped(json, false); +} +export function PermissionListOptionsToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'limit': value.limit, - 'offset': value.offset, + 'limit': value['limit'], + 'offset': value['offset'], }; } diff --git a/typescript/dist/esm/models/PermissionListing.d.ts b/typescript/dist/esm/models/PermissionListing.d.ts index 13d526d2..12b1e759 100644 --- a/typescript/dist/esm/models/PermissionListing.d.ts +++ b/typescript/dist/esm/models/PermissionListing.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import type { Role } from './Role'; import type { Permission } from './Permission'; import type { Resource } from './Resource'; -import type { Role } from './Role'; /** * * @export @@ -40,7 +40,8 @@ export interface PermissionListing { /** * Check if a given object implements the PermissionListing interface. */ -export declare function instanceOfPermissionListing(value: object): boolean; +export declare function instanceOfPermissionListing(value: object): value is PermissionListing; export declare function PermissionListingFromJSON(json: any): PermissionListing; export declare function PermissionListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): PermissionListing; -export declare function PermissionListingToJSON(value?: PermissionListing | null): any; +export declare function PermissionListingToJSON(json: any): PermissionListing; +export declare function PermissionListingToJSONTyped(value?: PermissionListing | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/PermissionListing.js b/typescript/dist/esm/models/PermissionListing.js index 92ed5603..eddf6906 100644 --- a/typescript/dist/esm/models/PermissionListing.js +++ b/typescript/dist/esm/models/PermissionListing.js @@ -11,24 +11,26 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import { RoleFromJSON, RoleToJSON, } from './Role'; import { PermissionFromJSON, PermissionToJSON, } from './Permission'; import { ResourceFromJSON, ResourceToJSON, } from './Resource'; -import { RoleFromJSON, RoleToJSON, } from './Role'; /** * Check if a given object implements the PermissionListing interface. */ export function instanceOfPermissionListing(value) { - let isInstance = true; - isInstance = isInstance && "permission" in value; - isInstance = isInstance && "resource" in value; - isInstance = isInstance && "role" in value; - return isInstance; + if (!('permission' in value) || value['permission'] === undefined) + return false; + if (!('resource' in value) || value['resource'] === undefined) + return false; + if (!('role' in value) || value['role'] === undefined) + return false; + return true; } export function PermissionListingFromJSON(json) { return PermissionListingFromJSONTyped(json, false); } export function PermissionListingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,16 +39,16 @@ export function PermissionListingFromJSONTyped(json, ignoreDiscriminator) { 'role': RoleFromJSON(json['role']), }; } -export function PermissionListingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PermissionListingToJSON(json) { + return PermissionListingToJSONTyped(json, false); +} +export function PermissionListingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'permission': PermissionToJSON(value.permission), - 'resource': ResourceToJSON(value.resource), - 'role': RoleToJSON(value.role), + 'permission': PermissionToJSON(value['permission']), + 'resource': ResourceToJSON(value['resource']), + 'role': RoleToJSON(value['role']), }; } diff --git a/typescript/dist/esm/models/PermissionRequest.d.ts b/typescript/dist/esm/models/PermissionRequest.d.ts index b7d92f5e..d2d019e2 100644 --- a/typescript/dist/esm/models/PermissionRequest.d.ts +++ b/typescript/dist/esm/models/PermissionRequest.d.ts @@ -39,7 +39,8 @@ export interface PermissionRequest { /** * Check if a given object implements the PermissionRequest interface. */ -export declare function instanceOfPermissionRequest(value: object): boolean; +export declare function instanceOfPermissionRequest(value: object): value is PermissionRequest; export declare function PermissionRequestFromJSON(json: any): PermissionRequest; export declare function PermissionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PermissionRequest; -export declare function PermissionRequestToJSON(value?: PermissionRequest | null): any; +export declare function PermissionRequestToJSON(json: any): PermissionRequest; +export declare function PermissionRequestToJSONTyped(value?: PermissionRequest | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/PermissionRequest.js b/typescript/dist/esm/models/PermissionRequest.js index 1b079130..c7daddc4 100644 --- a/typescript/dist/esm/models/PermissionRequest.js +++ b/typescript/dist/esm/models/PermissionRequest.js @@ -17,17 +17,19 @@ import { ResourceFromJSON, ResourceToJSON, } from './Resource'; * Check if a given object implements the PermissionRequest interface. */ export function instanceOfPermissionRequest(value) { - let isInstance = true; - isInstance = isInstance && "permission" in value; - isInstance = isInstance && "resource" in value; - isInstance = isInstance && "roleId" in value; - return isInstance; + if (!('permission' in value) || value['permission'] === undefined) + return false; + if (!('resource' in value) || value['resource'] === undefined) + return false; + if (!('roleId' in value) || value['roleId'] === undefined) + return false; + return true; } export function PermissionRequestFromJSON(json) { return PermissionRequestFromJSONTyped(json, false); } export function PermissionRequestFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -36,16 +38,16 @@ export function PermissionRequestFromJSONTyped(json, ignoreDiscriminator) { 'roleId': json['roleId'], }; } -export function PermissionRequestToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PermissionRequestToJSON(json) { + return PermissionRequestToJSONTyped(json, false); +} +export function PermissionRequestToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'permission': PermissionToJSON(value.permission), - 'resource': ResourceToJSON(value.resource), - 'roleId': value.roleId, + 'permission': PermissionToJSON(value['permission']), + 'resource': ResourceToJSON(value['resource']), + 'roleId': value['roleId'], }; } diff --git a/typescript/dist/esm/models/Plot.d.ts b/typescript/dist/esm/models/Plot.d.ts index 6d14ad5b..f9a70f0f 100644 --- a/typescript/dist/esm/models/Plot.d.ts +++ b/typescript/dist/esm/models/Plot.d.ts @@ -31,7 +31,8 @@ export interface Plot { /** * Check if a given object implements the Plot interface. */ -export declare function instanceOfPlot(value: object): boolean; +export declare function instanceOfPlot(value: object): value is Plot; export declare function PlotFromJSON(json: any): Plot; export declare function PlotFromJSONTyped(json: any, ignoreDiscriminator: boolean): Plot; -export declare function PlotToJSON(value?: Plot | null): any; +export declare function PlotToJSON(json: any): Plot; +export declare function PlotToJSONTyped(value?: Plot | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Plot.js b/typescript/dist/esm/models/Plot.js index 3e24a8a0..60c030ed 100644 --- a/typescript/dist/esm/models/Plot.js +++ b/typescript/dist/esm/models/Plot.js @@ -15,16 +15,17 @@ * Check if a given object implements the Plot interface. */ export function instanceOfPlot(value) { - let isInstance = true; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - return isInstance; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('workflow' in value) || value['workflow'] === undefined) + return false; + return true; } export function PlotFromJSON(json) { return PlotFromJSONTyped(json, false); } export function PlotFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function PlotFromJSONTyped(json, ignoreDiscriminator) { 'workflow': json['workflow'], }; } -export function PlotToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PlotToJSON(json) { + return PlotToJSONTyped(json, false); +} +export function PlotToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'name': value.name, - 'workflow': value.workflow, + 'name': value['name'], + 'workflow': value['workflow'], }; } diff --git a/typescript/dist/esm/models/PlotOutputFormat.d.ts b/typescript/dist/esm/models/PlotOutputFormat.d.ts index ab9a0b29..580c698b 100644 --- a/typescript/dist/esm/models/PlotOutputFormat.d.ts +++ b/typescript/dist/esm/models/PlotOutputFormat.d.ts @@ -19,6 +19,8 @@ export declare const PlotOutputFormat: { readonly ImagePng: "ImagePng"; }; export type PlotOutputFormat = typeof PlotOutputFormat[keyof typeof PlotOutputFormat]; +export declare function instanceOfPlotOutputFormat(value: any): boolean; export declare function PlotOutputFormatFromJSON(json: any): PlotOutputFormat; export declare function PlotOutputFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlotOutputFormat; export declare function PlotOutputFormatToJSON(value?: PlotOutputFormat | null): any; +export declare function PlotOutputFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): PlotOutputFormat; diff --git a/typescript/dist/esm/models/PlotOutputFormat.js b/typescript/dist/esm/models/PlotOutputFormat.js index 10d8d8ef..8c7d2c98 100644 --- a/typescript/dist/esm/models/PlotOutputFormat.js +++ b/typescript/dist/esm/models/PlotOutputFormat.js @@ -20,6 +20,16 @@ export const PlotOutputFormat = { JsonVega: 'JsonVega', ImagePng: 'ImagePng' }; +export function instanceOfPlotOutputFormat(value) { + for (const key in PlotOutputFormat) { + if (Object.prototype.hasOwnProperty.call(PlotOutputFormat, key)) { + if (PlotOutputFormat[key] === value) { + return true; + } + } + } + return false; +} export function PlotOutputFormatFromJSON(json) { return PlotOutputFormatFromJSONTyped(json, false); } @@ -29,3 +39,6 @@ export function PlotOutputFormatFromJSONTyped(json, ignoreDiscriminator) { export function PlotOutputFormatToJSON(value) { return value; } +export function PlotOutputFormatToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/PlotQueryRectangle.d.ts b/typescript/dist/esm/models/PlotQueryRectangle.d.ts index 1262e22d..a704eb37 100644 --- a/typescript/dist/esm/models/PlotQueryRectangle.d.ts +++ b/typescript/dist/esm/models/PlotQueryRectangle.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; import type { SpatialResolution } from './SpatialResolution'; import type { TimeInterval } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * A spatio-temporal rectangle with a specified resolution * @export @@ -40,7 +40,8 @@ export interface PlotQueryRectangle { /** * Check if a given object implements the PlotQueryRectangle interface. */ -export declare function instanceOfPlotQueryRectangle(value: object): boolean; +export declare function instanceOfPlotQueryRectangle(value: object): value is PlotQueryRectangle; export declare function PlotQueryRectangleFromJSON(json: any): PlotQueryRectangle; export declare function PlotQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlotQueryRectangle; -export declare function PlotQueryRectangleToJSON(value?: PlotQueryRectangle | null): any; +export declare function PlotQueryRectangleToJSON(json: any): PlotQueryRectangle; +export declare function PlotQueryRectangleToJSONTyped(value?: PlotQueryRectangle | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/PlotQueryRectangle.js b/typescript/dist/esm/models/PlotQueryRectangle.js index 4e17b71a..00e7bab4 100644 --- a/typescript/dist/esm/models/PlotQueryRectangle.js +++ b/typescript/dist/esm/models/PlotQueryRectangle.js @@ -11,24 +11,26 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; import { SpatialResolutionFromJSON, SpatialResolutionToJSON, } from './SpatialResolution'; import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; +import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; /** * Check if a given object implements the PlotQueryRectangle interface. */ export function instanceOfPlotQueryRectangle(value) { - let isInstance = true; - isInstance = isInstance && "spatialBounds" in value; - isInstance = isInstance && "spatialResolution" in value; - isInstance = isInstance && "timeInterval" in value; - return isInstance; + if (!('spatialBounds' in value) || value['spatialBounds'] === undefined) + return false; + if (!('spatialResolution' in value) || value['spatialResolution'] === undefined) + return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) + return false; + return true; } export function PlotQueryRectangleFromJSON(json) { return PlotQueryRectangleFromJSONTyped(json, false); } export function PlotQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,16 +39,16 @@ export function PlotQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { 'timeInterval': TimeIntervalFromJSON(json['timeInterval']), }; } -export function PlotQueryRectangleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PlotQueryRectangleToJSON(json) { + return PlotQueryRectangleToJSONTyped(json, false); +} +export function PlotQueryRectangleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'spatialBounds': BoundingBox2DToJSON(value.spatialBounds), - 'spatialResolution': SpatialResolutionToJSON(value.spatialResolution), - 'timeInterval': TimeIntervalToJSON(value.timeInterval), + 'spatialBounds': BoundingBox2DToJSON(value['spatialBounds']), + 'spatialResolution': SpatialResolutionToJSON(value['spatialResolution']), + 'timeInterval': TimeIntervalToJSON(value['timeInterval']), }; } diff --git a/typescript/dist/esm/models/PlotResultDescriptor.d.ts b/typescript/dist/esm/models/PlotResultDescriptor.d.ts index 159861ce..e66ac542 100644 --- a/typescript/dist/esm/models/PlotResultDescriptor.d.ts +++ b/typescript/dist/esm/models/PlotResultDescriptor.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; import type { TimeInterval } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * A `ResultDescriptor` for plot queries * @export @@ -39,7 +39,8 @@ export interface PlotResultDescriptor { /** * Check if a given object implements the PlotResultDescriptor interface. */ -export declare function instanceOfPlotResultDescriptor(value: object): boolean; +export declare function instanceOfPlotResultDescriptor(value: object): value is PlotResultDescriptor; export declare function PlotResultDescriptorFromJSON(json: any): PlotResultDescriptor; export declare function PlotResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlotResultDescriptor; -export declare function PlotResultDescriptorToJSON(value?: PlotResultDescriptor | null): any; +export declare function PlotResultDescriptorToJSON(json: any): PlotResultDescriptor; +export declare function PlotResultDescriptorToJSONTyped(value?: PlotResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/PlotResultDescriptor.js b/typescript/dist/esm/models/PlotResultDescriptor.js index 78fc5383..2db82f84 100644 --- a/typescript/dist/esm/models/PlotResultDescriptor.js +++ b/typescript/dist/esm/models/PlotResultDescriptor.js @@ -11,40 +11,39 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; +import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; /** * Check if a given object implements the PlotResultDescriptor interface. */ export function instanceOfPlotResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "spatialReference" in value; - return isInstance; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + return true; } export function PlotResultDescriptorFromJSON(json) { return PlotResultDescriptorFromJSONTyped(json, false); } export function PlotResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !exists(json, 'bbox') ? undefined : BoundingBox2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : BoundingBox2DFromJSON(json['bbox']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), }; } -export function PlotResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PlotResultDescriptorToJSON(json) { + return PlotResultDescriptorToJSONTyped(json, false); +} +export function PlotResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bbox': BoundingBox2DToJSON(value.bbox), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), + 'bbox': BoundingBox2DToJSON(value['bbox']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), }; } diff --git a/typescript/dist/esm/models/PlotUpdate.d.ts b/typescript/dist/esm/models/PlotUpdate.d.ts index 422a95b0..d72055db 100644 --- a/typescript/dist/esm/models/PlotUpdate.d.ts +++ b/typescript/dist/esm/models/PlotUpdate.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { Plot } from './Plot'; -import { ProjectUpdateToken } from './ProjectUpdateToken'; +import type { Plot } from './Plot'; +import type { ProjectUpdateToken } from './ProjectUpdateToken'; /** * @type PlotUpdate * @@ -19,4 +19,5 @@ import { ProjectUpdateToken } from './ProjectUpdateToken'; export type PlotUpdate = Plot | ProjectUpdateToken; export declare function PlotUpdateFromJSON(json: any): PlotUpdate; export declare function PlotUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlotUpdate; -export declare function PlotUpdateToJSON(value?: PlotUpdate | null): any; +export declare function PlotUpdateToJSON(json: any): any; +export declare function PlotUpdateToJSONTyped(value?: PlotUpdate | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/PlotUpdate.js b/typescript/dist/esm/models/PlotUpdate.js index 24f96370..13189641 100644 --- a/typescript/dist/esm/models/PlotUpdate.js +++ b/typescript/dist/esm/models/PlotUpdate.js @@ -12,30 +12,28 @@ * Do not edit the class manually. */ import { instanceOfPlot, PlotFromJSONTyped, PlotToJSON, } from './Plot'; -import { ProjectUpdateToken, instanceOfProjectUpdateToken, ProjectUpdateTokenToJSON, } from './ProjectUpdateToken'; +import { instanceOfProjectUpdateToken, ProjectUpdateTokenFromJSONTyped, ProjectUpdateTokenToJSON, } from './ProjectUpdateToken'; export function PlotUpdateFromJSON(json) { return PlotUpdateFromJSONTyped(json, false); } export function PlotUpdateFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - if (json === ProjectUpdateToken.None) { - return ProjectUpdateToken.None; + if (instanceOfPlot(json)) { + return PlotFromJSONTyped(json, true); } - else if (json === ProjectUpdateToken.Delete) { - return ProjectUpdateToken.Delete; - } - else { - return Object.assign({}, PlotFromJSONTyped(json, true)); + if (instanceOfProjectUpdateToken(json)) { + return ProjectUpdateTokenFromJSONTyped(json, true); } + return {}; } -export function PlotUpdateToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PlotUpdateToJSON(json) { + return PlotUpdateToJSONTyped(json, false); +} +export function PlotUpdateToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } if (typeof value === 'object' && instanceOfPlot(value)) { return PlotToJSON(value); diff --git a/typescript/dist/esm/models/PointSymbology.d.ts b/typescript/dist/esm/models/PointSymbology.d.ts index 93f7ef4f..b778e1d2 100644 --- a/typescript/dist/esm/models/PointSymbology.d.ts +++ b/typescript/dist/esm/models/PointSymbology.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { ColorParam } from './ColorParam'; -import type { NumberParam } from './NumberParam'; -import type { StrokeParam } from './StrokeParam'; import type { TextSymbology } from './TextSymbology'; +import type { StrokeParam } from './StrokeParam'; +import type { NumberParam } from './NumberParam'; +import type { ColorParam } from './ColorParam'; /** * * @export @@ -60,7 +60,8 @@ export type PointSymbologyTypeEnum = typeof PointSymbologyTypeEnum[keyof typeof /** * Check if a given object implements the PointSymbology interface. */ -export declare function instanceOfPointSymbology(value: object): boolean; +export declare function instanceOfPointSymbology(value: object): value is PointSymbology; export declare function PointSymbologyFromJSON(json: any): PointSymbology; export declare function PointSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PointSymbology; -export declare function PointSymbologyToJSON(value?: PointSymbology | null): any; +export declare function PointSymbologyToJSON(json: any): PointSymbology; +export declare function PointSymbologyToJSONTyped(value?: PointSymbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/PointSymbology.js b/typescript/dist/esm/models/PointSymbology.js index 031d130d..ec2b62a6 100644 --- a/typescript/dist/esm/models/PointSymbology.js +++ b/typescript/dist/esm/models/PointSymbology.js @@ -11,11 +11,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { ColorParamFromJSON, ColorParamToJSON, } from './ColorParam'; -import { NumberParamFromJSON, NumberParamToJSON, } from './NumberParam'; -import { StrokeParamFromJSON, StrokeParamToJSON, } from './StrokeParam'; import { TextSymbologyFromJSON, TextSymbologyToJSON, } from './TextSymbology'; +import { StrokeParamFromJSON, StrokeParamToJSON, } from './StrokeParam'; +import { NumberParamFromJSON, NumberParamToJSON, } from './NumberParam'; +import { ColorParamFromJSON, ColorParamToJSON, } from './ColorParam'; /** * @export */ @@ -26,40 +25,43 @@ export const PointSymbologyTypeEnum = { * Check if a given object implements the PointSymbology interface. */ export function instanceOfPointSymbology(value) { - let isInstance = true; - isInstance = isInstance && "fillColor" in value; - isInstance = isInstance && "radius" in value; - isInstance = isInstance && "stroke" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('fillColor' in value) || value['fillColor'] === undefined) + return false; + if (!('radius' in value) || value['radius'] === undefined) + return false; + if (!('stroke' in value) || value['stroke'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function PointSymbologyFromJSON(json) { return PointSymbologyFromJSONTyped(json, false); } export function PointSymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'fillColor': ColorParamFromJSON(json['fillColor']), 'radius': NumberParamFromJSON(json['radius']), 'stroke': StrokeParamFromJSON(json['stroke']), - 'text': !exists(json, 'text') ? undefined : TextSymbologyFromJSON(json['text']), + 'text': json['text'] == null ? undefined : TextSymbologyFromJSON(json['text']), 'type': json['type'], }; } -export function PointSymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PointSymbologyToJSON(json) { + return PointSymbologyToJSONTyped(json, false); +} +export function PointSymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'fillColor': ColorParamToJSON(value.fillColor), - 'radius': NumberParamToJSON(value.radius), - 'stroke': StrokeParamToJSON(value.stroke), - 'text': TextSymbologyToJSON(value.text), - 'type': value.type, + 'fillColor': ColorParamToJSON(value['fillColor']), + 'radius': NumberParamToJSON(value['radius']), + 'stroke': StrokeParamToJSON(value['stroke']), + 'text': TextSymbologyToJSON(value['text']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/PolygonSymbology.d.ts b/typescript/dist/esm/models/PolygonSymbology.d.ts index 33e2c149..d1d80598 100644 --- a/typescript/dist/esm/models/PolygonSymbology.d.ts +++ b/typescript/dist/esm/models/PolygonSymbology.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { ColorParam } from './ColorParam'; -import type { StrokeParam } from './StrokeParam'; import type { TextSymbology } from './TextSymbology'; +import type { StrokeParam } from './StrokeParam'; +import type { ColorParam } from './ColorParam'; /** * * @export @@ -59,7 +59,8 @@ export type PolygonSymbologyTypeEnum = typeof PolygonSymbologyTypeEnum[keyof typ /** * Check if a given object implements the PolygonSymbology interface. */ -export declare function instanceOfPolygonSymbology(value: object): boolean; +export declare function instanceOfPolygonSymbology(value: object): value is PolygonSymbology; export declare function PolygonSymbologyFromJSON(json: any): PolygonSymbology; export declare function PolygonSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PolygonSymbology; -export declare function PolygonSymbologyToJSON(value?: PolygonSymbology | null): any; +export declare function PolygonSymbologyToJSON(json: any): PolygonSymbology; +export declare function PolygonSymbologyToJSONTyped(value?: PolygonSymbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/PolygonSymbology.js b/typescript/dist/esm/models/PolygonSymbology.js index 4ae4cb42..e1fb23c0 100644 --- a/typescript/dist/esm/models/PolygonSymbology.js +++ b/typescript/dist/esm/models/PolygonSymbology.js @@ -11,10 +11,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { ColorParamFromJSON, ColorParamToJSON, } from './ColorParam'; -import { StrokeParamFromJSON, StrokeParamToJSON, } from './StrokeParam'; import { TextSymbologyFromJSON, TextSymbologyToJSON, } from './TextSymbology'; +import { StrokeParamFromJSON, StrokeParamToJSON, } from './StrokeParam'; +import { ColorParamFromJSON, ColorParamToJSON, } from './ColorParam'; /** * @export */ @@ -25,40 +24,43 @@ export const PolygonSymbologyTypeEnum = { * Check if a given object implements the PolygonSymbology interface. */ export function instanceOfPolygonSymbology(value) { - let isInstance = true; - isInstance = isInstance && "autoSimplified" in value; - isInstance = isInstance && "fillColor" in value; - isInstance = isInstance && "stroke" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('autoSimplified' in value) || value['autoSimplified'] === undefined) + return false; + if (!('fillColor' in value) || value['fillColor'] === undefined) + return false; + if (!('stroke' in value) || value['stroke'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function PolygonSymbologyFromJSON(json) { return PolygonSymbologyFromJSONTyped(json, false); } export function PolygonSymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'autoSimplified': json['autoSimplified'], 'fillColor': ColorParamFromJSON(json['fillColor']), 'stroke': StrokeParamFromJSON(json['stroke']), - 'text': !exists(json, 'text') ? undefined : TextSymbologyFromJSON(json['text']), + 'text': json['text'] == null ? undefined : TextSymbologyFromJSON(json['text']), 'type': json['type'], }; } -export function PolygonSymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PolygonSymbologyToJSON(json) { + return PolygonSymbologyToJSONTyped(json, false); +} +export function PolygonSymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'autoSimplified': value.autoSimplified, - 'fillColor': ColorParamToJSON(value.fillColor), - 'stroke': StrokeParamToJSON(value.stroke), - 'text': TextSymbologyToJSON(value.text), - 'type': value.type, + 'autoSimplified': value['autoSimplified'], + 'fillColor': ColorParamToJSON(value['fillColor']), + 'stroke': StrokeParamToJSON(value['stroke']), + 'text': TextSymbologyToJSON(value['text']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/Project.d.ts b/typescript/dist/esm/models/Project.d.ts index db1736f6..d28c5a44 100644 --- a/typescript/dist/esm/models/Project.d.ts +++ b/typescript/dist/esm/models/Project.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import type { TimeStep } from './TimeStep'; import type { Plot } from './Plot'; -import type { ProjectLayer } from './ProjectLayer'; import type { ProjectVersion } from './ProjectVersion'; import type { STRectangle } from './STRectangle'; -import type { TimeStep } from './TimeStep'; +import type { ProjectLayer } from './ProjectLayer'; /** * * @export @@ -72,7 +72,8 @@ export interface Project { /** * Check if a given object implements the Project interface. */ -export declare function instanceOfProject(value: object): boolean; +export declare function instanceOfProject(value: object): value is Project; export declare function ProjectFromJSON(json: any): Project; export declare function ProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): Project; -export declare function ProjectToJSON(value?: Project | null): any; +export declare function ProjectToJSON(json: any): Project; +export declare function ProjectToJSONTyped(value?: Project | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Project.js b/typescript/dist/esm/models/Project.js index 26c2b8f4..50109b82 100644 --- a/typescript/dist/esm/models/Project.js +++ b/typescript/dist/esm/models/Project.js @@ -11,31 +11,38 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import { TimeStepFromJSON, TimeStepToJSON, } from './TimeStep'; import { PlotFromJSON, PlotToJSON, } from './Plot'; -import { ProjectLayerFromJSON, ProjectLayerToJSON, } from './ProjectLayer'; import { ProjectVersionFromJSON, ProjectVersionToJSON, } from './ProjectVersion'; import { STRectangleFromJSON, STRectangleToJSON, } from './STRectangle'; -import { TimeStepFromJSON, TimeStepToJSON, } from './TimeStep'; +import { ProjectLayerFromJSON, ProjectLayerToJSON, } from './ProjectLayer'; /** * Check if a given object implements the Project interface. */ export function instanceOfProject(value) { - let isInstance = true; - isInstance = isInstance && "bounds" in value; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "layers" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "plots" in value; - isInstance = isInstance && "timeStep" in value; - isInstance = isInstance && "version" in value; - return isInstance; + if (!('bounds' in value) || value['bounds'] === undefined) + return false; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('layers' in value) || value['layers'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('plots' in value) || value['plots'] === undefined) + return false; + if (!('timeStep' in value) || value['timeStep'] === undefined) + return false; + if (!('version' in value) || value['version'] === undefined) + return false; + return true; } export function ProjectFromJSON(json) { return ProjectFromJSONTyped(json, false); } export function ProjectFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -49,21 +56,21 @@ export function ProjectFromJSONTyped(json, ignoreDiscriminator) { 'version': ProjectVersionFromJSON(json['version']), }; } -export function ProjectToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProjectToJSON(json) { + return ProjectToJSONTyped(json, false); +} +export function ProjectToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bounds': STRectangleToJSON(value.bounds), - 'description': value.description, - 'id': value.id, - 'layers': (value.layers.map(ProjectLayerToJSON)), - 'name': value.name, - 'plots': (value.plots.map(PlotToJSON)), - 'timeStep': TimeStepToJSON(value.timeStep), - 'version': ProjectVersionToJSON(value.version), + 'bounds': STRectangleToJSON(value['bounds']), + 'description': value['description'], + 'id': value['id'], + 'layers': (value['layers'].map(ProjectLayerToJSON)), + 'name': value['name'], + 'plots': (value['plots'].map(PlotToJSON)), + 'timeStep': TimeStepToJSON(value['timeStep']), + 'version': ProjectVersionToJSON(value['version']), }; } diff --git a/typescript/dist/esm/models/ProjectLayer.d.ts b/typescript/dist/esm/models/ProjectLayer.d.ts index 67280de1..ee868427 100644 --- a/typescript/dist/esm/models/ProjectLayer.d.ts +++ b/typescript/dist/esm/models/ProjectLayer.d.ts @@ -45,7 +45,8 @@ export interface ProjectLayer { /** * Check if a given object implements the ProjectLayer interface. */ -export declare function instanceOfProjectLayer(value: object): boolean; +export declare function instanceOfProjectLayer(value: object): value is ProjectLayer; export declare function ProjectLayerFromJSON(json: any): ProjectLayer; export declare function ProjectLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectLayer; -export declare function ProjectLayerToJSON(value?: ProjectLayer | null): any; +export declare function ProjectLayerToJSON(json: any): ProjectLayer; +export declare function ProjectLayerToJSONTyped(value?: ProjectLayer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ProjectLayer.js b/typescript/dist/esm/models/ProjectLayer.js index b2d5c9df..67c65f42 100644 --- a/typescript/dist/esm/models/ProjectLayer.js +++ b/typescript/dist/esm/models/ProjectLayer.js @@ -17,18 +17,21 @@ import { SymbologyFromJSON, SymbologyToJSON, } from './Symbology'; * Check if a given object implements the ProjectLayer interface. */ export function instanceOfProjectLayer(value) { - let isInstance = true; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "symbology" in value; - isInstance = isInstance && "visibility" in value; - isInstance = isInstance && "workflow" in value; - return isInstance; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('symbology' in value) || value['symbology'] === undefined) + return false; + if (!('visibility' in value) || value['visibility'] === undefined) + return false; + if (!('workflow' in value) || value['workflow'] === undefined) + return false; + return true; } export function ProjectLayerFromJSON(json) { return ProjectLayerFromJSONTyped(json, false); } export function ProjectLayerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,17 +41,17 @@ export function ProjectLayerFromJSONTyped(json, ignoreDiscriminator) { 'workflow': json['workflow'], }; } -export function ProjectLayerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProjectLayerToJSON(json) { + return ProjectLayerToJSONTyped(json, false); +} +export function ProjectLayerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'name': value.name, - 'symbology': SymbologyToJSON(value.symbology), - 'visibility': LayerVisibilityToJSON(value.visibility), - 'workflow': value.workflow, + 'name': value['name'], + 'symbology': SymbologyToJSON(value['symbology']), + 'visibility': LayerVisibilityToJSON(value['visibility']), + 'workflow': value['workflow'], }; } diff --git a/typescript/dist/esm/models/ProjectListing.d.ts b/typescript/dist/esm/models/ProjectListing.d.ts index 4d755f72..5961c6b9 100644 --- a/typescript/dist/esm/models/ProjectListing.d.ts +++ b/typescript/dist/esm/models/ProjectListing.d.ts @@ -55,7 +55,8 @@ export interface ProjectListing { /** * Check if a given object implements the ProjectListing interface. */ -export declare function instanceOfProjectListing(value: object): boolean; +export declare function instanceOfProjectListing(value: object): value is ProjectListing; export declare function ProjectListingFromJSON(json: any): ProjectListing; export declare function ProjectListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectListing; -export declare function ProjectListingToJSON(value?: ProjectListing | null): any; +export declare function ProjectListingToJSON(json: any): ProjectListing; +export declare function ProjectListingToJSONTyped(value?: ProjectListing | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ProjectListing.js b/typescript/dist/esm/models/ProjectListing.js index 7fd3e3bd..33961eed 100644 --- a/typescript/dist/esm/models/ProjectListing.js +++ b/typescript/dist/esm/models/ProjectListing.js @@ -15,20 +15,25 @@ * Check if a given object implements the ProjectListing interface. */ export function instanceOfProjectListing(value) { - let isInstance = true; - isInstance = isInstance && "changed" in value; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "layerNames" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "plotNames" in value; - return isInstance; + if (!('changed' in value) || value['changed'] === undefined) + return false; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('layerNames' in value) || value['layerNames'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('plotNames' in value) || value['plotNames'] === undefined) + return false; + return true; } export function ProjectListingFromJSON(json) { return ProjectListingFromJSONTyped(json, false); } export function ProjectListingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -40,19 +45,19 @@ export function ProjectListingFromJSONTyped(json, ignoreDiscriminator) { 'plotNames': json['plotNames'], }; } -export function ProjectListingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProjectListingToJSON(json) { + return ProjectListingToJSONTyped(json, false); +} +export function ProjectListingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'changed': (value.changed.toISOString()), - 'description': value.description, - 'id': value.id, - 'layerNames': value.layerNames, - 'name': value.name, - 'plotNames': value.plotNames, + 'changed': ((value['changed']).toISOString()), + 'description': value['description'], + 'id': value['id'], + 'layerNames': value['layerNames'], + 'name': value['name'], + 'plotNames': value['plotNames'], }; } diff --git a/typescript/dist/esm/models/ProjectResource.d.ts b/typescript/dist/esm/models/ProjectResource.d.ts index 3f17fdca..cec38c91 100644 --- a/typescript/dist/esm/models/ProjectResource.d.ts +++ b/typescript/dist/esm/models/ProjectResource.d.ts @@ -38,7 +38,8 @@ export type ProjectResourceTypeEnum = typeof ProjectResourceTypeEnum[keyof typeo /** * Check if a given object implements the ProjectResource interface. */ -export declare function instanceOfProjectResource(value: object): boolean; +export declare function instanceOfProjectResource(value: object): value is ProjectResource; export declare function ProjectResourceFromJSON(json: any): ProjectResource; export declare function ProjectResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectResource; -export declare function ProjectResourceToJSON(value?: ProjectResource | null): any; +export declare function ProjectResourceToJSON(json: any): ProjectResource; +export declare function ProjectResourceToJSONTyped(value?: ProjectResource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ProjectResource.js b/typescript/dist/esm/models/ProjectResource.js index feff8244..863508a0 100644 --- a/typescript/dist/esm/models/ProjectResource.js +++ b/typescript/dist/esm/models/ProjectResource.js @@ -21,16 +21,17 @@ export const ProjectResourceTypeEnum = { * Check if a given object implements the ProjectResource interface. */ export function instanceOfProjectResource(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function ProjectResourceFromJSON(json) { return ProjectResourceFromJSONTyped(json, false); } export function ProjectResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,15 +39,15 @@ export function ProjectResourceFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function ProjectResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProjectResourceToJSON(json) { + return ProjectResourceToJSONTyped(json, false); +} +export function ProjectResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/ProjectUpdateToken.d.ts b/typescript/dist/esm/models/ProjectUpdateToken.d.ts index b774adf5..e5d4daae 100644 --- a/typescript/dist/esm/models/ProjectUpdateToken.d.ts +++ b/typescript/dist/esm/models/ProjectUpdateToken.d.ts @@ -18,7 +18,8 @@ export declare const ProjectUpdateToken: { readonly Delete: "delete"; }; export type ProjectUpdateToken = typeof ProjectUpdateToken[keyof typeof ProjectUpdateToken]; +export declare function instanceOfProjectUpdateToken(value: any): boolean; export declare function ProjectUpdateTokenFromJSON(json: any): ProjectUpdateToken; export declare function ProjectUpdateTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectUpdateToken; -export declare function instanceOfProjectUpdateToken(value: any): boolean; export declare function ProjectUpdateTokenToJSON(value?: ProjectUpdateToken | null): any; +export declare function ProjectUpdateTokenToJSONTyped(value: any, ignoreDiscriminator: boolean): ProjectUpdateToken; diff --git a/typescript/dist/esm/models/ProjectUpdateToken.js b/typescript/dist/esm/models/ProjectUpdateToken.js index 09db844a..7f2fbd31 100644 --- a/typescript/dist/esm/models/ProjectUpdateToken.js +++ b/typescript/dist/esm/models/ProjectUpdateToken.js @@ -19,15 +19,25 @@ export const ProjectUpdateToken = { None: 'none', Delete: 'delete' }; +export function instanceOfProjectUpdateToken(value) { + for (const key in ProjectUpdateToken) { + if (Object.prototype.hasOwnProperty.call(ProjectUpdateToken, key)) { + if (ProjectUpdateToken[key] === value) { + return true; + } + } + } + return false; +} export function ProjectUpdateTokenFromJSON(json) { return ProjectUpdateTokenFromJSONTyped(json, false); } export function ProjectUpdateTokenFromJSONTyped(json, ignoreDiscriminator) { return json; } -export function instanceOfProjectUpdateToken(value) { - return value === ProjectUpdateToken.None || value === ProjectUpdateToken.Delete; -} export function ProjectUpdateTokenToJSON(value) { return value; } +export function ProjectUpdateTokenToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/ProjectVersion.d.ts b/typescript/dist/esm/models/ProjectVersion.d.ts index 53c498d3..865d0190 100644 --- a/typescript/dist/esm/models/ProjectVersion.d.ts +++ b/typescript/dist/esm/models/ProjectVersion.d.ts @@ -31,7 +31,8 @@ export interface ProjectVersion { /** * Check if a given object implements the ProjectVersion interface. */ -export declare function instanceOfProjectVersion(value: object): boolean; +export declare function instanceOfProjectVersion(value: object): value is ProjectVersion; export declare function ProjectVersionFromJSON(json: any): ProjectVersion; export declare function ProjectVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectVersion; -export declare function ProjectVersionToJSON(value?: ProjectVersion | null): any; +export declare function ProjectVersionToJSON(json: any): ProjectVersion; +export declare function ProjectVersionToJSONTyped(value?: ProjectVersion | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ProjectVersion.js b/typescript/dist/esm/models/ProjectVersion.js index 0d061e64..b4746582 100644 --- a/typescript/dist/esm/models/ProjectVersion.js +++ b/typescript/dist/esm/models/ProjectVersion.js @@ -15,16 +15,17 @@ * Check if a given object implements the ProjectVersion interface. */ export function instanceOfProjectVersion(value) { - let isInstance = true; - isInstance = isInstance && "changed" in value; - isInstance = isInstance && "id" in value; - return isInstance; + if (!('changed' in value) || value['changed'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + return true; } export function ProjectVersionFromJSON(json) { return ProjectVersionFromJSONTyped(json, false); } export function ProjectVersionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function ProjectVersionFromJSONTyped(json, ignoreDiscriminator) { 'id': json['id'], }; } -export function ProjectVersionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProjectVersionToJSON(json) { + return ProjectVersionToJSONTyped(json, false); +} +export function ProjectVersionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'changed': (value.changed.toISOString()), - 'id': value.id, + 'changed': ((value['changed']).toISOString()), + 'id': value['id'], }; } diff --git a/typescript/dist/esm/models/Provenance.d.ts b/typescript/dist/esm/models/Provenance.d.ts index 27abef59..261dd5a4 100644 --- a/typescript/dist/esm/models/Provenance.d.ts +++ b/typescript/dist/esm/models/Provenance.d.ts @@ -37,7 +37,8 @@ export interface Provenance { /** * Check if a given object implements the Provenance interface. */ -export declare function instanceOfProvenance(value: object): boolean; +export declare function instanceOfProvenance(value: object): value is Provenance; export declare function ProvenanceFromJSON(json: any): Provenance; export declare function ProvenanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Provenance; -export declare function ProvenanceToJSON(value?: Provenance | null): any; +export declare function ProvenanceToJSON(json: any): Provenance; +export declare function ProvenanceToJSONTyped(value?: Provenance | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Provenance.js b/typescript/dist/esm/models/Provenance.js index 037d0df9..34cccb0b 100644 --- a/typescript/dist/esm/models/Provenance.js +++ b/typescript/dist/esm/models/Provenance.js @@ -15,17 +15,19 @@ * Check if a given object implements the Provenance interface. */ export function instanceOfProvenance(value) { - let isInstance = true; - isInstance = isInstance && "citation" in value; - isInstance = isInstance && "license" in value; - isInstance = isInstance && "uri" in value; - return isInstance; + if (!('citation' in value) || value['citation'] === undefined) + return false; + if (!('license' in value) || value['license'] === undefined) + return false; + if (!('uri' in value) || value['uri'] === undefined) + return false; + return true; } export function ProvenanceFromJSON(json) { return ProvenanceFromJSONTyped(json, false); } export function ProvenanceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -34,16 +36,16 @@ export function ProvenanceFromJSONTyped(json, ignoreDiscriminator) { 'uri': json['uri'], }; } -export function ProvenanceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProvenanceToJSON(json) { + return ProvenanceToJSONTyped(json, false); +} +export function ProvenanceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'citation': value.citation, - 'license': value.license, - 'uri': value.uri, + 'citation': value['citation'], + 'license': value['license'], + 'uri': value['uri'], }; } diff --git a/typescript/dist/esm/models/ProvenanceEntry.d.ts b/typescript/dist/esm/models/ProvenanceEntry.d.ts index 201905bc..51773c9f 100644 --- a/typescript/dist/esm/models/ProvenanceEntry.d.ts +++ b/typescript/dist/esm/models/ProvenanceEntry.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { DataId } from './DataId'; import type { Provenance } from './Provenance'; +import type { DataId } from './DataId'; /** * * @export @@ -33,7 +33,8 @@ export interface ProvenanceEntry { /** * Check if a given object implements the ProvenanceEntry interface. */ -export declare function instanceOfProvenanceEntry(value: object): boolean; +export declare function instanceOfProvenanceEntry(value: object): value is ProvenanceEntry; export declare function ProvenanceEntryFromJSON(json: any): ProvenanceEntry; export declare function ProvenanceEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProvenanceEntry; -export declare function ProvenanceEntryToJSON(value?: ProvenanceEntry | null): any; +export declare function ProvenanceEntryToJSON(json: any): ProvenanceEntry; +export declare function ProvenanceEntryToJSONTyped(value?: ProvenanceEntry | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ProvenanceEntry.js b/typescript/dist/esm/models/ProvenanceEntry.js index 9fcb78a3..7793a198 100644 --- a/typescript/dist/esm/models/ProvenanceEntry.js +++ b/typescript/dist/esm/models/ProvenanceEntry.js @@ -11,22 +11,23 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DataIdFromJSON, DataIdToJSON, } from './DataId'; import { ProvenanceFromJSON, ProvenanceToJSON, } from './Provenance'; +import { DataIdFromJSON, DataIdToJSON, } from './DataId'; /** * Check if a given object implements the ProvenanceEntry interface. */ export function instanceOfProvenanceEntry(value) { - let isInstance = true; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "provenance" in value; - return isInstance; + if (!('data' in value) || value['data'] === undefined) + return false; + if (!('provenance' in value) || value['provenance'] === undefined) + return false; + return true; } export function ProvenanceEntryFromJSON(json) { return ProvenanceEntryFromJSONTyped(json, false); } export function ProvenanceEntryFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -34,15 +35,15 @@ export function ProvenanceEntryFromJSONTyped(json, ignoreDiscriminator) { 'provenance': ProvenanceFromJSON(json['provenance']), }; } -export function ProvenanceEntryToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProvenanceEntryToJSON(json) { + return ProvenanceEntryToJSONTyped(json, false); +} +export function ProvenanceEntryToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'data': (value.data.map(DataIdToJSON)), - 'provenance': ProvenanceToJSON(value.provenance), + 'data': (value['data'].map(DataIdToJSON)), + 'provenance': ProvenanceToJSON(value['provenance']), }; } diff --git a/typescript/dist/esm/models/ProvenanceOutput.d.ts b/typescript/dist/esm/models/ProvenanceOutput.d.ts index 4db62aef..edd3a866 100644 --- a/typescript/dist/esm/models/ProvenanceOutput.d.ts +++ b/typescript/dist/esm/models/ProvenanceOutput.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { DataId } from './DataId'; import type { Provenance } from './Provenance'; +import type { DataId } from './DataId'; /** * * @export @@ -33,7 +33,8 @@ export interface ProvenanceOutput { /** * Check if a given object implements the ProvenanceOutput interface. */ -export declare function instanceOfProvenanceOutput(value: object): boolean; +export declare function instanceOfProvenanceOutput(value: object): value is ProvenanceOutput; export declare function ProvenanceOutputFromJSON(json: any): ProvenanceOutput; export declare function ProvenanceOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProvenanceOutput; -export declare function ProvenanceOutputToJSON(value?: ProvenanceOutput | null): any; +export declare function ProvenanceOutputToJSON(json: any): ProvenanceOutput; +export declare function ProvenanceOutputToJSONTyped(value?: ProvenanceOutput | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ProvenanceOutput.js b/typescript/dist/esm/models/ProvenanceOutput.js index 5af6be4e..a605a1be 100644 --- a/typescript/dist/esm/models/ProvenanceOutput.js +++ b/typescript/dist/esm/models/ProvenanceOutput.js @@ -11,38 +11,37 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { DataIdFromJSON, DataIdToJSON, } from './DataId'; import { ProvenanceFromJSON, ProvenanceToJSON, } from './Provenance'; +import { DataIdFromJSON, DataIdToJSON, } from './DataId'; /** * Check if a given object implements the ProvenanceOutput interface. */ export function instanceOfProvenanceOutput(value) { - let isInstance = true; - isInstance = isInstance && "data" in value; - return isInstance; + if (!('data' in value) || value['data'] === undefined) + return false; + return true; } export function ProvenanceOutputFromJSON(json) { return ProvenanceOutputFromJSONTyped(json, false); } export function ProvenanceOutputFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'data': DataIdFromJSON(json['data']), - 'provenance': !exists(json, 'provenance') ? undefined : (json['provenance'] === null ? null : json['provenance'].map(ProvenanceFromJSON)), + 'provenance': json['provenance'] == null ? undefined : (json['provenance'].map(ProvenanceFromJSON)), }; } -export function ProvenanceOutputToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProvenanceOutputToJSON(json) { + return ProvenanceOutputToJSONTyped(json, false); +} +export function ProvenanceOutputToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'data': DataIdToJSON(value.data), - 'provenance': value.provenance === undefined ? undefined : (value.provenance === null ? null : value.provenance.map(ProvenanceToJSON)), + 'data': DataIdToJSON(value['data']), + 'provenance': value['provenance'] == null ? undefined : (value['provenance'].map(ProvenanceToJSON)), }; } diff --git a/typescript/dist/esm/models/Provenances.d.ts b/typescript/dist/esm/models/Provenances.d.ts index 3396296e..6b34eb12 100644 --- a/typescript/dist/esm/models/Provenances.d.ts +++ b/typescript/dist/esm/models/Provenances.d.ts @@ -26,7 +26,8 @@ export interface Provenances { /** * Check if a given object implements the Provenances interface. */ -export declare function instanceOfProvenances(value: object): boolean; +export declare function instanceOfProvenances(value: object): value is Provenances; export declare function ProvenancesFromJSON(json: any): Provenances; export declare function ProvenancesFromJSONTyped(json: any, ignoreDiscriminator: boolean): Provenances; -export declare function ProvenancesToJSON(value?: Provenances | null): any; +export declare function ProvenancesToJSON(json: any): Provenances; +export declare function ProvenancesToJSONTyped(value?: Provenances | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Provenances.js b/typescript/dist/esm/models/Provenances.js index ba78fa91..c565a848 100644 --- a/typescript/dist/esm/models/Provenances.js +++ b/typescript/dist/esm/models/Provenances.js @@ -16,29 +16,29 @@ import { ProvenanceFromJSON, ProvenanceToJSON, } from './Provenance'; * Check if a given object implements the Provenances interface. */ export function instanceOfProvenances(value) { - let isInstance = true; - isInstance = isInstance && "provenances" in value; - return isInstance; + if (!('provenances' in value) || value['provenances'] === undefined) + return false; + return true; } export function ProvenancesFromJSON(json) { return ProvenancesFromJSONTyped(json, false); } export function ProvenancesFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'provenances': (json['provenances'].map(ProvenanceFromJSON)), }; } -export function ProvenancesToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProvenancesToJSON(json) { + return ProvenancesToJSONTyped(json, false); +} +export function ProvenancesToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'provenances': (value.provenances.map(ProvenanceToJSON)), + 'provenances': (value['provenances'].map(ProvenanceToJSON)), }; } diff --git a/typescript/dist/esm/models/ProviderCapabilities.d.ts b/typescript/dist/esm/models/ProviderCapabilities.d.ts index 09c7c0ed..9c7abe92 100644 --- a/typescript/dist/esm/models/ProviderCapabilities.d.ts +++ b/typescript/dist/esm/models/ProviderCapabilities.d.ts @@ -32,7 +32,8 @@ export interface ProviderCapabilities { /** * Check if a given object implements the ProviderCapabilities interface. */ -export declare function instanceOfProviderCapabilities(value: object): boolean; +export declare function instanceOfProviderCapabilities(value: object): value is ProviderCapabilities; export declare function ProviderCapabilitiesFromJSON(json: any): ProviderCapabilities; export declare function ProviderCapabilitiesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderCapabilities; -export declare function ProviderCapabilitiesToJSON(value?: ProviderCapabilities | null): any; +export declare function ProviderCapabilitiesToJSON(json: any): ProviderCapabilities; +export declare function ProviderCapabilitiesToJSONTyped(value?: ProviderCapabilities | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ProviderCapabilities.js b/typescript/dist/esm/models/ProviderCapabilities.js index 6408fd2c..bd2abacc 100644 --- a/typescript/dist/esm/models/ProviderCapabilities.js +++ b/typescript/dist/esm/models/ProviderCapabilities.js @@ -16,16 +16,17 @@ import { SearchCapabilitiesFromJSON, SearchCapabilitiesToJSON, } from './SearchC * Check if a given object implements the ProviderCapabilities interface. */ export function instanceOfProviderCapabilities(value) { - let isInstance = true; - isInstance = isInstance && "listing" in value; - isInstance = isInstance && "search" in value; - return isInstance; + if (!('listing' in value) || value['listing'] === undefined) + return false; + if (!('search' in value) || value['search'] === undefined) + return false; + return true; } export function ProviderCapabilitiesFromJSON(json) { return ProviderCapabilitiesFromJSONTyped(json, false); } export function ProviderCapabilitiesFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -33,15 +34,15 @@ export function ProviderCapabilitiesFromJSONTyped(json, ignoreDiscriminator) { 'search': SearchCapabilitiesFromJSON(json['search']), }; } -export function ProviderCapabilitiesToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProviderCapabilitiesToJSON(json) { + return ProviderCapabilitiesToJSONTyped(json, false); +} +export function ProviderCapabilitiesToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'listing': value.listing, - 'search': SearchCapabilitiesToJSON(value.search), + 'listing': value['listing'], + 'search': SearchCapabilitiesToJSON(value['search']), }; } diff --git a/typescript/dist/esm/models/ProviderLayerCollectionId.d.ts b/typescript/dist/esm/models/ProviderLayerCollectionId.d.ts index 2ee909ae..c92867ec 100644 --- a/typescript/dist/esm/models/ProviderLayerCollectionId.d.ts +++ b/typescript/dist/esm/models/ProviderLayerCollectionId.d.ts @@ -31,7 +31,8 @@ export interface ProviderLayerCollectionId { /** * Check if a given object implements the ProviderLayerCollectionId interface. */ -export declare function instanceOfProviderLayerCollectionId(value: object): boolean; +export declare function instanceOfProviderLayerCollectionId(value: object): value is ProviderLayerCollectionId; export declare function ProviderLayerCollectionIdFromJSON(json: any): ProviderLayerCollectionId; export declare function ProviderLayerCollectionIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderLayerCollectionId; -export declare function ProviderLayerCollectionIdToJSON(value?: ProviderLayerCollectionId | null): any; +export declare function ProviderLayerCollectionIdToJSON(json: any): ProviderLayerCollectionId; +export declare function ProviderLayerCollectionIdToJSONTyped(value?: ProviderLayerCollectionId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ProviderLayerCollectionId.js b/typescript/dist/esm/models/ProviderLayerCollectionId.js index af783993..a854a7cd 100644 --- a/typescript/dist/esm/models/ProviderLayerCollectionId.js +++ b/typescript/dist/esm/models/ProviderLayerCollectionId.js @@ -15,16 +15,17 @@ * Check if a given object implements the ProviderLayerCollectionId interface. */ export function instanceOfProviderLayerCollectionId(value) { - let isInstance = true; - isInstance = isInstance && "collectionId" in value; - isInstance = isInstance && "providerId" in value; - return isInstance; + if (!('collectionId' in value) || value['collectionId'] === undefined) + return false; + if (!('providerId' in value) || value['providerId'] === undefined) + return false; + return true; } export function ProviderLayerCollectionIdFromJSON(json) { return ProviderLayerCollectionIdFromJSONTyped(json, false); } export function ProviderLayerCollectionIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function ProviderLayerCollectionIdFromJSONTyped(json, ignoreDiscriminator 'providerId': json['providerId'], }; } -export function ProviderLayerCollectionIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProviderLayerCollectionIdToJSON(json) { + return ProviderLayerCollectionIdToJSONTyped(json, false); +} +export function ProviderLayerCollectionIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'collectionId': value.collectionId, - 'providerId': value.providerId, + 'collectionId': value['collectionId'], + 'providerId': value['providerId'], }; } diff --git a/typescript/dist/esm/models/ProviderLayerId.d.ts b/typescript/dist/esm/models/ProviderLayerId.d.ts index a116a721..bd3e3489 100644 --- a/typescript/dist/esm/models/ProviderLayerId.d.ts +++ b/typescript/dist/esm/models/ProviderLayerId.d.ts @@ -31,7 +31,8 @@ export interface ProviderLayerId { /** * Check if a given object implements the ProviderLayerId interface. */ -export declare function instanceOfProviderLayerId(value: object): boolean; +export declare function instanceOfProviderLayerId(value: object): value is ProviderLayerId; export declare function ProviderLayerIdFromJSON(json: any): ProviderLayerId; export declare function ProviderLayerIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderLayerId; -export declare function ProviderLayerIdToJSON(value?: ProviderLayerId | null): any; +export declare function ProviderLayerIdToJSON(json: any): ProviderLayerId; +export declare function ProviderLayerIdToJSONTyped(value?: ProviderLayerId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ProviderLayerId.js b/typescript/dist/esm/models/ProviderLayerId.js index f9451905..1e145375 100644 --- a/typescript/dist/esm/models/ProviderLayerId.js +++ b/typescript/dist/esm/models/ProviderLayerId.js @@ -15,16 +15,17 @@ * Check if a given object implements the ProviderLayerId interface. */ export function instanceOfProviderLayerId(value) { - let isInstance = true; - isInstance = isInstance && "layerId" in value; - isInstance = isInstance && "providerId" in value; - return isInstance; + if (!('layerId' in value) || value['layerId'] === undefined) + return false; + if (!('providerId' in value) || value['providerId'] === undefined) + return false; + return true; } export function ProviderLayerIdFromJSON(json) { return ProviderLayerIdFromJSONTyped(json, false); } export function ProviderLayerIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function ProviderLayerIdFromJSONTyped(json, ignoreDiscriminator) { 'providerId': json['providerId'], }; } -export function ProviderLayerIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProviderLayerIdToJSON(json) { + return ProviderLayerIdToJSONTyped(json, false); +} +export function ProviderLayerIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'layerId': value.layerId, - 'providerId': value.providerId, + 'layerId': value['layerId'], + 'providerId': value['providerId'], }; } diff --git a/typescript/dist/esm/models/Quota.d.ts b/typescript/dist/esm/models/Quota.d.ts index aacaf997..2bfabd2d 100644 --- a/typescript/dist/esm/models/Quota.d.ts +++ b/typescript/dist/esm/models/Quota.d.ts @@ -31,7 +31,8 @@ export interface Quota { /** * Check if a given object implements the Quota interface. */ -export declare function instanceOfQuota(value: object): boolean; +export declare function instanceOfQuota(value: object): value is Quota; export declare function QuotaFromJSON(json: any): Quota; export declare function QuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): Quota; -export declare function QuotaToJSON(value?: Quota | null): any; +export declare function QuotaToJSON(json: any): Quota; +export declare function QuotaToJSONTyped(value?: Quota | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Quota.js b/typescript/dist/esm/models/Quota.js index ce88880a..5bafb583 100644 --- a/typescript/dist/esm/models/Quota.js +++ b/typescript/dist/esm/models/Quota.js @@ -15,16 +15,17 @@ * Check if a given object implements the Quota interface. */ export function instanceOfQuota(value) { - let isInstance = true; - isInstance = isInstance && "available" in value; - isInstance = isInstance && "used" in value; - return isInstance; + if (!('available' in value) || value['available'] === undefined) + return false; + if (!('used' in value) || value['used'] === undefined) + return false; + return true; } export function QuotaFromJSON(json) { return QuotaFromJSONTyped(json, false); } export function QuotaFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function QuotaFromJSONTyped(json, ignoreDiscriminator) { 'used': json['used'], }; } -export function QuotaToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function QuotaToJSON(json) { + return QuotaToJSONTyped(json, false); +} +export function QuotaToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'available': value.available, - 'used': value.used, + 'available': value['available'], + 'used': value['used'], }; } diff --git a/typescript/dist/esm/models/RasterBandDescriptor.d.ts b/typescript/dist/esm/models/RasterBandDescriptor.d.ts index f92d1e13..39902342 100644 --- a/typescript/dist/esm/models/RasterBandDescriptor.d.ts +++ b/typescript/dist/esm/models/RasterBandDescriptor.d.ts @@ -32,7 +32,8 @@ export interface RasterBandDescriptor { /** * Check if a given object implements the RasterBandDescriptor interface. */ -export declare function instanceOfRasterBandDescriptor(value: object): boolean; +export declare function instanceOfRasterBandDescriptor(value: object): value is RasterBandDescriptor; export declare function RasterBandDescriptorFromJSON(json: any): RasterBandDescriptor; export declare function RasterBandDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterBandDescriptor; -export declare function RasterBandDescriptorToJSON(value?: RasterBandDescriptor | null): any; +export declare function RasterBandDescriptorToJSON(json: any): RasterBandDescriptor; +export declare function RasterBandDescriptorToJSONTyped(value?: RasterBandDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/RasterBandDescriptor.js b/typescript/dist/esm/models/RasterBandDescriptor.js index c7788391..dbcf8462 100644 --- a/typescript/dist/esm/models/RasterBandDescriptor.js +++ b/typescript/dist/esm/models/RasterBandDescriptor.js @@ -16,16 +16,17 @@ import { MeasurementFromJSON, MeasurementToJSON, } from './Measurement'; * Check if a given object implements the RasterBandDescriptor interface. */ export function instanceOfRasterBandDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "measurement" in value; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('measurement' in value) || value['measurement'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } export function RasterBandDescriptorFromJSON(json) { return RasterBandDescriptorFromJSONTyped(json, false); } export function RasterBandDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -33,15 +34,15 @@ export function RasterBandDescriptorFromJSONTyped(json, ignoreDiscriminator) { 'name': json['name'], }; } -export function RasterBandDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterBandDescriptorToJSON(json) { + return RasterBandDescriptorToJSONTyped(json, false); +} +export function RasterBandDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'measurement': MeasurementToJSON(value.measurement), - 'name': value.name, + 'measurement': MeasurementToJSON(value['measurement']), + 'name': value['name'], }; } diff --git a/typescript/dist/esm/models/RasterColorizer.d.ts b/typescript/dist/esm/models/RasterColorizer.d.ts index 419a61ef..5d339746 100644 --- a/typescript/dist/esm/models/RasterColorizer.d.ts +++ b/typescript/dist/esm/models/RasterColorizer.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { MultiBandRasterColorizer } from './MultiBandRasterColorizer'; -import { SingleBandRasterColorizer } from './SingleBandRasterColorizer'; +import type { MultiBandRasterColorizer } from './MultiBandRasterColorizer'; +import type { SingleBandRasterColorizer } from './SingleBandRasterColorizer'; /** * @type RasterColorizer * @@ -23,4 +23,5 @@ export type RasterColorizer = { } & SingleBandRasterColorizer; export declare function RasterColorizerFromJSON(json: any): RasterColorizer; export declare function RasterColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterColorizer; -export declare function RasterColorizerToJSON(value?: RasterColorizer | null): any; +export declare function RasterColorizerToJSON(json: any): any; +export declare function RasterColorizerToJSONTyped(value?: RasterColorizer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/RasterColorizer.js b/typescript/dist/esm/models/RasterColorizer.js index 3a832721..92c93334 100644 --- a/typescript/dist/esm/models/RasterColorizer.js +++ b/typescript/dist/esm/models/RasterColorizer.js @@ -17,30 +17,30 @@ export function RasterColorizerFromJSON(json) { return RasterColorizerFromJSONTyped(json, false); } export function RasterColorizerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'multiBand': - return Object.assign(Object.assign({}, MultiBandRasterColorizerFromJSONTyped(json, true)), { type: 'multiBand' }); + return Object.assign({}, MultiBandRasterColorizerFromJSONTyped(json, true), { type: 'multiBand' }); case 'singleBand': - return Object.assign(Object.assign({}, SingleBandRasterColorizerFromJSONTyped(json, true)), { type: 'singleBand' }); + return Object.assign({}, SingleBandRasterColorizerFromJSONTyped(json, true), { type: 'singleBand' }); default: throw new Error(`No variant of RasterColorizer exists with 'type=${json['type']}'`); } } -export function RasterColorizerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterColorizerToJSON(json) { + return RasterColorizerToJSONTyped(json, false); +} +export function RasterColorizerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'multiBand': - return MultiBandRasterColorizerToJSON(value); + return Object.assign({}, MultiBandRasterColorizerToJSON(value), { type: 'multiBand' }); case 'singleBand': - return SingleBandRasterColorizerToJSON(value); + return Object.assign({}, SingleBandRasterColorizerToJSON(value), { type: 'singleBand' }); default: throw new Error(`No variant of RasterColorizer exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/RasterDataType.d.ts b/typescript/dist/esm/models/RasterDataType.d.ts index 1bc186b0..7adc7ec7 100644 --- a/typescript/dist/esm/models/RasterDataType.d.ts +++ b/typescript/dist/esm/models/RasterDataType.d.ts @@ -26,6 +26,8 @@ export declare const RasterDataType: { readonly F64: "F64"; }; export type RasterDataType = typeof RasterDataType[keyof typeof RasterDataType]; +export declare function instanceOfRasterDataType(value: any): boolean; export declare function RasterDataTypeFromJSON(json: any): RasterDataType; export declare function RasterDataTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterDataType; export declare function RasterDataTypeToJSON(value?: RasterDataType | null): any; +export declare function RasterDataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): RasterDataType; diff --git a/typescript/dist/esm/models/RasterDataType.js b/typescript/dist/esm/models/RasterDataType.js index 19d7d5c8..6ebb543e 100644 --- a/typescript/dist/esm/models/RasterDataType.js +++ b/typescript/dist/esm/models/RasterDataType.js @@ -27,6 +27,16 @@ export const RasterDataType = { F32: 'F32', F64: 'F64' }; +export function instanceOfRasterDataType(value) { + for (const key in RasterDataType) { + if (Object.prototype.hasOwnProperty.call(RasterDataType, key)) { + if (RasterDataType[key] === value) { + return true; + } + } + } + return false; +} export function RasterDataTypeFromJSON(json) { return RasterDataTypeFromJSONTyped(json, false); } @@ -36,3 +46,6 @@ export function RasterDataTypeFromJSONTyped(json, ignoreDiscriminator) { export function RasterDataTypeToJSON(value) { return value; } +export function RasterDataTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/RasterDatasetFromWorkflow.d.ts b/typescript/dist/esm/models/RasterDatasetFromWorkflow.d.ts index befa1f2f..33426d0c 100644 --- a/typescript/dist/esm/models/RasterDatasetFromWorkflow.d.ts +++ b/typescript/dist/esm/models/RasterDatasetFromWorkflow.d.ts @@ -50,7 +50,8 @@ export interface RasterDatasetFromWorkflow { /** * Check if a given object implements the RasterDatasetFromWorkflow interface. */ -export declare function instanceOfRasterDatasetFromWorkflow(value: object): boolean; +export declare function instanceOfRasterDatasetFromWorkflow(value: object): value is RasterDatasetFromWorkflow; export declare function RasterDatasetFromWorkflowFromJSON(json: any): RasterDatasetFromWorkflow; export declare function RasterDatasetFromWorkflowFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterDatasetFromWorkflow; -export declare function RasterDatasetFromWorkflowToJSON(value?: RasterDatasetFromWorkflow | null): any; +export declare function RasterDatasetFromWorkflowToJSON(json: any): RasterDatasetFromWorkflow; +export declare function RasterDatasetFromWorkflowToJSONTyped(value?: RasterDatasetFromWorkflow | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/RasterDatasetFromWorkflow.js b/typescript/dist/esm/models/RasterDatasetFromWorkflow.js index d7f3a118..8a8366ca 100644 --- a/typescript/dist/esm/models/RasterDatasetFromWorkflow.js +++ b/typescript/dist/esm/models/RasterDatasetFromWorkflow.js @@ -11,44 +11,44 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { RasterQueryRectangleFromJSON, RasterQueryRectangleToJSON, } from './RasterQueryRectangle'; /** * Check if a given object implements the RasterDatasetFromWorkflow interface. */ export function instanceOfRasterDatasetFromWorkflow(value) { - let isInstance = true; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "query" in value; - return isInstance; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('query' in value) || value['query'] === undefined) + return false; + return true; } export function RasterDatasetFromWorkflowFromJSON(json) { return RasterDatasetFromWorkflowFromJSONTyped(json, false); } export function RasterDatasetFromWorkflowFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'asCog': !exists(json, 'asCog') ? undefined : json['asCog'], - 'description': !exists(json, 'description') ? undefined : json['description'], + 'asCog': json['asCog'] == null ? undefined : json['asCog'], + 'description': json['description'] == null ? undefined : json['description'], 'displayName': json['displayName'], - 'name': !exists(json, 'name') ? undefined : json['name'], + 'name': json['name'] == null ? undefined : json['name'], 'query': RasterQueryRectangleFromJSON(json['query']), }; } -export function RasterDatasetFromWorkflowToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterDatasetFromWorkflowToJSON(json) { + return RasterDatasetFromWorkflowToJSONTyped(json, false); +} +export function RasterDatasetFromWorkflowToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'asCog': value.asCog, - 'description': value.description, - 'displayName': value.displayName, - 'name': value.name, - 'query': RasterQueryRectangleToJSON(value.query), + 'asCog': value['asCog'], + 'description': value['description'], + 'displayName': value['displayName'], + 'name': value['name'], + 'query': RasterQueryRectangleToJSON(value['query']), }; } diff --git a/typescript/dist/esm/models/RasterDatasetFromWorkflowResult.d.ts b/typescript/dist/esm/models/RasterDatasetFromWorkflowResult.d.ts index ae2bc1b7..8dc5b237 100644 --- a/typescript/dist/esm/models/RasterDatasetFromWorkflowResult.d.ts +++ b/typescript/dist/esm/models/RasterDatasetFromWorkflowResult.d.ts @@ -31,7 +31,8 @@ export interface RasterDatasetFromWorkflowResult { /** * Check if a given object implements the RasterDatasetFromWorkflowResult interface. */ -export declare function instanceOfRasterDatasetFromWorkflowResult(value: object): boolean; +export declare function instanceOfRasterDatasetFromWorkflowResult(value: object): value is RasterDatasetFromWorkflowResult; export declare function RasterDatasetFromWorkflowResultFromJSON(json: any): RasterDatasetFromWorkflowResult; export declare function RasterDatasetFromWorkflowResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterDatasetFromWorkflowResult; -export declare function RasterDatasetFromWorkflowResultToJSON(value?: RasterDatasetFromWorkflowResult | null): any; +export declare function RasterDatasetFromWorkflowResultToJSON(json: any): RasterDatasetFromWorkflowResult; +export declare function RasterDatasetFromWorkflowResultToJSONTyped(value?: RasterDatasetFromWorkflowResult | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/RasterDatasetFromWorkflowResult.js b/typescript/dist/esm/models/RasterDatasetFromWorkflowResult.js index 9ca558f4..33f53d94 100644 --- a/typescript/dist/esm/models/RasterDatasetFromWorkflowResult.js +++ b/typescript/dist/esm/models/RasterDatasetFromWorkflowResult.js @@ -15,16 +15,17 @@ * Check if a given object implements the RasterDatasetFromWorkflowResult interface. */ export function instanceOfRasterDatasetFromWorkflowResult(value) { - let isInstance = true; - isInstance = isInstance && "dataset" in value; - isInstance = isInstance && "upload" in value; - return isInstance; + if (!('dataset' in value) || value['dataset'] === undefined) + return false; + if (!('upload' in value) || value['upload'] === undefined) + return false; + return true; } export function RasterDatasetFromWorkflowResultFromJSON(json) { return RasterDatasetFromWorkflowResultFromJSONTyped(json, false); } export function RasterDatasetFromWorkflowResultFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function RasterDatasetFromWorkflowResultFromJSONTyped(json, ignoreDiscrim 'upload': json['upload'], }; } -export function RasterDatasetFromWorkflowResultToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterDatasetFromWorkflowResultToJSON(json) { + return RasterDatasetFromWorkflowResultToJSONTyped(json, false); +} +export function RasterDatasetFromWorkflowResultToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'dataset': value.dataset, - 'upload': value.upload, + 'dataset': value['dataset'], + 'upload': value['upload'], }; } diff --git a/typescript/dist/esm/models/RasterPropertiesEntryType.d.ts b/typescript/dist/esm/models/RasterPropertiesEntryType.d.ts index e099bc24..f77ca49d 100644 --- a/typescript/dist/esm/models/RasterPropertiesEntryType.d.ts +++ b/typescript/dist/esm/models/RasterPropertiesEntryType.d.ts @@ -18,6 +18,8 @@ export declare const RasterPropertiesEntryType: { readonly String: "String"; }; export type RasterPropertiesEntryType = typeof RasterPropertiesEntryType[keyof typeof RasterPropertiesEntryType]; +export declare function instanceOfRasterPropertiesEntryType(value: any): boolean; export declare function RasterPropertiesEntryTypeFromJSON(json: any): RasterPropertiesEntryType; export declare function RasterPropertiesEntryTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterPropertiesEntryType; export declare function RasterPropertiesEntryTypeToJSON(value?: RasterPropertiesEntryType | null): any; +export declare function RasterPropertiesEntryTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): RasterPropertiesEntryType; diff --git a/typescript/dist/esm/models/RasterPropertiesEntryType.js b/typescript/dist/esm/models/RasterPropertiesEntryType.js index e2468b40..ab612c19 100644 --- a/typescript/dist/esm/models/RasterPropertiesEntryType.js +++ b/typescript/dist/esm/models/RasterPropertiesEntryType.js @@ -19,6 +19,16 @@ export const RasterPropertiesEntryType = { Number: 'Number', String: 'String' }; +export function instanceOfRasterPropertiesEntryType(value) { + for (const key in RasterPropertiesEntryType) { + if (Object.prototype.hasOwnProperty.call(RasterPropertiesEntryType, key)) { + if (RasterPropertiesEntryType[key] === value) { + return true; + } + } + } + return false; +} export function RasterPropertiesEntryTypeFromJSON(json) { return RasterPropertiesEntryTypeFromJSONTyped(json, false); } @@ -28,3 +38,6 @@ export function RasterPropertiesEntryTypeFromJSONTyped(json, ignoreDiscriminator export function RasterPropertiesEntryTypeToJSON(value) { return value; } +export function RasterPropertiesEntryTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/RasterPropertiesKey.d.ts b/typescript/dist/esm/models/RasterPropertiesKey.d.ts index 1651e0c6..c340d3e8 100644 --- a/typescript/dist/esm/models/RasterPropertiesKey.d.ts +++ b/typescript/dist/esm/models/RasterPropertiesKey.d.ts @@ -31,7 +31,8 @@ export interface RasterPropertiesKey { /** * Check if a given object implements the RasterPropertiesKey interface. */ -export declare function instanceOfRasterPropertiesKey(value: object): boolean; +export declare function instanceOfRasterPropertiesKey(value: object): value is RasterPropertiesKey; export declare function RasterPropertiesKeyFromJSON(json: any): RasterPropertiesKey; export declare function RasterPropertiesKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterPropertiesKey; -export declare function RasterPropertiesKeyToJSON(value?: RasterPropertiesKey | null): any; +export declare function RasterPropertiesKeyToJSON(json: any): RasterPropertiesKey; +export declare function RasterPropertiesKeyToJSONTyped(value?: RasterPropertiesKey | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/RasterPropertiesKey.js b/typescript/dist/esm/models/RasterPropertiesKey.js index cbc7f92d..3aa997dd 100644 --- a/typescript/dist/esm/models/RasterPropertiesKey.js +++ b/typescript/dist/esm/models/RasterPropertiesKey.js @@ -11,36 +11,35 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * Check if a given object implements the RasterPropertiesKey interface. */ export function instanceOfRasterPropertiesKey(value) { - let isInstance = true; - isInstance = isInstance && "key" in value; - return isInstance; + if (!('key' in value) || value['key'] === undefined) + return false; + return true; } export function RasterPropertiesKeyFromJSON(json) { return RasterPropertiesKeyFromJSONTyped(json, false); } export function RasterPropertiesKeyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'domain': !exists(json, 'domain') ? undefined : json['domain'], + 'domain': json['domain'] == null ? undefined : json['domain'], 'key': json['key'], }; } -export function RasterPropertiesKeyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterPropertiesKeyToJSON(json) { + return RasterPropertiesKeyToJSONTyped(json, false); +} +export function RasterPropertiesKeyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'domain': value.domain, - 'key': value.key, + 'domain': value['domain'], + 'key': value['key'], }; } diff --git a/typescript/dist/esm/models/RasterQueryRectangle.d.ts b/typescript/dist/esm/models/RasterQueryRectangle.d.ts index 38c6b2a7..03d13584 100644 --- a/typescript/dist/esm/models/RasterQueryRectangle.d.ts +++ b/typescript/dist/esm/models/RasterQueryRectangle.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { SpatialPartition2D } from './SpatialPartition2D'; import type { SpatialResolution } from './SpatialResolution'; import type { TimeInterval } from './TimeInterval'; +import type { SpatialPartition2D } from './SpatialPartition2D'; /** * A spatio-temporal rectangle with a specified resolution * @export @@ -40,7 +40,8 @@ export interface RasterQueryRectangle { /** * Check if a given object implements the RasterQueryRectangle interface. */ -export declare function instanceOfRasterQueryRectangle(value: object): boolean; +export declare function instanceOfRasterQueryRectangle(value: object): value is RasterQueryRectangle; export declare function RasterQueryRectangleFromJSON(json: any): RasterQueryRectangle; export declare function RasterQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterQueryRectangle; -export declare function RasterQueryRectangleToJSON(value?: RasterQueryRectangle | null): any; +export declare function RasterQueryRectangleToJSON(json: any): RasterQueryRectangle; +export declare function RasterQueryRectangleToJSONTyped(value?: RasterQueryRectangle | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/RasterQueryRectangle.js b/typescript/dist/esm/models/RasterQueryRectangle.js index 05611829..98807fb0 100644 --- a/typescript/dist/esm/models/RasterQueryRectangle.js +++ b/typescript/dist/esm/models/RasterQueryRectangle.js @@ -11,24 +11,26 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { SpatialPartition2DFromJSON, SpatialPartition2DToJSON, } from './SpatialPartition2D'; import { SpatialResolutionFromJSON, SpatialResolutionToJSON, } from './SpatialResolution'; import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; +import { SpatialPartition2DFromJSON, SpatialPartition2DToJSON, } from './SpatialPartition2D'; /** * Check if a given object implements the RasterQueryRectangle interface. */ export function instanceOfRasterQueryRectangle(value) { - let isInstance = true; - isInstance = isInstance && "spatialBounds" in value; - isInstance = isInstance && "spatialResolution" in value; - isInstance = isInstance && "timeInterval" in value; - return isInstance; + if (!('spatialBounds' in value) || value['spatialBounds'] === undefined) + return false; + if (!('spatialResolution' in value) || value['spatialResolution'] === undefined) + return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) + return false; + return true; } export function RasterQueryRectangleFromJSON(json) { return RasterQueryRectangleFromJSONTyped(json, false); } export function RasterQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,16 +39,16 @@ export function RasterQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { 'timeInterval': TimeIntervalFromJSON(json['timeInterval']), }; } -export function RasterQueryRectangleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterQueryRectangleToJSON(json) { + return RasterQueryRectangleToJSONTyped(json, false); +} +export function RasterQueryRectangleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'spatialBounds': SpatialPartition2DToJSON(value.spatialBounds), - 'spatialResolution': SpatialResolutionToJSON(value.spatialResolution), - 'timeInterval': TimeIntervalToJSON(value.timeInterval), + 'spatialBounds': SpatialPartition2DToJSON(value['spatialBounds']), + 'spatialResolution': SpatialResolutionToJSON(value['spatialResolution']), + 'timeInterval': TimeIntervalToJSON(value['timeInterval']), }; } diff --git a/typescript/dist/esm/models/RasterResultDescriptor.d.ts b/typescript/dist/esm/models/RasterResultDescriptor.d.ts index 681b9aee..d8decd8a 100644 --- a/typescript/dist/esm/models/RasterResultDescriptor.d.ts +++ b/typescript/dist/esm/models/RasterResultDescriptor.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import type { SpatialResolution } from './SpatialResolution'; +import type { TimeInterval } from './TimeInterval'; import type { RasterBandDescriptor } from './RasterBandDescriptor'; import type { RasterDataType } from './RasterDataType'; import type { SpatialPartition2D } from './SpatialPartition2D'; -import type { SpatialResolution } from './SpatialResolution'; -import type { TimeInterval } from './TimeInterval'; /** * A `ResultDescriptor` for raster queries * @export @@ -60,7 +60,8 @@ export interface RasterResultDescriptor { /** * Check if a given object implements the RasterResultDescriptor interface. */ -export declare function instanceOfRasterResultDescriptor(value: object): boolean; +export declare function instanceOfRasterResultDescriptor(value: object): value is RasterResultDescriptor; export declare function RasterResultDescriptorFromJSON(json: any): RasterResultDescriptor; export declare function RasterResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterResultDescriptor; -export declare function RasterResultDescriptorToJSON(value?: RasterResultDescriptor | null): any; +export declare function RasterResultDescriptorToJSON(json: any): RasterResultDescriptor; +export declare function RasterResultDescriptorToJSONTyped(value?: RasterResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/RasterResultDescriptor.js b/typescript/dist/esm/models/RasterResultDescriptor.js index a729b7a4..4a061bc3 100644 --- a/typescript/dist/esm/models/RasterResultDescriptor.js +++ b/typescript/dist/esm/models/RasterResultDescriptor.js @@ -11,51 +11,52 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; +import { SpatialResolutionFromJSON, SpatialResolutionToJSON, } from './SpatialResolution'; +import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; import { RasterBandDescriptorFromJSON, RasterBandDescriptorToJSON, } from './RasterBandDescriptor'; import { RasterDataTypeFromJSON, RasterDataTypeToJSON, } from './RasterDataType'; import { SpatialPartition2DFromJSON, SpatialPartition2DToJSON, } from './SpatialPartition2D'; -import { SpatialResolutionFromJSON, SpatialResolutionToJSON, } from './SpatialResolution'; -import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; /** * Check if a given object implements the RasterResultDescriptor interface. */ export function instanceOfRasterResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "bands" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - return isInstance; + if (!('bands' in value) || value['bands'] === undefined) + return false; + if (!('dataType' in value) || value['dataType'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + return true; } export function RasterResultDescriptorFromJSON(json) { return RasterResultDescriptorFromJSONTyped(json, false); } export function RasterResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bands': (json['bands'].map(RasterBandDescriptorFromJSON)), - 'bbox': !exists(json, 'bbox') ? undefined : SpatialPartition2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : SpatialPartition2DFromJSON(json['bbox']), 'dataType': RasterDataTypeFromJSON(json['dataType']), - 'resolution': !exists(json, 'resolution') ? undefined : SpatialResolutionFromJSON(json['resolution']), + 'resolution': json['resolution'] == null ? undefined : SpatialResolutionFromJSON(json['resolution']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), }; } -export function RasterResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterResultDescriptorToJSON(json) { + return RasterResultDescriptorToJSONTyped(json, false); +} +export function RasterResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bands': (value.bands.map(RasterBandDescriptorToJSON)), - 'bbox': SpatialPartition2DToJSON(value.bbox), - 'dataType': RasterDataTypeToJSON(value.dataType), - 'resolution': SpatialResolutionToJSON(value.resolution), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), + 'bands': (value['bands'].map(RasterBandDescriptorToJSON)), + 'bbox': SpatialPartition2DToJSON(value['bbox']), + 'dataType': RasterDataTypeToJSON(value['dataType']), + 'resolution': SpatialResolutionToJSON(value['resolution']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), }; } diff --git a/typescript/dist/esm/models/RasterStreamWebsocketResultType.d.ts b/typescript/dist/esm/models/RasterStreamWebsocketResultType.d.ts index 7d6d304b..1c1c0b2c 100644 --- a/typescript/dist/esm/models/RasterStreamWebsocketResultType.d.ts +++ b/typescript/dist/esm/models/RasterStreamWebsocketResultType.d.ts @@ -17,6 +17,8 @@ export declare const RasterStreamWebsocketResultType: { readonly Arrow: "arrow"; }; export type RasterStreamWebsocketResultType = typeof RasterStreamWebsocketResultType[keyof typeof RasterStreamWebsocketResultType]; +export declare function instanceOfRasterStreamWebsocketResultType(value: any): boolean; export declare function RasterStreamWebsocketResultTypeFromJSON(json: any): RasterStreamWebsocketResultType; export declare function RasterStreamWebsocketResultTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterStreamWebsocketResultType; export declare function RasterStreamWebsocketResultTypeToJSON(value?: RasterStreamWebsocketResultType | null): any; +export declare function RasterStreamWebsocketResultTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): RasterStreamWebsocketResultType; diff --git a/typescript/dist/esm/models/RasterStreamWebsocketResultType.js b/typescript/dist/esm/models/RasterStreamWebsocketResultType.js index d7d6d3fd..47ba6474 100644 --- a/typescript/dist/esm/models/RasterStreamWebsocketResultType.js +++ b/typescript/dist/esm/models/RasterStreamWebsocketResultType.js @@ -18,6 +18,16 @@ export const RasterStreamWebsocketResultType = { Arrow: 'arrow' }; +export function instanceOfRasterStreamWebsocketResultType(value) { + for (const key in RasterStreamWebsocketResultType) { + if (Object.prototype.hasOwnProperty.call(RasterStreamWebsocketResultType, key)) { + if (RasterStreamWebsocketResultType[key] === value) { + return true; + } + } + } + return false; +} export function RasterStreamWebsocketResultTypeFromJSON(json) { return RasterStreamWebsocketResultTypeFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function RasterStreamWebsocketResultTypeFromJSONTyped(json, ignoreDiscrim export function RasterStreamWebsocketResultTypeToJSON(value) { return value; } +export function RasterStreamWebsocketResultTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/RasterSymbology.d.ts b/typescript/dist/esm/models/RasterSymbology.d.ts index 9ae2052d..c5957ad2 100644 --- a/typescript/dist/esm/models/RasterSymbology.d.ts +++ b/typescript/dist/esm/models/RasterSymbology.d.ts @@ -45,7 +45,8 @@ export type RasterSymbologyTypeEnum = typeof RasterSymbologyTypeEnum[keyof typeo /** * Check if a given object implements the RasterSymbology interface. */ -export declare function instanceOfRasterSymbology(value: object): boolean; +export declare function instanceOfRasterSymbology(value: object): value is RasterSymbology; export declare function RasterSymbologyFromJSON(json: any): RasterSymbology; export declare function RasterSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterSymbology; -export declare function RasterSymbologyToJSON(value?: RasterSymbology | null): any; +export declare function RasterSymbologyToJSON(json: any): RasterSymbology; +export declare function RasterSymbologyToJSONTyped(value?: RasterSymbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/RasterSymbology.js b/typescript/dist/esm/models/RasterSymbology.js index 48fd6584..b091aed2 100644 --- a/typescript/dist/esm/models/RasterSymbology.js +++ b/typescript/dist/esm/models/RasterSymbology.js @@ -22,17 +22,19 @@ export const RasterSymbologyTypeEnum = { * Check if a given object implements the RasterSymbology interface. */ export function instanceOfRasterSymbology(value) { - let isInstance = true; - isInstance = isInstance && "opacity" in value; - isInstance = isInstance && "rasterColorizer" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('opacity' in value) || value['opacity'] === undefined) + return false; + if (!('rasterColorizer' in value) || value['rasterColorizer'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function RasterSymbologyFromJSON(json) { return RasterSymbologyFromJSONTyped(json, false); } export function RasterSymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,16 +43,16 @@ export function RasterSymbologyFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function RasterSymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterSymbologyToJSON(json) { + return RasterSymbologyToJSONTyped(json, false); +} +export function RasterSymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'opacity': value.opacity, - 'rasterColorizer': RasterColorizerToJSON(value.rasterColorizer), - 'type': value.type, + 'opacity': value['opacity'], + 'rasterColorizer': RasterColorizerToJSON(value['rasterColorizer']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/Resource.d.ts b/typescript/dist/esm/models/Resource.d.ts index 68910807..524dd463 100644 --- a/typescript/dist/esm/models/Resource.d.ts +++ b/typescript/dist/esm/models/Resource.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DatasetResource } from './DatasetResource'; -import { LayerCollectionResource } from './LayerCollectionResource'; -import { LayerResource } from './LayerResource'; -import { MlModelResource } from './MlModelResource'; -import { ProjectResource } from './ProjectResource'; +import type { DatasetResource } from './DatasetResource'; +import type { LayerCollectionResource } from './LayerCollectionResource'; +import type { LayerResource } from './LayerResource'; +import type { MlModelResource } from './MlModelResource'; +import type { ProjectResource } from './ProjectResource'; /** * @type Resource * @@ -32,4 +32,5 @@ export type Resource = { } & ProjectResource; export declare function ResourceFromJSON(json: any): Resource; export declare function ResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Resource; -export declare function ResourceToJSON(value?: Resource | null): any; +export declare function ResourceToJSON(json: any): any; +export declare function ResourceToJSONTyped(value?: Resource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Resource.js b/typescript/dist/esm/models/Resource.js index 719dd2b9..3ba24c9f 100644 --- a/typescript/dist/esm/models/Resource.js +++ b/typescript/dist/esm/models/Resource.js @@ -20,42 +20,42 @@ export function ResourceFromJSON(json) { return ResourceFromJSONTyped(json, false); } export function ResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'dataset': - return Object.assign(Object.assign({}, DatasetResourceFromJSONTyped(json, true)), { type: 'dataset' }); + return Object.assign({}, DatasetResourceFromJSONTyped(json, true), { type: 'dataset' }); case 'layer': - return Object.assign(Object.assign({}, LayerResourceFromJSONTyped(json, true)), { type: 'layer' }); + return Object.assign({}, LayerResourceFromJSONTyped(json, true), { type: 'layer' }); case 'layerCollection': - return Object.assign(Object.assign({}, LayerCollectionResourceFromJSONTyped(json, true)), { type: 'layerCollection' }); + return Object.assign({}, LayerCollectionResourceFromJSONTyped(json, true), { type: 'layerCollection' }); case 'mlModel': - return Object.assign(Object.assign({}, MlModelResourceFromJSONTyped(json, true)), { type: 'mlModel' }); + return Object.assign({}, MlModelResourceFromJSONTyped(json, true), { type: 'mlModel' }); case 'project': - return Object.assign(Object.assign({}, ProjectResourceFromJSONTyped(json, true)), { type: 'project' }); + return Object.assign({}, ProjectResourceFromJSONTyped(json, true), { type: 'project' }); default: throw new Error(`No variant of Resource exists with 'type=${json['type']}'`); } } -export function ResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceToJSON(json) { + return ResourceToJSONTyped(json, false); +} +export function ResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'dataset': - return DatasetResourceToJSON(value); + return Object.assign({}, DatasetResourceToJSON(value), { type: 'dataset' }); case 'layer': - return LayerResourceToJSON(value); + return Object.assign({}, LayerResourceToJSON(value), { type: 'layer' }); case 'layerCollection': - return LayerCollectionResourceToJSON(value); + return Object.assign({}, LayerCollectionResourceToJSON(value), { type: 'layerCollection' }); case 'mlModel': - return MlModelResourceToJSON(value); + return Object.assign({}, MlModelResourceToJSON(value), { type: 'mlModel' }); case 'project': - return ProjectResourceToJSON(value); + return Object.assign({}, ProjectResourceToJSON(value), { type: 'project' }); default: throw new Error(`No variant of Resource exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/ResourceId.d.ts b/typescript/dist/esm/models/ResourceId.d.ts index 71315089..8080fd6f 100644 --- a/typescript/dist/esm/models/ResourceId.d.ts +++ b/typescript/dist/esm/models/ResourceId.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ResourceIdDatasetId } from './ResourceIdDatasetId'; -import { ResourceIdLayer } from './ResourceIdLayer'; -import { ResourceIdLayerCollection } from './ResourceIdLayerCollection'; -import { ResourceIdMlModel } from './ResourceIdMlModel'; -import { ResourceIdProject } from './ResourceIdProject'; +import type { ResourceIdDatasetId } from './ResourceIdDatasetId'; +import type { ResourceIdLayer } from './ResourceIdLayer'; +import type { ResourceIdLayerCollection } from './ResourceIdLayerCollection'; +import type { ResourceIdMlModel } from './ResourceIdMlModel'; +import type { ResourceIdProject } from './ResourceIdProject'; /** * @type ResourceId * @@ -32,4 +32,5 @@ export type ResourceId = { } & ResourceIdProject; export declare function ResourceIdFromJSON(json: any): ResourceId; export declare function ResourceIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceId; -export declare function ResourceIdToJSON(value?: ResourceId | null): any; +export declare function ResourceIdToJSON(json: any): any; +export declare function ResourceIdToJSONTyped(value?: ResourceId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ResourceId.js b/typescript/dist/esm/models/ResourceId.js index 414ebb14..3296febd 100644 --- a/typescript/dist/esm/models/ResourceId.js +++ b/typescript/dist/esm/models/ResourceId.js @@ -20,42 +20,42 @@ export function ResourceIdFromJSON(json) { return ResourceIdFromJSONTyped(json, false); } export function ResourceIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'DatasetId': - return Object.assign(Object.assign({}, ResourceIdDatasetIdFromJSONTyped(json, true)), { type: 'DatasetId' }); + return Object.assign({}, ResourceIdDatasetIdFromJSONTyped(json, true), { type: 'DatasetId' }); case 'Layer': - return Object.assign(Object.assign({}, ResourceIdLayerFromJSONTyped(json, true)), { type: 'Layer' }); + return Object.assign({}, ResourceIdLayerFromJSONTyped(json, true), { type: 'Layer' }); case 'LayerCollection': - return Object.assign(Object.assign({}, ResourceIdLayerCollectionFromJSONTyped(json, true)), { type: 'LayerCollection' }); + return Object.assign({}, ResourceIdLayerCollectionFromJSONTyped(json, true), { type: 'LayerCollection' }); case 'MlModel': - return Object.assign(Object.assign({}, ResourceIdMlModelFromJSONTyped(json, true)), { type: 'MlModel' }); + return Object.assign({}, ResourceIdMlModelFromJSONTyped(json, true), { type: 'MlModel' }); case 'Project': - return Object.assign(Object.assign({}, ResourceIdProjectFromJSONTyped(json, true)), { type: 'Project' }); + return Object.assign({}, ResourceIdProjectFromJSONTyped(json, true), { type: 'Project' }); default: throw new Error(`No variant of ResourceId exists with 'type=${json['type']}'`); } } -export function ResourceIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdToJSON(json) { + return ResourceIdToJSONTyped(json, false); +} +export function ResourceIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'DatasetId': - return ResourceIdDatasetIdToJSON(value); + return Object.assign({}, ResourceIdDatasetIdToJSON(value), { type: 'DatasetId' }); case 'Layer': - return ResourceIdLayerToJSON(value); + return Object.assign({}, ResourceIdLayerToJSON(value), { type: 'Layer' }); case 'LayerCollection': - return ResourceIdLayerCollectionToJSON(value); + return Object.assign({}, ResourceIdLayerCollectionToJSON(value), { type: 'LayerCollection' }); case 'MlModel': - return ResourceIdMlModelToJSON(value); + return Object.assign({}, ResourceIdMlModelToJSON(value), { type: 'MlModel' }); case 'Project': - return ResourceIdProjectToJSON(value); + return Object.assign({}, ResourceIdProjectToJSON(value), { type: 'Project' }); default: throw new Error(`No variant of ResourceId exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/ResourceIdDatasetId.d.ts b/typescript/dist/esm/models/ResourceIdDatasetId.d.ts index 8f275dd2..9d2b4942 100644 --- a/typescript/dist/esm/models/ResourceIdDatasetId.d.ts +++ b/typescript/dist/esm/models/ResourceIdDatasetId.d.ts @@ -38,7 +38,8 @@ export type ResourceIdDatasetIdTypeEnum = typeof ResourceIdDatasetIdTypeEnum[key /** * Check if a given object implements the ResourceIdDatasetId interface. */ -export declare function instanceOfResourceIdDatasetId(value: object): boolean; +export declare function instanceOfResourceIdDatasetId(value: object): value is ResourceIdDatasetId; export declare function ResourceIdDatasetIdFromJSON(json: any): ResourceIdDatasetId; export declare function ResourceIdDatasetIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdDatasetId; -export declare function ResourceIdDatasetIdToJSON(value?: ResourceIdDatasetId | null): any; +export declare function ResourceIdDatasetIdToJSON(json: any): ResourceIdDatasetId; +export declare function ResourceIdDatasetIdToJSONTyped(value?: ResourceIdDatasetId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ResourceIdDatasetId.js b/typescript/dist/esm/models/ResourceIdDatasetId.js index 7d2aabab..7c48aafc 100644 --- a/typescript/dist/esm/models/ResourceIdDatasetId.js +++ b/typescript/dist/esm/models/ResourceIdDatasetId.js @@ -21,16 +21,17 @@ export const ResourceIdDatasetIdTypeEnum = { * Check if a given object implements the ResourceIdDatasetId interface. */ export function instanceOfResourceIdDatasetId(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function ResourceIdDatasetIdFromJSON(json) { return ResourceIdDatasetIdFromJSONTyped(json, false); } export function ResourceIdDatasetIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,15 +39,15 @@ export function ResourceIdDatasetIdFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function ResourceIdDatasetIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdDatasetIdToJSON(json) { + return ResourceIdDatasetIdToJSONTyped(json, false); +} +export function ResourceIdDatasetIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/ResourceIdLayer.d.ts b/typescript/dist/esm/models/ResourceIdLayer.d.ts index 5d47d9ca..d68024e6 100644 --- a/typescript/dist/esm/models/ResourceIdLayer.d.ts +++ b/typescript/dist/esm/models/ResourceIdLayer.d.ts @@ -33,16 +33,13 @@ export interface ResourceIdLayer { */ export declare const ResourceIdLayerTypeEnum: { readonly Layer: "Layer"; - readonly LayerCollection: "LayerCollection"; - readonly Project: "Project"; - readonly DatasetId: "DatasetId"; - readonly MlModel: "MlModel"; }; export type ResourceIdLayerTypeEnum = typeof ResourceIdLayerTypeEnum[keyof typeof ResourceIdLayerTypeEnum]; /** * Check if a given object implements the ResourceIdLayer interface. */ -export declare function instanceOfResourceIdLayer(value: object): boolean; +export declare function instanceOfResourceIdLayer(value: object): value is ResourceIdLayer; export declare function ResourceIdLayerFromJSON(json: any): ResourceIdLayer; export declare function ResourceIdLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdLayer; -export declare function ResourceIdLayerToJSON(value?: ResourceIdLayer | null): any; +export declare function ResourceIdLayerToJSON(json: any): ResourceIdLayer; +export declare function ResourceIdLayerToJSONTyped(value?: ResourceIdLayer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ResourceIdLayer.js b/typescript/dist/esm/models/ResourceIdLayer.js index 8c8d625a..8c5dbdbf 100644 --- a/typescript/dist/esm/models/ResourceIdLayer.js +++ b/typescript/dist/esm/models/ResourceIdLayer.js @@ -15,26 +15,23 @@ * @export */ export const ResourceIdLayerTypeEnum = { - Layer: 'Layer', - LayerCollection: 'LayerCollection', - Project: 'Project', - DatasetId: 'DatasetId', - MlModel: 'MlModel' + Layer: 'Layer' }; /** * Check if a given object implements the ResourceIdLayer interface. */ export function instanceOfResourceIdLayer(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function ResourceIdLayerFromJSON(json) { return ResourceIdLayerFromJSONTyped(json, false); } export function ResourceIdLayerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,15 +39,15 @@ export function ResourceIdLayerFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function ResourceIdLayerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdLayerToJSON(json) { + return ResourceIdLayerToJSONTyped(json, false); +} +export function ResourceIdLayerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/ResourceIdLayerCollection.d.ts b/typescript/dist/esm/models/ResourceIdLayerCollection.d.ts index a94a4755..51e94abb 100644 --- a/typescript/dist/esm/models/ResourceIdLayerCollection.d.ts +++ b/typescript/dist/esm/models/ResourceIdLayerCollection.d.ts @@ -38,7 +38,8 @@ export type ResourceIdLayerCollectionTypeEnum = typeof ResourceIdLayerCollection /** * Check if a given object implements the ResourceIdLayerCollection interface. */ -export declare function instanceOfResourceIdLayerCollection(value: object): boolean; +export declare function instanceOfResourceIdLayerCollection(value: object): value is ResourceIdLayerCollection; export declare function ResourceIdLayerCollectionFromJSON(json: any): ResourceIdLayerCollection; export declare function ResourceIdLayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdLayerCollection; -export declare function ResourceIdLayerCollectionToJSON(value?: ResourceIdLayerCollection | null): any; +export declare function ResourceIdLayerCollectionToJSON(json: any): ResourceIdLayerCollection; +export declare function ResourceIdLayerCollectionToJSONTyped(value?: ResourceIdLayerCollection | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ResourceIdLayerCollection.js b/typescript/dist/esm/models/ResourceIdLayerCollection.js index 24500270..18b0c0c5 100644 --- a/typescript/dist/esm/models/ResourceIdLayerCollection.js +++ b/typescript/dist/esm/models/ResourceIdLayerCollection.js @@ -21,16 +21,17 @@ export const ResourceIdLayerCollectionTypeEnum = { * Check if a given object implements the ResourceIdLayerCollection interface. */ export function instanceOfResourceIdLayerCollection(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function ResourceIdLayerCollectionFromJSON(json) { return ResourceIdLayerCollectionFromJSONTyped(json, false); } export function ResourceIdLayerCollectionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,15 +39,15 @@ export function ResourceIdLayerCollectionFromJSONTyped(json, ignoreDiscriminator 'type': json['type'], }; } -export function ResourceIdLayerCollectionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdLayerCollectionToJSON(json) { + return ResourceIdLayerCollectionToJSONTyped(json, false); +} +export function ResourceIdLayerCollectionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/ResourceIdMlModel.d.ts b/typescript/dist/esm/models/ResourceIdMlModel.d.ts index 98bf3fb7..a7e47a2a 100644 --- a/typescript/dist/esm/models/ResourceIdMlModel.d.ts +++ b/typescript/dist/esm/models/ResourceIdMlModel.d.ts @@ -38,7 +38,8 @@ export type ResourceIdMlModelTypeEnum = typeof ResourceIdMlModelTypeEnum[keyof t /** * Check if a given object implements the ResourceIdMlModel interface. */ -export declare function instanceOfResourceIdMlModel(value: object): boolean; +export declare function instanceOfResourceIdMlModel(value: object): value is ResourceIdMlModel; export declare function ResourceIdMlModelFromJSON(json: any): ResourceIdMlModel; export declare function ResourceIdMlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdMlModel; -export declare function ResourceIdMlModelToJSON(value?: ResourceIdMlModel | null): any; +export declare function ResourceIdMlModelToJSON(json: any): ResourceIdMlModel; +export declare function ResourceIdMlModelToJSONTyped(value?: ResourceIdMlModel | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ResourceIdMlModel.js b/typescript/dist/esm/models/ResourceIdMlModel.js index c37eeaed..5d0ab59b 100644 --- a/typescript/dist/esm/models/ResourceIdMlModel.js +++ b/typescript/dist/esm/models/ResourceIdMlModel.js @@ -21,16 +21,17 @@ export const ResourceIdMlModelTypeEnum = { * Check if a given object implements the ResourceIdMlModel interface. */ export function instanceOfResourceIdMlModel(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function ResourceIdMlModelFromJSON(json) { return ResourceIdMlModelFromJSONTyped(json, false); } export function ResourceIdMlModelFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,15 +39,15 @@ export function ResourceIdMlModelFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function ResourceIdMlModelToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdMlModelToJSON(json) { + return ResourceIdMlModelToJSONTyped(json, false); +} +export function ResourceIdMlModelToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/ResourceIdProject.d.ts b/typescript/dist/esm/models/ResourceIdProject.d.ts index e084783a..ed026316 100644 --- a/typescript/dist/esm/models/ResourceIdProject.d.ts +++ b/typescript/dist/esm/models/ResourceIdProject.d.ts @@ -38,7 +38,8 @@ export type ResourceIdProjectTypeEnum = typeof ResourceIdProjectTypeEnum[keyof t /** * Check if a given object implements the ResourceIdProject interface. */ -export declare function instanceOfResourceIdProject(value: object): boolean; +export declare function instanceOfResourceIdProject(value: object): value is ResourceIdProject; export declare function ResourceIdProjectFromJSON(json: any): ResourceIdProject; export declare function ResourceIdProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdProject; -export declare function ResourceIdProjectToJSON(value?: ResourceIdProject | null): any; +export declare function ResourceIdProjectToJSON(json: any): ResourceIdProject; +export declare function ResourceIdProjectToJSONTyped(value?: ResourceIdProject | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ResourceIdProject.js b/typescript/dist/esm/models/ResourceIdProject.js index 74bc9698..1719d01a 100644 --- a/typescript/dist/esm/models/ResourceIdProject.js +++ b/typescript/dist/esm/models/ResourceIdProject.js @@ -21,16 +21,17 @@ export const ResourceIdProjectTypeEnum = { * Check if a given object implements the ResourceIdProject interface. */ export function instanceOfResourceIdProject(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function ResourceIdProjectFromJSON(json) { return ResourceIdProjectFromJSONTyped(json, false); } export function ResourceIdProjectFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,15 +39,15 @@ export function ResourceIdProjectFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function ResourceIdProjectToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdProjectToJSON(json) { + return ResourceIdProjectToJSONTyped(json, false); +} +export function ResourceIdProjectToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/Role.d.ts b/typescript/dist/esm/models/Role.d.ts index 94df2ecd..0f20560d 100644 --- a/typescript/dist/esm/models/Role.d.ts +++ b/typescript/dist/esm/models/Role.d.ts @@ -31,7 +31,8 @@ export interface Role { /** * Check if a given object implements the Role interface. */ -export declare function instanceOfRole(value: object): boolean; +export declare function instanceOfRole(value: object): value is Role; export declare function RoleFromJSON(json: any): Role; export declare function RoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Role; -export declare function RoleToJSON(value?: Role | null): any; +export declare function RoleToJSON(json: any): Role; +export declare function RoleToJSONTyped(value?: Role | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Role.js b/typescript/dist/esm/models/Role.js index 1b07c3ce..d1b39c45 100644 --- a/typescript/dist/esm/models/Role.js +++ b/typescript/dist/esm/models/Role.js @@ -15,16 +15,17 @@ * Check if a given object implements the Role interface. */ export function instanceOfRole(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } export function RoleFromJSON(json) { return RoleFromJSONTyped(json, false); } export function RoleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function RoleFromJSONTyped(json, ignoreDiscriminator) { 'name': json['name'], }; } -export function RoleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RoleToJSON(json) { + return RoleToJSONTyped(json, false); +} +export function RoleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'name': value.name, + 'id': value['id'], + 'name': value['name'], }; } diff --git a/typescript/dist/esm/models/RoleDescription.d.ts b/typescript/dist/esm/models/RoleDescription.d.ts index 90f7a05c..605a297c 100644 --- a/typescript/dist/esm/models/RoleDescription.d.ts +++ b/typescript/dist/esm/models/RoleDescription.d.ts @@ -32,7 +32,8 @@ export interface RoleDescription { /** * Check if a given object implements the RoleDescription interface. */ -export declare function instanceOfRoleDescription(value: object): boolean; +export declare function instanceOfRoleDescription(value: object): value is RoleDescription; export declare function RoleDescriptionFromJSON(json: any): RoleDescription; export declare function RoleDescriptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): RoleDescription; -export declare function RoleDescriptionToJSON(value?: RoleDescription | null): any; +export declare function RoleDescriptionToJSON(json: any): RoleDescription; +export declare function RoleDescriptionToJSONTyped(value?: RoleDescription | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/RoleDescription.js b/typescript/dist/esm/models/RoleDescription.js index a57571d2..815ccddd 100644 --- a/typescript/dist/esm/models/RoleDescription.js +++ b/typescript/dist/esm/models/RoleDescription.js @@ -16,16 +16,17 @@ import { RoleFromJSON, RoleToJSON, } from './Role'; * Check if a given object implements the RoleDescription interface. */ export function instanceOfRoleDescription(value) { - let isInstance = true; - isInstance = isInstance && "individual" in value; - isInstance = isInstance && "role" in value; - return isInstance; + if (!('individual' in value) || value['individual'] === undefined) + return false; + if (!('role' in value) || value['role'] === undefined) + return false; + return true; } export function RoleDescriptionFromJSON(json) { return RoleDescriptionFromJSONTyped(json, false); } export function RoleDescriptionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -33,15 +34,15 @@ export function RoleDescriptionFromJSONTyped(json, ignoreDiscriminator) { 'role': RoleFromJSON(json['role']), }; } -export function RoleDescriptionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RoleDescriptionToJSON(json) { + return RoleDescriptionToJSONTyped(json, false); +} +export function RoleDescriptionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'individual': value.individual, - 'role': RoleToJSON(value.role), + 'individual': value['individual'], + 'role': RoleToJSON(value['role']), }; } diff --git a/typescript/dist/esm/models/STRectangle.d.ts b/typescript/dist/esm/models/STRectangle.d.ts index cd9273b8..7ec0062b 100644 --- a/typescript/dist/esm/models/STRectangle.d.ts +++ b/typescript/dist/esm/models/STRectangle.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; import type { TimeInterval } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * * @export @@ -39,7 +39,8 @@ export interface STRectangle { /** * Check if a given object implements the STRectangle interface. */ -export declare function instanceOfSTRectangle(value: object): boolean; +export declare function instanceOfSTRectangle(value: object): value is STRectangle; export declare function STRectangleFromJSON(json: any): STRectangle; export declare function STRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): STRectangle; -export declare function STRectangleToJSON(value?: STRectangle | null): any; +export declare function STRectangleToJSON(json: any): STRectangle; +export declare function STRectangleToJSONTyped(value?: STRectangle | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/STRectangle.js b/typescript/dist/esm/models/STRectangle.js index 4efbbd57..6f3a83b4 100644 --- a/typescript/dist/esm/models/STRectangle.js +++ b/typescript/dist/esm/models/STRectangle.js @@ -11,23 +11,25 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; +import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; /** * Check if a given object implements the STRectangle interface. */ export function instanceOfSTRectangle(value) { - let isInstance = true; - isInstance = isInstance && "boundingBox" in value; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "timeInterval" in value; - return isInstance; + if (!('boundingBox' in value) || value['boundingBox'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) + return false; + return true; } export function STRectangleFromJSON(json) { return STRectangleFromJSONTyped(json, false); } export function STRectangleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -36,16 +38,16 @@ export function STRectangleFromJSONTyped(json, ignoreDiscriminator) { 'timeInterval': TimeIntervalFromJSON(json['timeInterval']), }; } -export function STRectangleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function STRectangleToJSON(json) { + return STRectangleToJSONTyped(json, false); +} +export function STRectangleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'boundingBox': BoundingBox2DToJSON(value.boundingBox), - 'spatialReference': value.spatialReference, - 'timeInterval': TimeIntervalToJSON(value.timeInterval), + 'boundingBox': BoundingBox2DToJSON(value['boundingBox']), + 'spatialReference': value['spatialReference'], + 'timeInterval': TimeIntervalToJSON(value['timeInterval']), }; } diff --git a/typescript/dist/esm/models/SearchCapabilities.d.ts b/typescript/dist/esm/models/SearchCapabilities.d.ts index 5569fc6d..a02189f9 100644 --- a/typescript/dist/esm/models/SearchCapabilities.d.ts +++ b/typescript/dist/esm/models/SearchCapabilities.d.ts @@ -38,7 +38,8 @@ export interface SearchCapabilities { /** * Check if a given object implements the SearchCapabilities interface. */ -export declare function instanceOfSearchCapabilities(value: object): boolean; +export declare function instanceOfSearchCapabilities(value: object): value is SearchCapabilities; export declare function SearchCapabilitiesFromJSON(json: any): SearchCapabilities; export declare function SearchCapabilitiesFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchCapabilities; -export declare function SearchCapabilitiesToJSON(value?: SearchCapabilities | null): any; +export declare function SearchCapabilitiesToJSON(json: any): SearchCapabilities; +export declare function SearchCapabilitiesToJSONTyped(value?: SearchCapabilities | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/SearchCapabilities.js b/typescript/dist/esm/models/SearchCapabilities.js index 2b3cf0f4..0bdbc984 100644 --- a/typescript/dist/esm/models/SearchCapabilities.js +++ b/typescript/dist/esm/models/SearchCapabilities.js @@ -11,40 +11,40 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { SearchTypesFromJSON, SearchTypesToJSON, } from './SearchTypes'; /** * Check if a given object implements the SearchCapabilities interface. */ export function instanceOfSearchCapabilities(value) { - let isInstance = true; - isInstance = isInstance && "autocomplete" in value; - isInstance = isInstance && "searchTypes" in value; - return isInstance; + if (!('autocomplete' in value) || value['autocomplete'] === undefined) + return false; + if (!('searchTypes' in value) || value['searchTypes'] === undefined) + return false; + return true; } export function SearchCapabilitiesFromJSON(json) { return SearchCapabilitiesFromJSONTyped(json, false); } export function SearchCapabilitiesFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'autocomplete': json['autocomplete'], - 'filters': !exists(json, 'filters') ? undefined : json['filters'], + 'filters': json['filters'] == null ? undefined : json['filters'], 'searchTypes': SearchTypesFromJSON(json['searchTypes']), }; } -export function SearchCapabilitiesToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SearchCapabilitiesToJSON(json) { + return SearchCapabilitiesToJSONTyped(json, false); +} +export function SearchCapabilitiesToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'autocomplete': value.autocomplete, - 'filters': value.filters, - 'searchTypes': SearchTypesToJSON(value.searchTypes), + 'autocomplete': value['autocomplete'], + 'filters': value['filters'], + 'searchTypes': SearchTypesToJSON(value['searchTypes']), }; } diff --git a/typescript/dist/esm/models/SearchType.d.ts b/typescript/dist/esm/models/SearchType.d.ts index d18be08e..ed33eb7c 100644 --- a/typescript/dist/esm/models/SearchType.d.ts +++ b/typescript/dist/esm/models/SearchType.d.ts @@ -18,6 +18,8 @@ export declare const SearchType: { readonly Prefix: "prefix"; }; export type SearchType = typeof SearchType[keyof typeof SearchType]; +export declare function instanceOfSearchType(value: any): boolean; export declare function SearchTypeFromJSON(json: any): SearchType; export declare function SearchTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchType; export declare function SearchTypeToJSON(value?: SearchType | null): any; +export declare function SearchTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): SearchType; diff --git a/typescript/dist/esm/models/SearchType.js b/typescript/dist/esm/models/SearchType.js index 4eb25816..89ebc4bb 100644 --- a/typescript/dist/esm/models/SearchType.js +++ b/typescript/dist/esm/models/SearchType.js @@ -19,6 +19,16 @@ export const SearchType = { Fulltext: 'fulltext', Prefix: 'prefix' }; +export function instanceOfSearchType(value) { + for (const key in SearchType) { + if (Object.prototype.hasOwnProperty.call(SearchType, key)) { + if (SearchType[key] === value) { + return true; + } + } + } + return false; +} export function SearchTypeFromJSON(json) { return SearchTypeFromJSONTyped(json, false); } @@ -28,3 +38,6 @@ export function SearchTypeFromJSONTyped(json, ignoreDiscriminator) { export function SearchTypeToJSON(value) { return value; } +export function SearchTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/SearchTypes.d.ts b/typescript/dist/esm/models/SearchTypes.d.ts index b65c95c4..1c1a83c8 100644 --- a/typescript/dist/esm/models/SearchTypes.d.ts +++ b/typescript/dist/esm/models/SearchTypes.d.ts @@ -31,7 +31,8 @@ export interface SearchTypes { /** * Check if a given object implements the SearchTypes interface. */ -export declare function instanceOfSearchTypes(value: object): boolean; +export declare function instanceOfSearchTypes(value: object): value is SearchTypes; export declare function SearchTypesFromJSON(json: any): SearchTypes; export declare function SearchTypesFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchTypes; -export declare function SearchTypesToJSON(value?: SearchTypes | null): any; +export declare function SearchTypesToJSON(json: any): SearchTypes; +export declare function SearchTypesToJSONTyped(value?: SearchTypes | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/SearchTypes.js b/typescript/dist/esm/models/SearchTypes.js index 65af8549..06e83ed2 100644 --- a/typescript/dist/esm/models/SearchTypes.js +++ b/typescript/dist/esm/models/SearchTypes.js @@ -15,16 +15,17 @@ * Check if a given object implements the SearchTypes interface. */ export function instanceOfSearchTypes(value) { - let isInstance = true; - isInstance = isInstance && "fulltext" in value; - isInstance = isInstance && "prefix" in value; - return isInstance; + if (!('fulltext' in value) || value['fulltext'] === undefined) + return false; + if (!('prefix' in value) || value['prefix'] === undefined) + return false; + return true; } export function SearchTypesFromJSON(json) { return SearchTypesFromJSONTyped(json, false); } export function SearchTypesFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function SearchTypesFromJSONTyped(json, ignoreDiscriminator) { 'prefix': json['prefix'], }; } -export function SearchTypesToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SearchTypesToJSON(json) { + return SearchTypesToJSONTyped(json, false); +} +export function SearchTypesToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'fulltext': value.fulltext, - 'prefix': value.prefix, + 'fulltext': value['fulltext'], + 'prefix': value['prefix'], }; } diff --git a/typescript/dist/esm/models/ServerInfo.d.ts b/typescript/dist/esm/models/ServerInfo.d.ts index d74cf3e6..5b3b26f1 100644 --- a/typescript/dist/esm/models/ServerInfo.d.ts +++ b/typescript/dist/esm/models/ServerInfo.d.ts @@ -43,7 +43,8 @@ export interface ServerInfo { /** * Check if a given object implements the ServerInfo interface. */ -export declare function instanceOfServerInfo(value: object): boolean; +export declare function instanceOfServerInfo(value: object): value is ServerInfo; export declare function ServerInfoFromJSON(json: any): ServerInfo; export declare function ServerInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ServerInfo; -export declare function ServerInfoToJSON(value?: ServerInfo | null): any; +export declare function ServerInfoToJSON(json: any): ServerInfo; +export declare function ServerInfoToJSONTyped(value?: ServerInfo | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/ServerInfo.js b/typescript/dist/esm/models/ServerInfo.js index 8fbdef1a..4023f26b 100644 --- a/typescript/dist/esm/models/ServerInfo.js +++ b/typescript/dist/esm/models/ServerInfo.js @@ -15,18 +15,21 @@ * Check if a given object implements the ServerInfo interface. */ export function instanceOfServerInfo(value) { - let isInstance = true; - isInstance = isInstance && "buildDate" in value; - isInstance = isInstance && "commitHash" in value; - isInstance = isInstance && "features" in value; - isInstance = isInstance && "version" in value; - return isInstance; + if (!('buildDate' in value) || value['buildDate'] === undefined) + return false; + if (!('commitHash' in value) || value['commitHash'] === undefined) + return false; + if (!('features' in value) || value['features'] === undefined) + return false; + if (!('version' in value) || value['version'] === undefined) + return false; + return true; } export function ServerInfoFromJSON(json) { return ServerInfoFromJSONTyped(json, false); } export function ServerInfoFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -36,17 +39,17 @@ export function ServerInfoFromJSONTyped(json, ignoreDiscriminator) { 'version': json['version'], }; } -export function ServerInfoToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ServerInfoToJSON(json) { + return ServerInfoToJSONTyped(json, false); +} +export function ServerInfoToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'buildDate': value.buildDate, - 'commitHash': value.commitHash, - 'features': value.features, - 'version': value.version, + 'buildDate': value['buildDate'], + 'commitHash': value['commitHash'], + 'features': value['features'], + 'version': value['version'], }; } diff --git a/typescript/dist/esm/models/SingleBandRasterColorizer.d.ts b/typescript/dist/esm/models/SingleBandRasterColorizer.d.ts index 6968e547..f2a97929 100644 --- a/typescript/dist/esm/models/SingleBandRasterColorizer.d.ts +++ b/typescript/dist/esm/models/SingleBandRasterColorizer.d.ts @@ -40,13 +40,13 @@ export interface SingleBandRasterColorizer { */ export declare const SingleBandRasterColorizerTypeEnum: { readonly SingleBand: "singleBand"; - readonly MultiBand: "multiBand"; }; export type SingleBandRasterColorizerTypeEnum = typeof SingleBandRasterColorizerTypeEnum[keyof typeof SingleBandRasterColorizerTypeEnum]; /** * Check if a given object implements the SingleBandRasterColorizer interface. */ -export declare function instanceOfSingleBandRasterColorizer(value: object): boolean; +export declare function instanceOfSingleBandRasterColorizer(value: object): value is SingleBandRasterColorizer; export declare function SingleBandRasterColorizerFromJSON(json: any): SingleBandRasterColorizer; export declare function SingleBandRasterColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): SingleBandRasterColorizer; -export declare function SingleBandRasterColorizerToJSON(value?: SingleBandRasterColorizer | null): any; +export declare function SingleBandRasterColorizerToJSON(json: any): SingleBandRasterColorizer; +export declare function SingleBandRasterColorizerToJSONTyped(value?: SingleBandRasterColorizer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/SingleBandRasterColorizer.js b/typescript/dist/esm/models/SingleBandRasterColorizer.js index 24305de7..980af872 100644 --- a/typescript/dist/esm/models/SingleBandRasterColorizer.js +++ b/typescript/dist/esm/models/SingleBandRasterColorizer.js @@ -16,24 +16,25 @@ import { ColorizerFromJSON, ColorizerToJSON, } from './Colorizer'; * @export */ export const SingleBandRasterColorizerTypeEnum = { - SingleBand: 'singleBand', - MultiBand: 'multiBand' + SingleBand: 'singleBand' }; /** * Check if a given object implements the SingleBandRasterColorizer interface. */ export function instanceOfSingleBandRasterColorizer(value) { - let isInstance = true; - isInstance = isInstance && "band" in value; - isInstance = isInstance && "bandColorizer" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('band' in value) || value['band'] === undefined) + return false; + if (!('bandColorizer' in value) || value['bandColorizer'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function SingleBandRasterColorizerFromJSON(json) { return SingleBandRasterColorizerFromJSONTyped(json, false); } export function SingleBandRasterColorizerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,16 +43,16 @@ export function SingleBandRasterColorizerFromJSONTyped(json, ignoreDiscriminator 'type': json['type'], }; } -export function SingleBandRasterColorizerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SingleBandRasterColorizerToJSON(json) { + return SingleBandRasterColorizerToJSONTyped(json, false); +} +export function SingleBandRasterColorizerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'band': value.band, - 'bandColorizer': ColorizerToJSON(value.bandColorizer), - 'type': value.type, + 'band': value['band'], + 'bandColorizer': ColorizerToJSON(value['bandColorizer']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/SpatialPartition2D.d.ts b/typescript/dist/esm/models/SpatialPartition2D.d.ts index 04e34749..852ebcaf 100644 --- a/typescript/dist/esm/models/SpatialPartition2D.d.ts +++ b/typescript/dist/esm/models/SpatialPartition2D.d.ts @@ -32,7 +32,8 @@ export interface SpatialPartition2D { /** * Check if a given object implements the SpatialPartition2D interface. */ -export declare function instanceOfSpatialPartition2D(value: object): boolean; +export declare function instanceOfSpatialPartition2D(value: object): value is SpatialPartition2D; export declare function SpatialPartition2DFromJSON(json: any): SpatialPartition2D; export declare function SpatialPartition2DFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpatialPartition2D; -export declare function SpatialPartition2DToJSON(value?: SpatialPartition2D | null): any; +export declare function SpatialPartition2DToJSON(json: any): SpatialPartition2D; +export declare function SpatialPartition2DToJSONTyped(value?: SpatialPartition2D | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/SpatialPartition2D.js b/typescript/dist/esm/models/SpatialPartition2D.js index 887ed14d..2444f7bd 100644 --- a/typescript/dist/esm/models/SpatialPartition2D.js +++ b/typescript/dist/esm/models/SpatialPartition2D.js @@ -16,16 +16,17 @@ import { Coordinate2DFromJSON, Coordinate2DToJSON, } from './Coordinate2D'; * Check if a given object implements the SpatialPartition2D interface. */ export function instanceOfSpatialPartition2D(value) { - let isInstance = true; - isInstance = isInstance && "lowerRightCoordinate" in value; - isInstance = isInstance && "upperLeftCoordinate" in value; - return isInstance; + if (!('lowerRightCoordinate' in value) || value['lowerRightCoordinate'] === undefined) + return false; + if (!('upperLeftCoordinate' in value) || value['upperLeftCoordinate'] === undefined) + return false; + return true; } export function SpatialPartition2DFromJSON(json) { return SpatialPartition2DFromJSONTyped(json, false); } export function SpatialPartition2DFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -33,15 +34,15 @@ export function SpatialPartition2DFromJSONTyped(json, ignoreDiscriminator) { 'upperLeftCoordinate': Coordinate2DFromJSON(json['upperLeftCoordinate']), }; } -export function SpatialPartition2DToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SpatialPartition2DToJSON(json) { + return SpatialPartition2DToJSONTyped(json, false); +} +export function SpatialPartition2DToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'lowerRightCoordinate': Coordinate2DToJSON(value.lowerRightCoordinate), - 'upperLeftCoordinate': Coordinate2DToJSON(value.upperLeftCoordinate), + 'lowerRightCoordinate': Coordinate2DToJSON(value['lowerRightCoordinate']), + 'upperLeftCoordinate': Coordinate2DToJSON(value['upperLeftCoordinate']), }; } diff --git a/typescript/dist/esm/models/SpatialReferenceAuthority.d.ts b/typescript/dist/esm/models/SpatialReferenceAuthority.d.ts index 5c8ed9ee..bebd27e9 100644 --- a/typescript/dist/esm/models/SpatialReferenceAuthority.d.ts +++ b/typescript/dist/esm/models/SpatialReferenceAuthority.d.ts @@ -20,6 +20,8 @@ export declare const SpatialReferenceAuthority: { readonly Esri: "ESRI"; }; export type SpatialReferenceAuthority = typeof SpatialReferenceAuthority[keyof typeof SpatialReferenceAuthority]; +export declare function instanceOfSpatialReferenceAuthority(value: any): boolean; export declare function SpatialReferenceAuthorityFromJSON(json: any): SpatialReferenceAuthority; export declare function SpatialReferenceAuthorityFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpatialReferenceAuthority; export declare function SpatialReferenceAuthorityToJSON(value?: SpatialReferenceAuthority | null): any; +export declare function SpatialReferenceAuthorityToJSONTyped(value: any, ignoreDiscriminator: boolean): SpatialReferenceAuthority; diff --git a/typescript/dist/esm/models/SpatialReferenceAuthority.js b/typescript/dist/esm/models/SpatialReferenceAuthority.js index f3f31a73..15856686 100644 --- a/typescript/dist/esm/models/SpatialReferenceAuthority.js +++ b/typescript/dist/esm/models/SpatialReferenceAuthority.js @@ -21,6 +21,16 @@ export const SpatialReferenceAuthority = { Iau2000: 'IAU2000', Esri: 'ESRI' }; +export function instanceOfSpatialReferenceAuthority(value) { + for (const key in SpatialReferenceAuthority) { + if (Object.prototype.hasOwnProperty.call(SpatialReferenceAuthority, key)) { + if (SpatialReferenceAuthority[key] === value) { + return true; + } + } + } + return false; +} export function SpatialReferenceAuthorityFromJSON(json) { return SpatialReferenceAuthorityFromJSONTyped(json, false); } @@ -30,3 +40,6 @@ export function SpatialReferenceAuthorityFromJSONTyped(json, ignoreDiscriminator export function SpatialReferenceAuthorityToJSON(value) { return value; } +export function SpatialReferenceAuthorityToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/SpatialReferenceSpecification.d.ts b/typescript/dist/esm/models/SpatialReferenceSpecification.d.ts index 955a2fae..125610a4 100644 --- a/typescript/dist/esm/models/SpatialReferenceSpecification.d.ts +++ b/typescript/dist/esm/models/SpatialReferenceSpecification.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { AxisOrder } from './AxisOrder'; import type { BoundingBox2D } from './BoundingBox2D'; +import type { AxisOrder } from './AxisOrder'; /** * The specification of a spatial reference, where extent and axis labels are given * in natural order (x, y) = (east, north) @@ -58,7 +58,8 @@ export interface SpatialReferenceSpecification { /** * Check if a given object implements the SpatialReferenceSpecification interface. */ -export declare function instanceOfSpatialReferenceSpecification(value: object): boolean; +export declare function instanceOfSpatialReferenceSpecification(value: object): value is SpatialReferenceSpecification; export declare function SpatialReferenceSpecificationFromJSON(json: any): SpatialReferenceSpecification; export declare function SpatialReferenceSpecificationFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpatialReferenceSpecification; -export declare function SpatialReferenceSpecificationToJSON(value?: SpatialReferenceSpecification | null): any; +export declare function SpatialReferenceSpecificationToJSON(json: any): SpatialReferenceSpecification; +export declare function SpatialReferenceSpecificationToJSONTyped(value?: SpatialReferenceSpecification | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/SpatialReferenceSpecification.js b/typescript/dist/esm/models/SpatialReferenceSpecification.js index 076aaf34..08fb9beb 100644 --- a/typescript/dist/esm/models/SpatialReferenceSpecification.js +++ b/typescript/dist/esm/models/SpatialReferenceSpecification.js @@ -11,49 +11,51 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { AxisOrderFromJSON, AxisOrderToJSON, } from './AxisOrder'; import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; +import { AxisOrderFromJSON, AxisOrderToJSON, } from './AxisOrder'; /** * Check if a given object implements the SpatialReferenceSpecification interface. */ export function instanceOfSpatialReferenceSpecification(value) { - let isInstance = true; - isInstance = isInstance && "extent" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "projString" in value; - isInstance = isInstance && "spatialReference" in value; - return isInstance; + if (!('extent' in value) || value['extent'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('projString' in value) || value['projString'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + return true; } export function SpatialReferenceSpecificationFromJSON(json) { return SpatialReferenceSpecificationFromJSONTyped(json, false); } export function SpatialReferenceSpecificationFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'axisLabels': !exists(json, 'axisLabels') ? undefined : json['axisLabels'], - 'axisOrder': !exists(json, 'axisOrder') ? undefined : AxisOrderFromJSON(json['axisOrder']), + 'axisLabels': json['axisLabels'] == null ? undefined : json['axisLabels'], + 'axisOrder': json['axisOrder'] == null ? undefined : AxisOrderFromJSON(json['axisOrder']), 'extent': BoundingBox2DFromJSON(json['extent']), 'name': json['name'], 'projString': json['projString'], 'spatialReference': json['spatialReference'], }; } -export function SpatialReferenceSpecificationToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SpatialReferenceSpecificationToJSON(json) { + return SpatialReferenceSpecificationToJSONTyped(json, false); +} +export function SpatialReferenceSpecificationToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'axisLabels': value.axisLabels, - 'axisOrder': AxisOrderToJSON(value.axisOrder), - 'extent': BoundingBox2DToJSON(value.extent), - 'name': value.name, - 'projString': value.projString, - 'spatialReference': value.spatialReference, + 'axisLabels': value['axisLabels'], + 'axisOrder': AxisOrderToJSON(value['axisOrder']), + 'extent': BoundingBox2DToJSON(value['extent']), + 'name': value['name'], + 'projString': value['projString'], + 'spatialReference': value['spatialReference'], }; } diff --git a/typescript/dist/esm/models/SpatialResolution.d.ts b/typescript/dist/esm/models/SpatialResolution.d.ts index 4300e098..a1d9f259 100644 --- a/typescript/dist/esm/models/SpatialResolution.d.ts +++ b/typescript/dist/esm/models/SpatialResolution.d.ts @@ -31,7 +31,8 @@ export interface SpatialResolution { /** * Check if a given object implements the SpatialResolution interface. */ -export declare function instanceOfSpatialResolution(value: object): boolean; +export declare function instanceOfSpatialResolution(value: object): value is SpatialResolution; export declare function SpatialResolutionFromJSON(json: any): SpatialResolution; export declare function SpatialResolutionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpatialResolution; -export declare function SpatialResolutionToJSON(value?: SpatialResolution | null): any; +export declare function SpatialResolutionToJSON(json: any): SpatialResolution; +export declare function SpatialResolutionToJSONTyped(value?: SpatialResolution | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/SpatialResolution.js b/typescript/dist/esm/models/SpatialResolution.js index 9077ff6c..0bb9714f 100644 --- a/typescript/dist/esm/models/SpatialResolution.js +++ b/typescript/dist/esm/models/SpatialResolution.js @@ -15,16 +15,17 @@ * Check if a given object implements the SpatialResolution interface. */ export function instanceOfSpatialResolution(value) { - let isInstance = true; - isInstance = isInstance && "x" in value; - isInstance = isInstance && "y" in value; - return isInstance; + if (!('x' in value) || value['x'] === undefined) + return false; + if (!('y' in value) || value['y'] === undefined) + return false; + return true; } export function SpatialResolutionFromJSON(json) { return SpatialResolutionFromJSONTyped(json, false); } export function SpatialResolutionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function SpatialResolutionFromJSONTyped(json, ignoreDiscriminator) { 'y': json['y'], }; } -export function SpatialResolutionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SpatialResolutionToJSON(json) { + return SpatialResolutionToJSONTyped(json, false); +} +export function SpatialResolutionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'x': value.x, - 'y': value.y, + 'x': value['x'], + 'y': value['y'], }; } diff --git a/typescript/dist/esm/models/StaticNumberParam.d.ts b/typescript/dist/esm/models/StaticNumberParam.d.ts index 9b97064f..f09202f6 100644 --- a/typescript/dist/esm/models/StaticNumberParam.d.ts +++ b/typescript/dist/esm/models/StaticNumberParam.d.ts @@ -33,13 +33,13 @@ export interface StaticNumberParam { */ export declare const StaticNumberParamTypeEnum: { readonly Static: "static"; - readonly Derived: "derived"; }; export type StaticNumberParamTypeEnum = typeof StaticNumberParamTypeEnum[keyof typeof StaticNumberParamTypeEnum]; /** * Check if a given object implements the StaticNumberParam interface. */ -export declare function instanceOfStaticNumberParam(value: object): boolean; +export declare function instanceOfStaticNumberParam(value: object): value is StaticNumberParam; export declare function StaticNumberParamFromJSON(json: any): StaticNumberParam; export declare function StaticNumberParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): StaticNumberParam; -export declare function StaticNumberParamToJSON(value?: StaticNumberParam | null): any; +export declare function StaticNumberParamToJSON(json: any): StaticNumberParam; +export declare function StaticNumberParamToJSONTyped(value?: StaticNumberParam | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/StaticNumberParam.js b/typescript/dist/esm/models/StaticNumberParam.js index 9bc59341..4e633b5f 100644 --- a/typescript/dist/esm/models/StaticNumberParam.js +++ b/typescript/dist/esm/models/StaticNumberParam.js @@ -15,23 +15,23 @@ * @export */ export const StaticNumberParamTypeEnum = { - Static: 'static', - Derived: 'derived' + Static: 'static' }; /** * Check if a given object implements the StaticNumberParam interface. */ export function instanceOfStaticNumberParam(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "value" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + if (!('value' in value) || value['value'] === undefined) + return false; + return true; } export function StaticNumberParamFromJSON(json) { return StaticNumberParamFromJSONTyped(json, false); } export function StaticNumberParamFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,15 +39,15 @@ export function StaticNumberParamFromJSONTyped(json, ignoreDiscriminator) { 'value': json['value'], }; } -export function StaticNumberParamToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function StaticNumberParamToJSON(json) { + return StaticNumberParamToJSONTyped(json, false); +} +export function StaticNumberParamToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'type': value.type, - 'value': value.value, + 'type': value['type'], + 'value': value['value'], }; } diff --git a/typescript/dist/esm/models/StrokeParam.d.ts b/typescript/dist/esm/models/StrokeParam.d.ts index 4e8d0aa0..3dc4cab9 100644 --- a/typescript/dist/esm/models/StrokeParam.d.ts +++ b/typescript/dist/esm/models/StrokeParam.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { ColorParam } from './ColorParam'; import type { NumberParam } from './NumberParam'; +import type { ColorParam } from './ColorParam'; /** * * @export @@ -33,7 +33,8 @@ export interface StrokeParam { /** * Check if a given object implements the StrokeParam interface. */ -export declare function instanceOfStrokeParam(value: object): boolean; +export declare function instanceOfStrokeParam(value: object): value is StrokeParam; export declare function StrokeParamFromJSON(json: any): StrokeParam; export declare function StrokeParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): StrokeParam; -export declare function StrokeParamToJSON(value?: StrokeParam | null): any; +export declare function StrokeParamToJSON(json: any): StrokeParam; +export declare function StrokeParamToJSONTyped(value?: StrokeParam | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/StrokeParam.js b/typescript/dist/esm/models/StrokeParam.js index 4a09e3e9..d79444d3 100644 --- a/typescript/dist/esm/models/StrokeParam.js +++ b/typescript/dist/esm/models/StrokeParam.js @@ -11,22 +11,23 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ColorParamFromJSON, ColorParamToJSON, } from './ColorParam'; import { NumberParamFromJSON, NumberParamToJSON, } from './NumberParam'; +import { ColorParamFromJSON, ColorParamToJSON, } from './ColorParam'; /** * Check if a given object implements the StrokeParam interface. */ export function instanceOfStrokeParam(value) { - let isInstance = true; - isInstance = isInstance && "color" in value; - isInstance = isInstance && "width" in value; - return isInstance; + if (!('color' in value) || value['color'] === undefined) + return false; + if (!('width' in value) || value['width'] === undefined) + return false; + return true; } export function StrokeParamFromJSON(json) { return StrokeParamFromJSONTyped(json, false); } export function StrokeParamFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -34,15 +35,15 @@ export function StrokeParamFromJSONTyped(json, ignoreDiscriminator) { 'width': NumberParamFromJSON(json['width']), }; } -export function StrokeParamToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function StrokeParamToJSON(json) { + return StrokeParamToJSONTyped(json, false); +} +export function StrokeParamToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'color': ColorParamToJSON(value.color), - 'width': NumberParamToJSON(value.width), + 'color': ColorParamToJSON(value['color']), + 'width': NumberParamToJSON(value['width']), }; } diff --git a/typescript/dist/esm/models/SuggestMetaData.d.ts b/typescript/dist/esm/models/SuggestMetaData.d.ts index ade70e93..40200206 100644 --- a/typescript/dist/esm/models/SuggestMetaData.d.ts +++ b/typescript/dist/esm/models/SuggestMetaData.d.ts @@ -38,7 +38,8 @@ export interface SuggestMetaData { /** * Check if a given object implements the SuggestMetaData interface. */ -export declare function instanceOfSuggestMetaData(value: object): boolean; +export declare function instanceOfSuggestMetaData(value: object): value is SuggestMetaData; export declare function SuggestMetaDataFromJSON(json: any): SuggestMetaData; export declare function SuggestMetaDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SuggestMetaData; -export declare function SuggestMetaDataToJSON(value?: SuggestMetaData | null): any; +export declare function SuggestMetaDataToJSON(json: any): SuggestMetaData; +export declare function SuggestMetaDataToJSONTyped(value?: SuggestMetaData | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/SuggestMetaData.js b/typescript/dist/esm/models/SuggestMetaData.js index edacebdb..1eeffb6b 100644 --- a/typescript/dist/esm/models/SuggestMetaData.js +++ b/typescript/dist/esm/models/SuggestMetaData.js @@ -11,39 +11,38 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { DataPathFromJSON, DataPathToJSON, } from './DataPath'; /** * Check if a given object implements the SuggestMetaData interface. */ export function instanceOfSuggestMetaData(value) { - let isInstance = true; - isInstance = isInstance && "dataPath" in value; - return isInstance; + if (!('dataPath' in value) || value['dataPath'] === undefined) + return false; + return true; } export function SuggestMetaDataFromJSON(json) { return SuggestMetaDataFromJSONTyped(json, false); } export function SuggestMetaDataFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'dataPath': DataPathFromJSON(json['dataPath']), - 'layerName': !exists(json, 'layerName') ? undefined : json['layerName'], - 'mainFile': !exists(json, 'mainFile') ? undefined : json['mainFile'], + 'layerName': json['layerName'] == null ? undefined : json['layerName'], + 'mainFile': json['mainFile'] == null ? undefined : json['mainFile'], }; } -export function SuggestMetaDataToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SuggestMetaDataToJSON(json) { + return SuggestMetaDataToJSONTyped(json, false); +} +export function SuggestMetaDataToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'dataPath': DataPathToJSON(value.dataPath), - 'layerName': value.layerName, - 'mainFile': value.mainFile, + 'dataPath': DataPathToJSON(value['dataPath']), + 'layerName': value['layerName'], + 'mainFile': value['mainFile'], }; } diff --git a/typescript/dist/esm/models/Symbology.d.ts b/typescript/dist/esm/models/Symbology.d.ts index d3d086d9..57162129 100644 --- a/typescript/dist/esm/models/Symbology.d.ts +++ b/typescript/dist/esm/models/Symbology.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { LineSymbology } from './LineSymbology'; -import { PointSymbology } from './PointSymbology'; -import { PolygonSymbology } from './PolygonSymbology'; -import { RasterSymbology } from './RasterSymbology'; +import type { LineSymbology } from './LineSymbology'; +import type { PointSymbology } from './PointSymbology'; +import type { PolygonSymbology } from './PolygonSymbology'; +import type { RasterSymbology } from './RasterSymbology'; /** * @type Symbology * @@ -29,4 +29,5 @@ export type Symbology = { } & RasterSymbology; export declare function SymbologyFromJSON(json: any): Symbology; export declare function SymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Symbology; -export declare function SymbologyToJSON(value?: Symbology | null): any; +export declare function SymbologyToJSON(json: any): any; +export declare function SymbologyToJSONTyped(value?: Symbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Symbology.js b/typescript/dist/esm/models/Symbology.js index 4445798c..b18a2e65 100644 --- a/typescript/dist/esm/models/Symbology.js +++ b/typescript/dist/esm/models/Symbology.js @@ -19,38 +19,38 @@ export function SymbologyFromJSON(json) { return SymbologyFromJSONTyped(json, false); } export function SymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'line': - return Object.assign(Object.assign({}, LineSymbologyFromJSONTyped(json, true)), { type: 'line' }); + return Object.assign({}, LineSymbologyFromJSONTyped(json, true), { type: 'line' }); case 'point': - return Object.assign(Object.assign({}, PointSymbologyFromJSONTyped(json, true)), { type: 'point' }); + return Object.assign({}, PointSymbologyFromJSONTyped(json, true), { type: 'point' }); case 'polygon': - return Object.assign(Object.assign({}, PolygonSymbologyFromJSONTyped(json, true)), { type: 'polygon' }); + return Object.assign({}, PolygonSymbologyFromJSONTyped(json, true), { type: 'polygon' }); case 'raster': - return Object.assign(Object.assign({}, RasterSymbologyFromJSONTyped(json, true)), { type: 'raster' }); + return Object.assign({}, RasterSymbologyFromJSONTyped(json, true), { type: 'raster' }); default: throw new Error(`No variant of Symbology exists with 'type=${json['type']}'`); } } -export function SymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SymbologyToJSON(json) { + return SymbologyToJSONTyped(json, false); +} +export function SymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'line': - return LineSymbologyToJSON(value); + return Object.assign({}, LineSymbologyToJSON(value), { type: 'line' }); case 'point': - return PointSymbologyToJSON(value); + return Object.assign({}, PointSymbologyToJSON(value), { type: 'point' }); case 'polygon': - return PolygonSymbologyToJSON(value); + return Object.assign({}, PolygonSymbologyToJSON(value), { type: 'polygon' }); case 'raster': - return RasterSymbologyToJSON(value); + return Object.assign({}, RasterSymbologyToJSON(value), { type: 'raster' }); default: throw new Error(`No variant of Symbology exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/TaskAbortOptions.d.ts b/typescript/dist/esm/models/TaskAbortOptions.d.ts index da84a7fc..82aaa683 100644 --- a/typescript/dist/esm/models/TaskAbortOptions.d.ts +++ b/typescript/dist/esm/models/TaskAbortOptions.d.ts @@ -25,7 +25,8 @@ export interface TaskAbortOptions { /** * Check if a given object implements the TaskAbortOptions interface. */ -export declare function instanceOfTaskAbortOptions(value: object): boolean; +export declare function instanceOfTaskAbortOptions(value: object): value is TaskAbortOptions; export declare function TaskAbortOptionsFromJSON(json: any): TaskAbortOptions; export declare function TaskAbortOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskAbortOptions; -export declare function TaskAbortOptionsToJSON(value?: TaskAbortOptions | null): any; +export declare function TaskAbortOptionsToJSON(json: any): TaskAbortOptions; +export declare function TaskAbortOptionsToJSONTyped(value?: TaskAbortOptions | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TaskAbortOptions.js b/typescript/dist/esm/models/TaskAbortOptions.js index f3cda928..c746b2ab 100644 --- a/typescript/dist/esm/models/TaskAbortOptions.js +++ b/typescript/dist/esm/models/TaskAbortOptions.js @@ -11,33 +11,31 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * Check if a given object implements the TaskAbortOptions interface. */ export function instanceOfTaskAbortOptions(value) { - let isInstance = true; - return isInstance; + return true; } export function TaskAbortOptionsFromJSON(json) { return TaskAbortOptionsFromJSONTyped(json, false); } export function TaskAbortOptionsFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'force': !exists(json, 'force') ? undefined : json['force'], + 'force': json['force'] == null ? undefined : json['force'], }; } -export function TaskAbortOptionsToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskAbortOptionsToJSON(json) { + return TaskAbortOptionsToJSONTyped(json, false); +} +export function TaskAbortOptionsToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'force': value.force, + 'force': value['force'], }; } diff --git a/typescript/dist/esm/models/TaskFilter.d.ts b/typescript/dist/esm/models/TaskFilter.d.ts index b680418d..a50058de 100644 --- a/typescript/dist/esm/models/TaskFilter.d.ts +++ b/typescript/dist/esm/models/TaskFilter.d.ts @@ -20,6 +20,8 @@ export declare const TaskFilter: { readonly Completed: "completed"; }; export type TaskFilter = typeof TaskFilter[keyof typeof TaskFilter]; +export declare function instanceOfTaskFilter(value: any): boolean; export declare function TaskFilterFromJSON(json: any): TaskFilter; export declare function TaskFilterFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskFilter; export declare function TaskFilterToJSON(value?: TaskFilter | null): any; +export declare function TaskFilterToJSONTyped(value: any, ignoreDiscriminator: boolean): TaskFilter; diff --git a/typescript/dist/esm/models/TaskFilter.js b/typescript/dist/esm/models/TaskFilter.js index b3853448..7a2254b1 100644 --- a/typescript/dist/esm/models/TaskFilter.js +++ b/typescript/dist/esm/models/TaskFilter.js @@ -21,6 +21,16 @@ export const TaskFilter = { Failed: 'failed', Completed: 'completed' }; +export function instanceOfTaskFilter(value) { + for (const key in TaskFilter) { + if (Object.prototype.hasOwnProperty.call(TaskFilter, key)) { + if (TaskFilter[key] === value) { + return true; + } + } + } + return false; +} export function TaskFilterFromJSON(json) { return TaskFilterFromJSONTyped(json, false); } @@ -30,3 +40,6 @@ export function TaskFilterFromJSONTyped(json, ignoreDiscriminator) { export function TaskFilterToJSON(value) { return value; } +export function TaskFilterToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/TaskListOptions.d.ts b/typescript/dist/esm/models/TaskListOptions.d.ts index a92ba661..3ac3cecf 100644 --- a/typescript/dist/esm/models/TaskListOptions.d.ts +++ b/typescript/dist/esm/models/TaskListOptions.d.ts @@ -38,7 +38,8 @@ export interface TaskListOptions { /** * Check if a given object implements the TaskListOptions interface. */ -export declare function instanceOfTaskListOptions(value: object): boolean; +export declare function instanceOfTaskListOptions(value: object): value is TaskListOptions; export declare function TaskListOptionsFromJSON(json: any): TaskListOptions; export declare function TaskListOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskListOptions; -export declare function TaskListOptionsToJSON(value?: TaskListOptions | null): any; +export declare function TaskListOptionsToJSON(json: any): TaskListOptions; +export declare function TaskListOptionsToJSONTyped(value?: TaskListOptions | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TaskListOptions.js b/typescript/dist/esm/models/TaskListOptions.js index 2d033030..4d58ea07 100644 --- a/typescript/dist/esm/models/TaskListOptions.js +++ b/typescript/dist/esm/models/TaskListOptions.js @@ -11,38 +11,36 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { TaskFilterFromJSON, TaskFilterToJSON, } from './TaskFilter'; /** * Check if a given object implements the TaskListOptions interface. */ export function instanceOfTaskListOptions(value) { - let isInstance = true; - return isInstance; + return true; } export function TaskListOptionsFromJSON(json) { return TaskListOptionsFromJSONTyped(json, false); } export function TaskListOptionsFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'filter': !exists(json, 'filter') ? undefined : TaskFilterFromJSON(json['filter']), - 'limit': !exists(json, 'limit') ? undefined : json['limit'], - 'offset': !exists(json, 'offset') ? undefined : json['offset'], + 'filter': json['filter'] == null ? undefined : TaskFilterFromJSON(json['filter']), + 'limit': json['limit'] == null ? undefined : json['limit'], + 'offset': json['offset'] == null ? undefined : json['offset'], }; } -export function TaskListOptionsToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskListOptionsToJSON(json) { + return TaskListOptionsToJSONTyped(json, false); +} +export function TaskListOptionsToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'filter': TaskFilterToJSON(value.filter), - 'limit': value.limit, - 'offset': value.offset, + 'filter': TaskFilterToJSON(value['filter']), + 'limit': value['limit'], + 'offset': value['offset'], }; } diff --git a/typescript/dist/esm/models/TaskResponse.d.ts b/typescript/dist/esm/models/TaskResponse.d.ts index 1ea10c47..9f6e96ee 100644 --- a/typescript/dist/esm/models/TaskResponse.d.ts +++ b/typescript/dist/esm/models/TaskResponse.d.ts @@ -25,7 +25,8 @@ export interface TaskResponse { /** * Check if a given object implements the TaskResponse interface. */ -export declare function instanceOfTaskResponse(value: object): boolean; +export declare function instanceOfTaskResponse(value: object): value is TaskResponse; export declare function TaskResponseFromJSON(json: any): TaskResponse; export declare function TaskResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskResponse; -export declare function TaskResponseToJSON(value?: TaskResponse | null): any; +export declare function TaskResponseToJSON(json: any): TaskResponse; +export declare function TaskResponseToJSONTyped(value?: TaskResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TaskResponse.js b/typescript/dist/esm/models/TaskResponse.js index 14261c8d..19620f6c 100644 --- a/typescript/dist/esm/models/TaskResponse.js +++ b/typescript/dist/esm/models/TaskResponse.js @@ -15,29 +15,29 @@ * Check if a given object implements the TaskResponse interface. */ export function instanceOfTaskResponse(value) { - let isInstance = true; - isInstance = isInstance && "taskId" in value; - return isInstance; + if (!('taskId' in value) || value['taskId'] === undefined) + return false; + return true; } export function TaskResponseFromJSON(json) { return TaskResponseFromJSONTyped(json, false); } export function TaskResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'taskId': json['taskId'], }; } -export function TaskResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskResponseToJSON(json) { + return TaskResponseToJSONTyped(json, false); +} +export function TaskResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'taskId': value.taskId, + 'taskId': value['taskId'], }; } diff --git a/typescript/dist/esm/models/TaskStatus.d.ts b/typescript/dist/esm/models/TaskStatus.d.ts index cd0e0bd9..4ae69cb1 100644 --- a/typescript/dist/esm/models/TaskStatus.d.ts +++ b/typescript/dist/esm/models/TaskStatus.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { TaskStatusAborted } from './TaskStatusAborted'; -import { TaskStatusCompleted } from './TaskStatusCompleted'; -import { TaskStatusFailed } from './TaskStatusFailed'; -import { TaskStatusRunning } from './TaskStatusRunning'; +import type { TaskStatusAborted } from './TaskStatusAborted'; +import type { TaskStatusCompleted } from './TaskStatusCompleted'; +import type { TaskStatusFailed } from './TaskStatusFailed'; +import type { TaskStatusRunning } from './TaskStatusRunning'; /** * @type TaskStatus * @@ -29,4 +29,5 @@ export type TaskStatus = { } & TaskStatusRunning; export declare function TaskStatusFromJSON(json: any): TaskStatus; export declare function TaskStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatus; -export declare function TaskStatusToJSON(value?: TaskStatus | null): any; +export declare function TaskStatusToJSON(json: any): any; +export declare function TaskStatusToJSONTyped(value?: TaskStatus | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TaskStatus.js b/typescript/dist/esm/models/TaskStatus.js index 9a5a8fb9..41b28254 100644 --- a/typescript/dist/esm/models/TaskStatus.js +++ b/typescript/dist/esm/models/TaskStatus.js @@ -19,38 +19,38 @@ export function TaskStatusFromJSON(json) { return TaskStatusFromJSONTyped(json, false); } export function TaskStatusFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['status']) { case 'aborted': - return Object.assign(Object.assign({}, TaskStatusAbortedFromJSONTyped(json, true)), { status: 'aborted' }); + return Object.assign({}, TaskStatusAbortedFromJSONTyped(json, true), { status: 'aborted' }); case 'completed': - return Object.assign(Object.assign({}, TaskStatusCompletedFromJSONTyped(json, true)), { status: 'completed' }); + return Object.assign({}, TaskStatusCompletedFromJSONTyped(json, true), { status: 'completed' }); case 'failed': - return Object.assign(Object.assign({}, TaskStatusFailedFromJSONTyped(json, true)), { status: 'failed' }); + return Object.assign({}, TaskStatusFailedFromJSONTyped(json, true), { status: 'failed' }); case 'running': - return Object.assign(Object.assign({}, TaskStatusRunningFromJSONTyped(json, true)), { status: 'running' }); + return Object.assign({}, TaskStatusRunningFromJSONTyped(json, true), { status: 'running' }); default: throw new Error(`No variant of TaskStatus exists with 'status=${json['status']}'`); } } -export function TaskStatusToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusToJSON(json) { + return TaskStatusToJSONTyped(json, false); +} +export function TaskStatusToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['status']) { case 'aborted': - return TaskStatusAbortedToJSON(value); + return Object.assign({}, TaskStatusAbortedToJSON(value), { status: 'aborted' }); case 'completed': - return TaskStatusCompletedToJSON(value); + return Object.assign({}, TaskStatusCompletedToJSON(value), { status: 'completed' }); case 'failed': - return TaskStatusFailedToJSON(value); + return Object.assign({}, TaskStatusFailedToJSON(value), { status: 'failed' }); case 'running': - return TaskStatusRunningToJSON(value); + return Object.assign({}, TaskStatusRunningToJSON(value), { status: 'running' }); default: throw new Error(`No variant of TaskStatus exists with 'status=${value['status']}'`); } diff --git a/typescript/dist/esm/models/TaskStatusAborted.d.ts b/typescript/dist/esm/models/TaskStatusAborted.d.ts index ac5d9bb1..04f019ec 100644 --- a/typescript/dist/esm/models/TaskStatusAborted.d.ts +++ b/typescript/dist/esm/models/TaskStatusAborted.d.ts @@ -38,7 +38,8 @@ export type TaskStatusAbortedStatusEnum = typeof TaskStatusAbortedStatusEnum[key /** * Check if a given object implements the TaskStatusAborted interface. */ -export declare function instanceOfTaskStatusAborted(value: object): boolean; +export declare function instanceOfTaskStatusAborted(value: object): value is TaskStatusAborted; export declare function TaskStatusAbortedFromJSON(json: any): TaskStatusAborted; export declare function TaskStatusAbortedFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusAborted; -export declare function TaskStatusAbortedToJSON(value?: TaskStatusAborted | null): any; +export declare function TaskStatusAbortedToJSON(json: any): TaskStatusAborted; +export declare function TaskStatusAbortedToJSONTyped(value?: TaskStatusAborted | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TaskStatusAborted.js b/typescript/dist/esm/models/TaskStatusAborted.js index a14997b9..ce87b7d2 100644 --- a/typescript/dist/esm/models/TaskStatusAborted.js +++ b/typescript/dist/esm/models/TaskStatusAborted.js @@ -21,16 +21,17 @@ export const TaskStatusAbortedStatusEnum = { * Check if a given object implements the TaskStatusAborted interface. */ export function instanceOfTaskStatusAborted(value) { - let isInstance = true; - isInstance = isInstance && "cleanUp" in value; - isInstance = isInstance && "status" in value; - return isInstance; + if (!('cleanUp' in value) || value['cleanUp'] === undefined) + return false; + if (!('status' in value) || value['status'] === undefined) + return false; + return true; } export function TaskStatusAbortedFromJSON(json) { return TaskStatusAbortedFromJSONTyped(json, false); } export function TaskStatusAbortedFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,15 +39,15 @@ export function TaskStatusAbortedFromJSONTyped(json, ignoreDiscriminator) { 'status': json['status'], }; } -export function TaskStatusAbortedToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusAbortedToJSON(json) { + return TaskStatusAbortedToJSONTyped(json, false); +} +export function TaskStatusAbortedToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'cleanUp': value.cleanUp, - 'status': value.status, + 'cleanUp': value['cleanUp'], + 'status': value['status'], }; } diff --git a/typescript/dist/esm/models/TaskStatusCompleted.d.ts b/typescript/dist/esm/models/TaskStatusCompleted.d.ts index 1798b6b9..0ebfa76d 100644 --- a/typescript/dist/esm/models/TaskStatusCompleted.d.ts +++ b/typescript/dist/esm/models/TaskStatusCompleted.d.ts @@ -62,7 +62,8 @@ export type TaskStatusCompletedStatusEnum = typeof TaskStatusCompletedStatusEnum /** * Check if a given object implements the TaskStatusCompleted interface. */ -export declare function instanceOfTaskStatusCompleted(value: object): boolean; +export declare function instanceOfTaskStatusCompleted(value: object): value is TaskStatusCompleted; export declare function TaskStatusCompletedFromJSON(json: any): TaskStatusCompleted; export declare function TaskStatusCompletedFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusCompleted; -export declare function TaskStatusCompletedToJSON(value?: TaskStatusCompleted | null): any; +export declare function TaskStatusCompletedToJSON(json: any): TaskStatusCompleted; +export declare function TaskStatusCompletedToJSONTyped(value?: TaskStatusCompleted | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TaskStatusCompleted.js b/typescript/dist/esm/models/TaskStatusCompleted.js index 5d672713..2b18506f 100644 --- a/typescript/dist/esm/models/TaskStatusCompleted.js +++ b/typescript/dist/esm/models/TaskStatusCompleted.js @@ -11,7 +11,6 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * @export */ @@ -22,42 +21,45 @@ export const TaskStatusCompletedStatusEnum = { * Check if a given object implements the TaskStatusCompleted interface. */ export function instanceOfTaskStatusCompleted(value) { - let isInstance = true; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "taskType" in value; - isInstance = isInstance && "timeStarted" in value; - isInstance = isInstance && "timeTotal" in value; - return isInstance; + if (!('status' in value) || value['status'] === undefined) + return false; + if (!('taskType' in value) || value['taskType'] === undefined) + return false; + if (!('timeStarted' in value) || value['timeStarted'] === undefined) + return false; + if (!('timeTotal' in value) || value['timeTotal'] === undefined) + return false; + return true; } export function TaskStatusCompletedFromJSON(json) { return TaskStatusCompletedFromJSONTyped(json, false); } export function TaskStatusCompletedFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'description': !exists(json, 'description') ? undefined : json['description'], - 'info': !exists(json, 'info') ? undefined : json['info'], + 'description': json['description'] == null ? undefined : json['description'], + 'info': json['info'] == null ? undefined : json['info'], 'status': json['status'], 'taskType': json['taskType'], 'timeStarted': json['timeStarted'], 'timeTotal': json['timeTotal'], }; } -export function TaskStatusCompletedToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusCompletedToJSON(json) { + return TaskStatusCompletedToJSONTyped(json, false); +} +export function TaskStatusCompletedToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'info': value.info, - 'status': value.status, - 'taskType': value.taskType, - 'timeStarted': value.timeStarted, - 'timeTotal': value.timeTotal, + 'description': value['description'], + 'info': value['info'], + 'status': value['status'], + 'taskType': value['taskType'], + 'timeStarted': value['timeStarted'], + 'timeTotal': value['timeTotal'], }; } diff --git a/typescript/dist/esm/models/TaskStatusFailed.d.ts b/typescript/dist/esm/models/TaskStatusFailed.d.ts index 504596a0..33463484 100644 --- a/typescript/dist/esm/models/TaskStatusFailed.d.ts +++ b/typescript/dist/esm/models/TaskStatusFailed.d.ts @@ -44,7 +44,8 @@ export type TaskStatusFailedStatusEnum = typeof TaskStatusFailedStatusEnum[keyof /** * Check if a given object implements the TaskStatusFailed interface. */ -export declare function instanceOfTaskStatusFailed(value: object): boolean; +export declare function instanceOfTaskStatusFailed(value: object): value is TaskStatusFailed; export declare function TaskStatusFailedFromJSON(json: any): TaskStatusFailed; export declare function TaskStatusFailedFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusFailed; -export declare function TaskStatusFailedToJSON(value?: TaskStatusFailed | null): any; +export declare function TaskStatusFailedToJSON(json: any): TaskStatusFailed; +export declare function TaskStatusFailedToJSONTyped(value?: TaskStatusFailed | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TaskStatusFailed.js b/typescript/dist/esm/models/TaskStatusFailed.js index 5bf8dbf8..6f722cb2 100644 --- a/typescript/dist/esm/models/TaskStatusFailed.js +++ b/typescript/dist/esm/models/TaskStatusFailed.js @@ -21,17 +21,19 @@ export const TaskStatusFailedStatusEnum = { * Check if a given object implements the TaskStatusFailed interface. */ export function instanceOfTaskStatusFailed(value) { - let isInstance = true; - isInstance = isInstance && "cleanUp" in value; - isInstance = isInstance && "error" in value; - isInstance = isInstance && "status" in value; - return isInstance; + if (!('cleanUp' in value) || value['cleanUp'] === undefined) + return false; + if (!('error' in value) || value['error'] === undefined) + return false; + if (!('status' in value) || value['status'] === undefined) + return false; + return true; } export function TaskStatusFailedFromJSON(json) { return TaskStatusFailedFromJSONTyped(json, false); } export function TaskStatusFailedFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -40,16 +42,16 @@ export function TaskStatusFailedFromJSONTyped(json, ignoreDiscriminator) { 'status': json['status'], }; } -export function TaskStatusFailedToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusFailedToJSON(json) { + return TaskStatusFailedToJSONTyped(json, false); +} +export function TaskStatusFailedToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'cleanUp': value.cleanUp, - 'error': value.error, - 'status': value.status, + 'cleanUp': value['cleanUp'], + 'error': value['error'], + 'status': value['status'], }; } diff --git a/typescript/dist/esm/models/TaskStatusRunning.d.ts b/typescript/dist/esm/models/TaskStatusRunning.d.ts index 8a344871..6c799474 100644 --- a/typescript/dist/esm/models/TaskStatusRunning.d.ts +++ b/typescript/dist/esm/models/TaskStatusRunning.d.ts @@ -68,7 +68,8 @@ export type TaskStatusRunningStatusEnum = typeof TaskStatusRunningStatusEnum[key /** * Check if a given object implements the TaskStatusRunning interface. */ -export declare function instanceOfTaskStatusRunning(value: object): boolean; +export declare function instanceOfTaskStatusRunning(value: object): value is TaskStatusRunning; export declare function TaskStatusRunningFromJSON(json: any): TaskStatusRunning; export declare function TaskStatusRunningFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusRunning; -export declare function TaskStatusRunningToJSON(value?: TaskStatusRunning | null): any; +export declare function TaskStatusRunningToJSON(json: any): TaskStatusRunning; +export declare function TaskStatusRunningToJSONTyped(value?: TaskStatusRunning | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TaskStatusRunning.js b/typescript/dist/esm/models/TaskStatusRunning.js index 6d48890c..d1c4ec56 100644 --- a/typescript/dist/esm/models/TaskStatusRunning.js +++ b/typescript/dist/esm/models/TaskStatusRunning.js @@ -11,7 +11,6 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * @export */ @@ -22,45 +21,49 @@ export const TaskStatusRunningStatusEnum = { * Check if a given object implements the TaskStatusRunning interface. */ export function instanceOfTaskStatusRunning(value) { - let isInstance = true; - isInstance = isInstance && "estimatedTimeRemaining" in value; - isInstance = isInstance && "pctComplete" in value; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "taskType" in value; - isInstance = isInstance && "timeStarted" in value; - return isInstance; + if (!('estimatedTimeRemaining' in value) || value['estimatedTimeRemaining'] === undefined) + return false; + if (!('pctComplete' in value) || value['pctComplete'] === undefined) + return false; + if (!('status' in value) || value['status'] === undefined) + return false; + if (!('taskType' in value) || value['taskType'] === undefined) + return false; + if (!('timeStarted' in value) || value['timeStarted'] === undefined) + return false; + return true; } export function TaskStatusRunningFromJSON(json) { return TaskStatusRunningFromJSONTyped(json, false); } export function TaskStatusRunningFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'description': !exists(json, 'description') ? undefined : json['description'], + 'description': json['description'] == null ? undefined : json['description'], 'estimatedTimeRemaining': json['estimatedTimeRemaining'], - 'info': !exists(json, 'info') ? undefined : json['info'], + 'info': json['info'] == null ? undefined : json['info'], 'pctComplete': json['pctComplete'], 'status': json['status'], 'taskType': json['taskType'], 'timeStarted': json['timeStarted'], }; } -export function TaskStatusRunningToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusRunningToJSON(json) { + return TaskStatusRunningToJSONTyped(json, false); +} +export function TaskStatusRunningToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'estimatedTimeRemaining': value.estimatedTimeRemaining, - 'info': value.info, - 'pctComplete': value.pctComplete, - 'status': value.status, - 'taskType': value.taskType, - 'timeStarted': value.timeStarted, + 'description': value['description'], + 'estimatedTimeRemaining': value['estimatedTimeRemaining'], + 'info': value['info'], + 'pctComplete': value['pctComplete'], + 'status': value['status'], + 'taskType': value['taskType'], + 'timeStarted': value['timeStarted'], }; } diff --git a/typescript/dist/esm/models/TaskStatusWithId.d.ts b/typescript/dist/esm/models/TaskStatusWithId.d.ts index 1ec8a3d8..dd98a011 100644 --- a/typescript/dist/esm/models/TaskStatusWithId.d.ts +++ b/typescript/dist/esm/models/TaskStatusWithId.d.ts @@ -29,7 +29,8 @@ export interface _TaskStatusWithId { /** * Check if a given object implements the TaskStatusWithId interface. */ -export declare function instanceOfTaskStatusWithId(value: object): boolean; +export declare function instanceOfTaskStatusWithId(value: object): value is TaskStatusWithId; export declare function TaskStatusWithIdFromJSON(json: any): TaskStatusWithId; export declare function TaskStatusWithIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusWithId; -export declare function TaskStatusWithIdToJSON(value?: TaskStatusWithId | null): any; +export declare function TaskStatusWithIdToJSON(json: any): TaskStatusWithId; +export declare function TaskStatusWithIdToJSONTyped(value?: TaskStatusWithId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TaskStatusWithId.js b/typescript/dist/esm/models/TaskStatusWithId.js index 2fbdda53..7a2c17ae 100644 --- a/typescript/dist/esm/models/TaskStatusWithId.js +++ b/typescript/dist/esm/models/TaskStatusWithId.js @@ -11,30 +11,30 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { TaskStatusFromJSONTyped, TaskStatusToJSON, } from './TaskStatus'; +import { TaskStatusFromJSONTyped, TaskStatusToJSONTyped, } from './TaskStatus'; /** * Check if a given object implements the TaskStatusWithId interface. */ export function instanceOfTaskStatusWithId(value) { - let isInstance = true; - isInstance = isInstance && "taskId" in value; - return isInstance; + if (!('taskId' in value) || value['taskId'] === undefined) + return false; + return true; } export function TaskStatusWithIdFromJSON(json) { return TaskStatusWithIdFromJSONTyped(json, false); } export function TaskStatusWithIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - return Object.assign(Object.assign({}, TaskStatusFromJSONTyped(json, ignoreDiscriminator)), { 'taskId': json['taskId'] }); + return Object.assign(Object.assign({}, TaskStatusFromJSONTyped(json, true)), { 'taskId': json['taskId'] }); } -export function TaskStatusWithIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusWithIdToJSON(json) { + return TaskStatusWithIdToJSONTyped(json, false); +} +export function TaskStatusWithIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } - return Object.assign(Object.assign({}, TaskStatusToJSON(value)), { 'taskId': value.taskId }); + return Object.assign(Object.assign({}, TaskStatusToJSONTyped(value, true)), { 'taskId': value['taskId'] }); } diff --git a/typescript/dist/esm/models/TextSymbology.d.ts b/typescript/dist/esm/models/TextSymbology.d.ts index f991cf0a..56347cce 100644 --- a/typescript/dist/esm/models/TextSymbology.d.ts +++ b/typescript/dist/esm/models/TextSymbology.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { ColorParam } from './ColorParam'; import type { StrokeParam } from './StrokeParam'; +import type { ColorParam } from './ColorParam'; /** * * @export @@ -39,7 +39,8 @@ export interface TextSymbology { /** * Check if a given object implements the TextSymbology interface. */ -export declare function instanceOfTextSymbology(value: object): boolean; +export declare function instanceOfTextSymbology(value: object): value is TextSymbology; export declare function TextSymbologyFromJSON(json: any): TextSymbology; export declare function TextSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): TextSymbology; -export declare function TextSymbologyToJSON(value?: TextSymbology | null): any; +export declare function TextSymbologyToJSON(json: any): TextSymbology; +export declare function TextSymbologyToJSONTyped(value?: TextSymbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TextSymbology.js b/typescript/dist/esm/models/TextSymbology.js index 3a3b02f9..08ea4d22 100644 --- a/typescript/dist/esm/models/TextSymbology.js +++ b/typescript/dist/esm/models/TextSymbology.js @@ -11,23 +11,25 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ColorParamFromJSON, ColorParamToJSON, } from './ColorParam'; import { StrokeParamFromJSON, StrokeParamToJSON, } from './StrokeParam'; +import { ColorParamFromJSON, ColorParamToJSON, } from './ColorParam'; /** * Check if a given object implements the TextSymbology interface. */ export function instanceOfTextSymbology(value) { - let isInstance = true; - isInstance = isInstance && "attribute" in value; - isInstance = isInstance && "fillColor" in value; - isInstance = isInstance && "stroke" in value; - return isInstance; + if (!('attribute' in value) || value['attribute'] === undefined) + return false; + if (!('fillColor' in value) || value['fillColor'] === undefined) + return false; + if (!('stroke' in value) || value['stroke'] === undefined) + return false; + return true; } export function TextSymbologyFromJSON(json) { return TextSymbologyFromJSONTyped(json, false); } export function TextSymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -36,16 +38,16 @@ export function TextSymbologyFromJSONTyped(json, ignoreDiscriminator) { 'stroke': StrokeParamFromJSON(json['stroke']), }; } -export function TextSymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TextSymbologyToJSON(json) { + return TextSymbologyToJSONTyped(json, false); +} +export function TextSymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'attribute': value.attribute, - 'fillColor': ColorParamToJSON(value.fillColor), - 'stroke': StrokeParamToJSON(value.stroke), + 'attribute': value['attribute'], + 'fillColor': ColorParamToJSON(value['fillColor']), + 'stroke': StrokeParamToJSON(value['stroke']), }; } diff --git a/typescript/dist/esm/models/TimeGranularity.d.ts b/typescript/dist/esm/models/TimeGranularity.d.ts index 4844814e..eaad282a 100644 --- a/typescript/dist/esm/models/TimeGranularity.d.ts +++ b/typescript/dist/esm/models/TimeGranularity.d.ts @@ -23,6 +23,8 @@ export declare const TimeGranularity: { readonly Years: "years"; }; export type TimeGranularity = typeof TimeGranularity[keyof typeof TimeGranularity]; +export declare function instanceOfTimeGranularity(value: any): boolean; export declare function TimeGranularityFromJSON(json: any): TimeGranularity; export declare function TimeGranularityFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeGranularity; export declare function TimeGranularityToJSON(value?: TimeGranularity | null): any; +export declare function TimeGranularityToJSONTyped(value: any, ignoreDiscriminator: boolean): TimeGranularity; diff --git a/typescript/dist/esm/models/TimeGranularity.js b/typescript/dist/esm/models/TimeGranularity.js index d30bbb4b..41394f34 100644 --- a/typescript/dist/esm/models/TimeGranularity.js +++ b/typescript/dist/esm/models/TimeGranularity.js @@ -24,6 +24,16 @@ export const TimeGranularity = { Months: 'months', Years: 'years' }; +export function instanceOfTimeGranularity(value) { + for (const key in TimeGranularity) { + if (Object.prototype.hasOwnProperty.call(TimeGranularity, key)) { + if (TimeGranularity[key] === value) { + return true; + } + } + } + return false; +} export function TimeGranularityFromJSON(json) { return TimeGranularityFromJSONTyped(json, false); } @@ -33,3 +43,6 @@ export function TimeGranularityFromJSONTyped(json, ignoreDiscriminator) { export function TimeGranularityToJSON(value) { return value; } +export function TimeGranularityToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/TimeInterval.d.ts b/typescript/dist/esm/models/TimeInterval.d.ts index a438b433..668a939c 100644 --- a/typescript/dist/esm/models/TimeInterval.d.ts +++ b/typescript/dist/esm/models/TimeInterval.d.ts @@ -31,7 +31,8 @@ export interface TimeInterval { /** * Check if a given object implements the TimeInterval interface. */ -export declare function instanceOfTimeInterval(value: object): boolean; +export declare function instanceOfTimeInterval(value: object): value is TimeInterval; export declare function TimeIntervalFromJSON(json: any): TimeInterval; export declare function TimeIntervalFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeInterval; -export declare function TimeIntervalToJSON(value?: TimeInterval | null): any; +export declare function TimeIntervalToJSON(json: any): TimeInterval; +export declare function TimeIntervalToJSONTyped(value?: TimeInterval | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TimeInterval.js b/typescript/dist/esm/models/TimeInterval.js index 82d496d4..504b67d0 100644 --- a/typescript/dist/esm/models/TimeInterval.js +++ b/typescript/dist/esm/models/TimeInterval.js @@ -15,16 +15,17 @@ * Check if a given object implements the TimeInterval interface. */ export function instanceOfTimeInterval(value) { - let isInstance = true; - isInstance = isInstance && "end" in value; - isInstance = isInstance && "start" in value; - return isInstance; + if (!('end' in value) || value['end'] === undefined) + return false; + if (!('start' in value) || value['start'] === undefined) + return false; + return true; } export function TimeIntervalFromJSON(json) { return TimeIntervalFromJSONTyped(json, false); } export function TimeIntervalFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function TimeIntervalFromJSONTyped(json, ignoreDiscriminator) { 'start': json['start'], }; } -export function TimeIntervalToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TimeIntervalToJSON(json) { + return TimeIntervalToJSONTyped(json, false); +} +export function TimeIntervalToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'end': value.end, - 'start': value.start, + 'end': value['end'], + 'start': value['start'], }; } diff --git a/typescript/dist/esm/models/TimeReference.d.ts b/typescript/dist/esm/models/TimeReference.d.ts index 95a1a237..f90bcb73 100644 --- a/typescript/dist/esm/models/TimeReference.d.ts +++ b/typescript/dist/esm/models/TimeReference.d.ts @@ -18,6 +18,8 @@ export declare const TimeReference: { readonly End: "end"; }; export type TimeReference = typeof TimeReference[keyof typeof TimeReference]; +export declare function instanceOfTimeReference(value: any): boolean; export declare function TimeReferenceFromJSON(json: any): TimeReference; export declare function TimeReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeReference; export declare function TimeReferenceToJSON(value?: TimeReference | null): any; +export declare function TimeReferenceToJSONTyped(value: any, ignoreDiscriminator: boolean): TimeReference; diff --git a/typescript/dist/esm/models/TimeReference.js b/typescript/dist/esm/models/TimeReference.js index 4b8fd608..a37ed40f 100644 --- a/typescript/dist/esm/models/TimeReference.js +++ b/typescript/dist/esm/models/TimeReference.js @@ -19,6 +19,16 @@ export const TimeReference = { Start: 'start', End: 'end' }; +export function instanceOfTimeReference(value) { + for (const key in TimeReference) { + if (Object.prototype.hasOwnProperty.call(TimeReference, key)) { + if (TimeReference[key] === value) { + return true; + } + } + } + return false; +} export function TimeReferenceFromJSON(json) { return TimeReferenceFromJSONTyped(json, false); } @@ -28,3 +38,6 @@ export function TimeReferenceFromJSONTyped(json, ignoreDiscriminator) { export function TimeReferenceToJSON(value) { return value; } +export function TimeReferenceToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/TimeStep.d.ts b/typescript/dist/esm/models/TimeStep.d.ts index a3e6fd56..68191961 100644 --- a/typescript/dist/esm/models/TimeStep.d.ts +++ b/typescript/dist/esm/models/TimeStep.d.ts @@ -32,7 +32,8 @@ export interface TimeStep { /** * Check if a given object implements the TimeStep interface. */ -export declare function instanceOfTimeStep(value: object): boolean; +export declare function instanceOfTimeStep(value: object): value is TimeStep; export declare function TimeStepFromJSON(json: any): TimeStep; export declare function TimeStepFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeStep; -export declare function TimeStepToJSON(value?: TimeStep | null): any; +export declare function TimeStepToJSON(json: any): TimeStep; +export declare function TimeStepToJSONTyped(value?: TimeStep | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TimeStep.js b/typescript/dist/esm/models/TimeStep.js index 5be03b37..b5e84f2f 100644 --- a/typescript/dist/esm/models/TimeStep.js +++ b/typescript/dist/esm/models/TimeStep.js @@ -16,16 +16,17 @@ import { TimeGranularityFromJSON, TimeGranularityToJSON, } from './TimeGranulari * Check if a given object implements the TimeStep interface. */ export function instanceOfTimeStep(value) { - let isInstance = true; - isInstance = isInstance && "granularity" in value; - isInstance = isInstance && "step" in value; - return isInstance; + if (!('granularity' in value) || value['granularity'] === undefined) + return false; + if (!('step' in value) || value['step'] === undefined) + return false; + return true; } export function TimeStepFromJSON(json) { return TimeStepFromJSONTyped(json, false); } export function TimeStepFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -33,15 +34,15 @@ export function TimeStepFromJSONTyped(json, ignoreDiscriminator) { 'step': json['step'], }; } -export function TimeStepToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TimeStepToJSON(json) { + return TimeStepToJSONTyped(json, false); +} +export function TimeStepToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'granularity': TimeGranularityToJSON(value.granularity), - 'step': value.step, + 'granularity': TimeGranularityToJSON(value['granularity']), + 'step': value['step'], }; } diff --git a/typescript/dist/esm/models/TypedGeometry.d.ts b/typescript/dist/esm/models/TypedGeometry.d.ts index 8fb9a5aa..387d5570 100644 --- a/typescript/dist/esm/models/TypedGeometry.d.ts +++ b/typescript/dist/esm/models/TypedGeometry.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { TypedGeometryOneOf } from './TypedGeometryOneOf'; -import { TypedGeometryOneOf1 } from './TypedGeometryOneOf1'; -import { TypedGeometryOneOf2 } from './TypedGeometryOneOf2'; -import { TypedGeometryOneOf3 } from './TypedGeometryOneOf3'; +import type { TypedGeometryOneOf } from './TypedGeometryOneOf'; +import type { TypedGeometryOneOf1 } from './TypedGeometryOneOf1'; +import type { TypedGeometryOneOf2 } from './TypedGeometryOneOf2'; +import type { TypedGeometryOneOf3 } from './TypedGeometryOneOf3'; /** * @type TypedGeometry * @@ -21,4 +21,5 @@ import { TypedGeometryOneOf3 } from './TypedGeometryOneOf3'; export type TypedGeometry = TypedGeometryOneOf | TypedGeometryOneOf1 | TypedGeometryOneOf2 | TypedGeometryOneOf3; export declare function TypedGeometryFromJSON(json: any): TypedGeometry; export declare function TypedGeometryFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometry; -export declare function TypedGeometryToJSON(value?: TypedGeometry | null): any; +export declare function TypedGeometryToJSON(json: any): any; +export declare function TypedGeometryToJSONTyped(value?: TypedGeometry | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TypedGeometry.js b/typescript/dist/esm/models/TypedGeometry.js index 78c7c1a3..266a65c7 100644 --- a/typescript/dist/esm/models/TypedGeometry.js +++ b/typescript/dist/esm/models/TypedGeometry.js @@ -19,17 +19,29 @@ export function TypedGeometryFromJSON(json) { return TypedGeometryFromJSONTyped(json, false); } export function TypedGeometryFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - return Object.assign(Object.assign(Object.assign(Object.assign({}, TypedGeometryOneOfFromJSONTyped(json, true)), TypedGeometryOneOf1FromJSONTyped(json, true)), TypedGeometryOneOf2FromJSONTyped(json, true)), TypedGeometryOneOf3FromJSONTyped(json, true)); -} -export function TypedGeometryToJSON(value) { - if (value === undefined) { - return undefined; + if (instanceOfTypedGeometryOneOf(json)) { + return TypedGeometryOneOfFromJSONTyped(json, true); + } + if (instanceOfTypedGeometryOneOf1(json)) { + return TypedGeometryOneOf1FromJSONTyped(json, true); + } + if (instanceOfTypedGeometryOneOf2(json)) { + return TypedGeometryOneOf2FromJSONTyped(json, true); + } + if (instanceOfTypedGeometryOneOf3(json)) { + return TypedGeometryOneOf3FromJSONTyped(json, true); } - if (value === null) { - return null; + return {}; +} +export function TypedGeometryToJSON(json) { + return TypedGeometryToJSONTyped(json, false); +} +export function TypedGeometryToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } if (instanceOfTypedGeometryOneOf(value)) { return TypedGeometryOneOfToJSON(value); diff --git a/typescript/dist/esm/models/TypedGeometryOneOf.d.ts b/typescript/dist/esm/models/TypedGeometryOneOf.d.ts index 144d3260..22849c21 100644 --- a/typescript/dist/esm/models/TypedGeometryOneOf.d.ts +++ b/typescript/dist/esm/models/TypedGeometryOneOf.d.ts @@ -25,7 +25,8 @@ export interface TypedGeometryOneOf { /** * Check if a given object implements the TypedGeometryOneOf interface. */ -export declare function instanceOfTypedGeometryOneOf(value: object): boolean; +export declare function instanceOfTypedGeometryOneOf(value: object): value is TypedGeometryOneOf; export declare function TypedGeometryOneOfFromJSON(json: any): TypedGeometryOneOf; export declare function TypedGeometryOneOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf; -export declare function TypedGeometryOneOfToJSON(value?: TypedGeometryOneOf | null): any; +export declare function TypedGeometryOneOfToJSON(json: any): TypedGeometryOneOf; +export declare function TypedGeometryOneOfToJSONTyped(value?: TypedGeometryOneOf | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TypedGeometryOneOf.js b/typescript/dist/esm/models/TypedGeometryOneOf.js index 5882f9a0..bed61ffb 100644 --- a/typescript/dist/esm/models/TypedGeometryOneOf.js +++ b/typescript/dist/esm/models/TypedGeometryOneOf.js @@ -15,29 +15,29 @@ * Check if a given object implements the TypedGeometryOneOf interface. */ export function instanceOfTypedGeometryOneOf(value) { - let isInstance = true; - isInstance = isInstance && "data" in value; - return isInstance; + if (!('data' in value) || value['data'] === undefined) + return false; + return true; } export function TypedGeometryOneOfFromJSON(json) { return TypedGeometryOneOfFromJSONTyped(json, false); } export function TypedGeometryOneOfFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'data': json['Data'], }; } -export function TypedGeometryOneOfToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedGeometryOneOfToJSON(json) { + return TypedGeometryOneOfToJSONTyped(json, false); +} +export function TypedGeometryOneOfToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'Data': value.data, + 'Data': value['data'], }; } diff --git a/typescript/dist/esm/models/TypedGeometryOneOf1.d.ts b/typescript/dist/esm/models/TypedGeometryOneOf1.d.ts index c0f65753..42f044e1 100644 --- a/typescript/dist/esm/models/TypedGeometryOneOf1.d.ts +++ b/typescript/dist/esm/models/TypedGeometryOneOf1.d.ts @@ -26,7 +26,8 @@ export interface TypedGeometryOneOf1 { /** * Check if a given object implements the TypedGeometryOneOf1 interface. */ -export declare function instanceOfTypedGeometryOneOf1(value: object): boolean; +export declare function instanceOfTypedGeometryOneOf1(value: object): value is TypedGeometryOneOf1; export declare function TypedGeometryOneOf1FromJSON(json: any): TypedGeometryOneOf1; export declare function TypedGeometryOneOf1FromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf1; -export declare function TypedGeometryOneOf1ToJSON(value?: TypedGeometryOneOf1 | null): any; +export declare function TypedGeometryOneOf1ToJSON(json: any): TypedGeometryOneOf1; +export declare function TypedGeometryOneOf1ToJSONTyped(value?: TypedGeometryOneOf1 | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TypedGeometryOneOf1.js b/typescript/dist/esm/models/TypedGeometryOneOf1.js index 68f5cbf0..b0e202c4 100644 --- a/typescript/dist/esm/models/TypedGeometryOneOf1.js +++ b/typescript/dist/esm/models/TypedGeometryOneOf1.js @@ -16,29 +16,29 @@ import { MultiPointFromJSON, MultiPointToJSON, } from './MultiPoint'; * Check if a given object implements the TypedGeometryOneOf1 interface. */ export function instanceOfTypedGeometryOneOf1(value) { - let isInstance = true; - isInstance = isInstance && "multiPoint" in value; - return isInstance; + if (!('multiPoint' in value) || value['multiPoint'] === undefined) + return false; + return true; } export function TypedGeometryOneOf1FromJSON(json) { return TypedGeometryOneOf1FromJSONTyped(json, false); } export function TypedGeometryOneOf1FromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'multiPoint': MultiPointFromJSON(json['MultiPoint']), }; } -export function TypedGeometryOneOf1ToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedGeometryOneOf1ToJSON(json) { + return TypedGeometryOneOf1ToJSONTyped(json, false); +} +export function TypedGeometryOneOf1ToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'MultiPoint': MultiPointToJSON(value.multiPoint), + 'MultiPoint': MultiPointToJSON(value['multiPoint']), }; } diff --git a/typescript/dist/esm/models/TypedGeometryOneOf2.d.ts b/typescript/dist/esm/models/TypedGeometryOneOf2.d.ts index bb17369f..afcd53a3 100644 --- a/typescript/dist/esm/models/TypedGeometryOneOf2.d.ts +++ b/typescript/dist/esm/models/TypedGeometryOneOf2.d.ts @@ -26,7 +26,8 @@ export interface TypedGeometryOneOf2 { /** * Check if a given object implements the TypedGeometryOneOf2 interface. */ -export declare function instanceOfTypedGeometryOneOf2(value: object): boolean; +export declare function instanceOfTypedGeometryOneOf2(value: object): value is TypedGeometryOneOf2; export declare function TypedGeometryOneOf2FromJSON(json: any): TypedGeometryOneOf2; export declare function TypedGeometryOneOf2FromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf2; -export declare function TypedGeometryOneOf2ToJSON(value?: TypedGeometryOneOf2 | null): any; +export declare function TypedGeometryOneOf2ToJSON(json: any): TypedGeometryOneOf2; +export declare function TypedGeometryOneOf2ToJSONTyped(value?: TypedGeometryOneOf2 | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TypedGeometryOneOf2.js b/typescript/dist/esm/models/TypedGeometryOneOf2.js index 072c6982..da1f7aa4 100644 --- a/typescript/dist/esm/models/TypedGeometryOneOf2.js +++ b/typescript/dist/esm/models/TypedGeometryOneOf2.js @@ -16,29 +16,29 @@ import { MultiLineStringFromJSON, MultiLineStringToJSON, } from './MultiLineStri * Check if a given object implements the TypedGeometryOneOf2 interface. */ export function instanceOfTypedGeometryOneOf2(value) { - let isInstance = true; - isInstance = isInstance && "multiLineString" in value; - return isInstance; + if (!('multiLineString' in value) || value['multiLineString'] === undefined) + return false; + return true; } export function TypedGeometryOneOf2FromJSON(json) { return TypedGeometryOneOf2FromJSONTyped(json, false); } export function TypedGeometryOneOf2FromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'multiLineString': MultiLineStringFromJSON(json['MultiLineString']), }; } -export function TypedGeometryOneOf2ToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedGeometryOneOf2ToJSON(json) { + return TypedGeometryOneOf2ToJSONTyped(json, false); +} +export function TypedGeometryOneOf2ToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'MultiLineString': MultiLineStringToJSON(value.multiLineString), + 'MultiLineString': MultiLineStringToJSON(value['multiLineString']), }; } diff --git a/typescript/dist/esm/models/TypedGeometryOneOf3.d.ts b/typescript/dist/esm/models/TypedGeometryOneOf3.d.ts index 10252452..6f34e815 100644 --- a/typescript/dist/esm/models/TypedGeometryOneOf3.d.ts +++ b/typescript/dist/esm/models/TypedGeometryOneOf3.d.ts @@ -26,7 +26,8 @@ export interface TypedGeometryOneOf3 { /** * Check if a given object implements the TypedGeometryOneOf3 interface. */ -export declare function instanceOfTypedGeometryOneOf3(value: object): boolean; +export declare function instanceOfTypedGeometryOneOf3(value: object): value is TypedGeometryOneOf3; export declare function TypedGeometryOneOf3FromJSON(json: any): TypedGeometryOneOf3; export declare function TypedGeometryOneOf3FromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf3; -export declare function TypedGeometryOneOf3ToJSON(value?: TypedGeometryOneOf3 | null): any; +export declare function TypedGeometryOneOf3ToJSON(json: any): TypedGeometryOneOf3; +export declare function TypedGeometryOneOf3ToJSONTyped(value?: TypedGeometryOneOf3 | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TypedGeometryOneOf3.js b/typescript/dist/esm/models/TypedGeometryOneOf3.js index 147b7dce..25fc9970 100644 --- a/typescript/dist/esm/models/TypedGeometryOneOf3.js +++ b/typescript/dist/esm/models/TypedGeometryOneOf3.js @@ -16,29 +16,29 @@ import { MultiPolygonFromJSON, MultiPolygonToJSON, } from './MultiPolygon'; * Check if a given object implements the TypedGeometryOneOf3 interface. */ export function instanceOfTypedGeometryOneOf3(value) { - let isInstance = true; - isInstance = isInstance && "multiPolygon" in value; - return isInstance; + if (!('multiPolygon' in value) || value['multiPolygon'] === undefined) + return false; + return true; } export function TypedGeometryOneOf3FromJSON(json) { return TypedGeometryOneOf3FromJSONTyped(json, false); } export function TypedGeometryOneOf3FromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'multiPolygon': MultiPolygonFromJSON(json['MultiPolygon']), }; } -export function TypedGeometryOneOf3ToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedGeometryOneOf3ToJSON(json) { + return TypedGeometryOneOf3ToJSONTyped(json, false); +} +export function TypedGeometryOneOf3ToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'MultiPolygon': MultiPolygonToJSON(value.multiPolygon), + 'MultiPolygon': MultiPolygonToJSON(value['multiPolygon']), }; } diff --git a/typescript/dist/esm/models/TypedOperator.d.ts b/typescript/dist/esm/models/TypedOperator.d.ts index 7da0150b..64b8dda6 100644 --- a/typescript/dist/esm/models/TypedOperator.d.ts +++ b/typescript/dist/esm/models/TypedOperator.d.ts @@ -41,7 +41,8 @@ export type TypedOperatorTypeEnum = typeof TypedOperatorTypeEnum[keyof typeof Ty /** * Check if a given object implements the TypedOperator interface. */ -export declare function instanceOfTypedOperator(value: object): boolean; +export declare function instanceOfTypedOperator(value: object): value is TypedOperator; export declare function TypedOperatorFromJSON(json: any): TypedOperator; export declare function TypedOperatorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedOperator; -export declare function TypedOperatorToJSON(value?: TypedOperator | null): any; +export declare function TypedOperatorToJSON(json: any): TypedOperator; +export declare function TypedOperatorToJSONTyped(value?: TypedOperator | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TypedOperator.js b/typescript/dist/esm/models/TypedOperator.js index 7787a1e4..8ecc4a7d 100644 --- a/typescript/dist/esm/models/TypedOperator.js +++ b/typescript/dist/esm/models/TypedOperator.js @@ -24,16 +24,17 @@ export const TypedOperatorTypeEnum = { * Check if a given object implements the TypedOperator interface. */ export function instanceOfTypedOperator(value) { - let isInstance = true; - isInstance = isInstance && "operator" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('operator' in value) || value['operator'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function TypedOperatorFromJSON(json) { return TypedOperatorFromJSONTyped(json, false); } export function TypedOperatorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,15 +42,15 @@ export function TypedOperatorFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function TypedOperatorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedOperatorToJSON(json) { + return TypedOperatorToJSONTyped(json, false); +} +export function TypedOperatorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'operator': TypedOperatorOperatorToJSON(value.operator), - 'type': value.type, + 'operator': TypedOperatorOperatorToJSON(value['operator']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/TypedOperatorOperator.d.ts b/typescript/dist/esm/models/TypedOperatorOperator.d.ts index f963ebb2..a7bf1a64 100644 --- a/typescript/dist/esm/models/TypedOperatorOperator.d.ts +++ b/typescript/dist/esm/models/TypedOperatorOperator.d.ts @@ -37,7 +37,8 @@ export interface TypedOperatorOperator { /** * Check if a given object implements the TypedOperatorOperator interface. */ -export declare function instanceOfTypedOperatorOperator(value: object): boolean; +export declare function instanceOfTypedOperatorOperator(value: object): value is TypedOperatorOperator; export declare function TypedOperatorOperatorFromJSON(json: any): TypedOperatorOperator; export declare function TypedOperatorOperatorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedOperatorOperator; -export declare function TypedOperatorOperatorToJSON(value?: TypedOperatorOperator | null): any; +export declare function TypedOperatorOperatorToJSON(json: any): TypedOperatorOperator; +export declare function TypedOperatorOperatorToJSONTyped(value?: TypedOperatorOperator | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TypedOperatorOperator.js b/typescript/dist/esm/models/TypedOperatorOperator.js index fdcda8e9..fa9da074 100644 --- a/typescript/dist/esm/models/TypedOperatorOperator.js +++ b/typescript/dist/esm/models/TypedOperatorOperator.js @@ -11,38 +11,37 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * Check if a given object implements the TypedOperatorOperator interface. */ export function instanceOfTypedOperatorOperator(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function TypedOperatorOperatorFromJSON(json) { return TypedOperatorOperatorFromJSONTyped(json, false); } export function TypedOperatorOperatorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'params': !exists(json, 'params') ? undefined : json['params'], - 'sources': !exists(json, 'sources') ? undefined : json['sources'], + 'params': json['params'] == null ? undefined : json['params'], + 'sources': json['sources'] == null ? undefined : json['sources'], 'type': json['type'], }; } -export function TypedOperatorOperatorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedOperatorOperatorToJSON(json) { + return TypedOperatorOperatorToJSONTyped(json, false); +} +export function TypedOperatorOperatorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'params': value.params, - 'sources': value.sources, - 'type': value.type, + 'params': value['params'], + 'sources': value['sources'], + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/TypedPlotResultDescriptor.d.ts b/typescript/dist/esm/models/TypedPlotResultDescriptor.d.ts index 4c2d4c1e..f98a5e4e 100644 --- a/typescript/dist/esm/models/TypedPlotResultDescriptor.d.ts +++ b/typescript/dist/esm/models/TypedPlotResultDescriptor.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; import type { TimeInterval } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * A `ResultDescriptor` for plot queries * @export @@ -52,7 +52,8 @@ export type TypedPlotResultDescriptorTypeEnum = typeof TypedPlotResultDescriptor /** * Check if a given object implements the TypedPlotResultDescriptor interface. */ -export declare function instanceOfTypedPlotResultDescriptor(value: object): boolean; +export declare function instanceOfTypedPlotResultDescriptor(value: object): value is TypedPlotResultDescriptor; export declare function TypedPlotResultDescriptorFromJSON(json: any): TypedPlotResultDescriptor; export declare function TypedPlotResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedPlotResultDescriptor; -export declare function TypedPlotResultDescriptorToJSON(value?: TypedPlotResultDescriptor | null): any; +export declare function TypedPlotResultDescriptorToJSON(json: any): TypedPlotResultDescriptor; +export declare function TypedPlotResultDescriptorToJSONTyped(value?: TypedPlotResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TypedPlotResultDescriptor.js b/typescript/dist/esm/models/TypedPlotResultDescriptor.js index d15fe648..e23c6e48 100644 --- a/typescript/dist/esm/models/TypedPlotResultDescriptor.js +++ b/typescript/dist/esm/models/TypedPlotResultDescriptor.js @@ -11,9 +11,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; +import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; /** * @export */ @@ -24,36 +23,37 @@ export const TypedPlotResultDescriptorTypeEnum = { * Check if a given object implements the TypedPlotResultDescriptor interface. */ export function instanceOfTypedPlotResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function TypedPlotResultDescriptorFromJSON(json) { return TypedPlotResultDescriptorFromJSONTyped(json, false); } export function TypedPlotResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !exists(json, 'bbox') ? undefined : BoundingBox2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : BoundingBox2DFromJSON(json['bbox']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), 'type': json['type'], }; } -export function TypedPlotResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedPlotResultDescriptorToJSON(json) { + return TypedPlotResultDescriptorToJSONTyped(json, false); +} +export function TypedPlotResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bbox': BoundingBox2DToJSON(value.bbox), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), - 'type': value.type, + 'bbox': BoundingBox2DToJSON(value['bbox']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/TypedRasterResultDescriptor.d.ts b/typescript/dist/esm/models/TypedRasterResultDescriptor.d.ts index 582712a7..b1b7d737 100644 --- a/typescript/dist/esm/models/TypedRasterResultDescriptor.d.ts +++ b/typescript/dist/esm/models/TypedRasterResultDescriptor.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import type { SpatialResolution } from './SpatialResolution'; +import type { TimeInterval } from './TimeInterval'; import type { RasterBandDescriptor } from './RasterBandDescriptor'; import type { RasterDataType } from './RasterDataType'; import type { SpatialPartition2D } from './SpatialPartition2D'; -import type { SpatialResolution } from './SpatialResolution'; -import type { TimeInterval } from './TimeInterval'; /** * A `ResultDescriptor` for raster queries * @export @@ -73,7 +73,8 @@ export type TypedRasterResultDescriptorTypeEnum = typeof TypedRasterResultDescri /** * Check if a given object implements the TypedRasterResultDescriptor interface. */ -export declare function instanceOfTypedRasterResultDescriptor(value: object): boolean; +export declare function instanceOfTypedRasterResultDescriptor(value: object): value is TypedRasterResultDescriptor; export declare function TypedRasterResultDescriptorFromJSON(json: any): TypedRasterResultDescriptor; export declare function TypedRasterResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedRasterResultDescriptor; -export declare function TypedRasterResultDescriptorToJSON(value?: TypedRasterResultDescriptor | null): any; +export declare function TypedRasterResultDescriptorToJSON(json: any): TypedRasterResultDescriptor; +export declare function TypedRasterResultDescriptorToJSONTyped(value?: TypedRasterResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TypedRasterResultDescriptor.js b/typescript/dist/esm/models/TypedRasterResultDescriptor.js index 89b67b5a..0f141855 100644 --- a/typescript/dist/esm/models/TypedRasterResultDescriptor.js +++ b/typescript/dist/esm/models/TypedRasterResultDescriptor.js @@ -11,12 +11,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; +import { SpatialResolutionFromJSON, SpatialResolutionToJSON, } from './SpatialResolution'; +import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; import { RasterBandDescriptorFromJSON, RasterBandDescriptorToJSON, } from './RasterBandDescriptor'; import { RasterDataTypeFromJSON, RasterDataTypeToJSON, } from './RasterDataType'; import { SpatialPartition2DFromJSON, SpatialPartition2DToJSON, } from './SpatialPartition2D'; -import { SpatialResolutionFromJSON, SpatialResolutionToJSON, } from './SpatialResolution'; -import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; /** * @export */ @@ -27,44 +26,47 @@ export const TypedRasterResultDescriptorTypeEnum = { * Check if a given object implements the TypedRasterResultDescriptor interface. */ export function instanceOfTypedRasterResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "bands" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('bands' in value) || value['bands'] === undefined) + return false; + if (!('dataType' in value) || value['dataType'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function TypedRasterResultDescriptorFromJSON(json) { return TypedRasterResultDescriptorFromJSONTyped(json, false); } export function TypedRasterResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bands': (json['bands'].map(RasterBandDescriptorFromJSON)), - 'bbox': !exists(json, 'bbox') ? undefined : SpatialPartition2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : SpatialPartition2DFromJSON(json['bbox']), 'dataType': RasterDataTypeFromJSON(json['dataType']), - 'resolution': !exists(json, 'resolution') ? undefined : SpatialResolutionFromJSON(json['resolution']), + 'resolution': json['resolution'] == null ? undefined : SpatialResolutionFromJSON(json['resolution']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), 'type': json['type'], }; } -export function TypedRasterResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedRasterResultDescriptorToJSON(json) { + return TypedRasterResultDescriptorToJSONTyped(json, false); +} +export function TypedRasterResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bands': (value.bands.map(RasterBandDescriptorToJSON)), - 'bbox': SpatialPartition2DToJSON(value.bbox), - 'dataType': RasterDataTypeToJSON(value.dataType), - 'resolution': SpatialResolutionToJSON(value.resolution), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), - 'type': value.type, + 'bands': (value['bands'].map(RasterBandDescriptorToJSON)), + 'bbox': SpatialPartition2DToJSON(value['bbox']), + 'dataType': RasterDataTypeToJSON(value['dataType']), + 'resolution': SpatialResolutionToJSON(value['resolution']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/TypedResultDescriptor.d.ts b/typescript/dist/esm/models/TypedResultDescriptor.d.ts index dfae9e11..2a12b53e 100644 --- a/typescript/dist/esm/models/TypedResultDescriptor.d.ts +++ b/typescript/dist/esm/models/TypedResultDescriptor.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { TypedPlotResultDescriptor } from './TypedPlotResultDescriptor'; -import { TypedRasterResultDescriptor } from './TypedRasterResultDescriptor'; -import { TypedVectorResultDescriptor } from './TypedVectorResultDescriptor'; +import type { TypedPlotResultDescriptor } from './TypedPlotResultDescriptor'; +import type { TypedRasterResultDescriptor } from './TypedRasterResultDescriptor'; +import type { TypedVectorResultDescriptor } from './TypedVectorResultDescriptor'; /** * @type TypedResultDescriptor * @@ -26,4 +26,5 @@ export type TypedResultDescriptor = { } & TypedVectorResultDescriptor; export declare function TypedResultDescriptorFromJSON(json: any): TypedResultDescriptor; export declare function TypedResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedResultDescriptor; -export declare function TypedResultDescriptorToJSON(value?: TypedResultDescriptor | null): any; +export declare function TypedResultDescriptorToJSON(json: any): any; +export declare function TypedResultDescriptorToJSONTyped(value?: TypedResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TypedResultDescriptor.js b/typescript/dist/esm/models/TypedResultDescriptor.js index be4f933b..022a94c8 100644 --- a/typescript/dist/esm/models/TypedResultDescriptor.js +++ b/typescript/dist/esm/models/TypedResultDescriptor.js @@ -18,34 +18,34 @@ export function TypedResultDescriptorFromJSON(json) { return TypedResultDescriptorFromJSONTyped(json, false); } export function TypedResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'plot': - return Object.assign(Object.assign({}, TypedPlotResultDescriptorFromJSONTyped(json, true)), { type: 'plot' }); + return Object.assign({}, TypedPlotResultDescriptorFromJSONTyped(json, true), { type: 'plot' }); case 'raster': - return Object.assign(Object.assign({}, TypedRasterResultDescriptorFromJSONTyped(json, true)), { type: 'raster' }); + return Object.assign({}, TypedRasterResultDescriptorFromJSONTyped(json, true), { type: 'raster' }); case 'vector': - return Object.assign(Object.assign({}, TypedVectorResultDescriptorFromJSONTyped(json, true)), { type: 'vector' }); + return Object.assign({}, TypedVectorResultDescriptorFromJSONTyped(json, true), { type: 'vector' }); default: throw new Error(`No variant of TypedResultDescriptor exists with 'type=${json['type']}'`); } } -export function TypedResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedResultDescriptorToJSON(json) { + return TypedResultDescriptorToJSONTyped(json, false); +} +export function TypedResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'plot': - return TypedPlotResultDescriptorToJSON(value); + return Object.assign({}, TypedPlotResultDescriptorToJSON(value), { type: 'plot' }); case 'raster': - return TypedRasterResultDescriptorToJSON(value); + return Object.assign({}, TypedRasterResultDescriptorToJSON(value), { type: 'raster' }); case 'vector': - return TypedVectorResultDescriptorToJSON(value); + return Object.assign({}, TypedVectorResultDescriptorToJSON(value), { type: 'vector' }); default: throw new Error(`No variant of TypedResultDescriptor exists with 'type=${value['type']}'`); } diff --git a/typescript/dist/esm/models/TypedVectorResultDescriptor.d.ts b/typescript/dist/esm/models/TypedVectorResultDescriptor.d.ts index ca993dac..a72f8495 100644 --- a/typescript/dist/esm/models/TypedVectorResultDescriptor.d.ts +++ b/typescript/dist/esm/models/TypedVectorResultDescriptor.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; +import type { VectorDataType } from './VectorDataType'; import type { TimeInterval } from './TimeInterval'; import type { VectorColumnInfo } from './VectorColumnInfo'; -import type { VectorDataType } from './VectorDataType'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * * @export @@ -68,7 +68,8 @@ export type TypedVectorResultDescriptorTypeEnum = typeof TypedVectorResultDescri /** * Check if a given object implements the TypedVectorResultDescriptor interface. */ -export declare function instanceOfTypedVectorResultDescriptor(value: object): boolean; +export declare function instanceOfTypedVectorResultDescriptor(value: object): value is TypedVectorResultDescriptor; export declare function TypedVectorResultDescriptorFromJSON(json: any): TypedVectorResultDescriptor; export declare function TypedVectorResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedVectorResultDescriptor; -export declare function TypedVectorResultDescriptorToJSON(value?: TypedVectorResultDescriptor | null): any; +export declare function TypedVectorResultDescriptorToJSON(json: any): TypedVectorResultDescriptor; +export declare function TypedVectorResultDescriptorToJSONTyped(value?: TypedVectorResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/TypedVectorResultDescriptor.js b/typescript/dist/esm/models/TypedVectorResultDescriptor.js index 243fb807..fc72f007 100644 --- a/typescript/dist/esm/models/TypedVectorResultDescriptor.js +++ b/typescript/dist/esm/models/TypedVectorResultDescriptor.js @@ -11,11 +11,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; +import { mapValues } from '../runtime'; +import { VectorDataTypeFromJSON, VectorDataTypeToJSON, } from './VectorDataType'; import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; import { VectorColumnInfoFromJSON, VectorColumnInfoToJSON, } from './VectorColumnInfo'; -import { VectorDataTypeFromJSON, VectorDataTypeToJSON, } from './VectorDataType'; +import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; /** * @export */ @@ -26,42 +26,45 @@ export const TypedVectorResultDescriptorTypeEnum = { * Check if a given object implements the TypedVectorResultDescriptor interface. */ export function instanceOfTypedVectorResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "columns" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('columns' in value) || value['columns'] === undefined) + return false; + if (!('dataType' in value) || value['dataType'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function TypedVectorResultDescriptorFromJSON(json) { return TypedVectorResultDescriptorFromJSONTyped(json, false); } export function TypedVectorResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !exists(json, 'bbox') ? undefined : BoundingBox2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : BoundingBox2DFromJSON(json['bbox']), 'columns': (mapValues(json['columns'], VectorColumnInfoFromJSON)), 'dataType': VectorDataTypeFromJSON(json['dataType']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), 'type': json['type'], }; } -export function TypedVectorResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedVectorResultDescriptorToJSON(json) { + return TypedVectorResultDescriptorToJSONTyped(json, false); +} +export function TypedVectorResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bbox': BoundingBox2DToJSON(value.bbox), - 'columns': (mapValues(value.columns, VectorColumnInfoToJSON)), - 'dataType': VectorDataTypeToJSON(value.dataType), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), - 'type': value.type, + 'bbox': BoundingBox2DToJSON(value['bbox']), + 'columns': (mapValues(value['columns'], VectorColumnInfoToJSON)), + 'dataType': VectorDataTypeToJSON(value['dataType']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/UnitlessMeasurement.d.ts b/typescript/dist/esm/models/UnitlessMeasurement.d.ts index 47b244dc..1fcd56d4 100644 --- a/typescript/dist/esm/models/UnitlessMeasurement.d.ts +++ b/typescript/dist/esm/models/UnitlessMeasurement.d.ts @@ -27,14 +27,13 @@ export interface UnitlessMeasurement { */ export declare const UnitlessMeasurementTypeEnum: { readonly Unitless: "unitless"; - readonly Continuous: "continuous"; - readonly Classification: "classification"; }; export type UnitlessMeasurementTypeEnum = typeof UnitlessMeasurementTypeEnum[keyof typeof UnitlessMeasurementTypeEnum]; /** * Check if a given object implements the UnitlessMeasurement interface. */ -export declare function instanceOfUnitlessMeasurement(value: object): boolean; +export declare function instanceOfUnitlessMeasurement(value: object): value is UnitlessMeasurement; export declare function UnitlessMeasurementFromJSON(json: any): UnitlessMeasurement; export declare function UnitlessMeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnitlessMeasurement; -export declare function UnitlessMeasurementToJSON(value?: UnitlessMeasurement | null): any; +export declare function UnitlessMeasurementToJSON(json: any): UnitlessMeasurement; +export declare function UnitlessMeasurementToJSONTyped(value?: UnitlessMeasurement | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UnitlessMeasurement.js b/typescript/dist/esm/models/UnitlessMeasurement.js index df014753..02e5dd3d 100644 --- a/typescript/dist/esm/models/UnitlessMeasurement.js +++ b/typescript/dist/esm/models/UnitlessMeasurement.js @@ -15,37 +15,35 @@ * @export */ export const UnitlessMeasurementTypeEnum = { - Unitless: 'unitless', - Continuous: 'continuous', - Classification: 'classification' + Unitless: 'unitless' }; /** * Check if a given object implements the UnitlessMeasurement interface. */ export function instanceOfUnitlessMeasurement(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function UnitlessMeasurementFromJSON(json) { return UnitlessMeasurementFromJSONTyped(json, false); } export function UnitlessMeasurementFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'type': json['type'], }; } -export function UnitlessMeasurementToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UnitlessMeasurementToJSON(json) { + return UnitlessMeasurementToJSONTyped(json, false); +} +export function UnitlessMeasurementToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'type': value.type, + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/UnixTimeStampType.d.ts b/typescript/dist/esm/models/UnixTimeStampType.d.ts index 60a36181..72201b6f 100644 --- a/typescript/dist/esm/models/UnixTimeStampType.d.ts +++ b/typescript/dist/esm/models/UnixTimeStampType.d.ts @@ -18,6 +18,8 @@ export declare const UnixTimeStampType: { readonly EpochMilliseconds: "epochMilliseconds"; }; export type UnixTimeStampType = typeof UnixTimeStampType[keyof typeof UnixTimeStampType]; +export declare function instanceOfUnixTimeStampType(value: any): boolean; export declare function UnixTimeStampTypeFromJSON(json: any): UnixTimeStampType; export declare function UnixTimeStampTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnixTimeStampType; export declare function UnixTimeStampTypeToJSON(value?: UnixTimeStampType | null): any; +export declare function UnixTimeStampTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): UnixTimeStampType; diff --git a/typescript/dist/esm/models/UnixTimeStampType.js b/typescript/dist/esm/models/UnixTimeStampType.js index aea766be..8a9147b8 100644 --- a/typescript/dist/esm/models/UnixTimeStampType.js +++ b/typescript/dist/esm/models/UnixTimeStampType.js @@ -19,6 +19,16 @@ export const UnixTimeStampType = { EpochSeconds: 'epochSeconds', EpochMilliseconds: 'epochMilliseconds' }; +export function instanceOfUnixTimeStampType(value) { + for (const key in UnixTimeStampType) { + if (Object.prototype.hasOwnProperty.call(UnixTimeStampType, key)) { + if (UnixTimeStampType[key] === value) { + return true; + } + } + } + return false; +} export function UnixTimeStampTypeFromJSON(json) { return UnixTimeStampTypeFromJSONTyped(json, false); } @@ -28,3 +38,6 @@ export function UnixTimeStampTypeFromJSONTyped(json, ignoreDiscriminator) { export function UnixTimeStampTypeToJSON(value) { return value; } +export function UnixTimeStampTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/UpdateDataset.d.ts b/typescript/dist/esm/models/UpdateDataset.d.ts index 5b25bb01..4199c6dc 100644 --- a/typescript/dist/esm/models/UpdateDataset.d.ts +++ b/typescript/dist/esm/models/UpdateDataset.d.ts @@ -43,7 +43,8 @@ export interface UpdateDataset { /** * Check if a given object implements the UpdateDataset interface. */ -export declare function instanceOfUpdateDataset(value: object): boolean; +export declare function instanceOfUpdateDataset(value: object): value is UpdateDataset; export declare function UpdateDatasetFromJSON(json: any): UpdateDataset; export declare function UpdateDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateDataset; -export declare function UpdateDatasetToJSON(value?: UpdateDataset | null): any; +export declare function UpdateDatasetToJSON(json: any): UpdateDataset; +export declare function UpdateDatasetToJSONTyped(value?: UpdateDataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UpdateDataset.js b/typescript/dist/esm/models/UpdateDataset.js index 28fd7b3b..cfb8d97d 100644 --- a/typescript/dist/esm/models/UpdateDataset.js +++ b/typescript/dist/esm/models/UpdateDataset.js @@ -15,18 +15,21 @@ * Check if a given object implements the UpdateDataset interface. */ export function instanceOfUpdateDataset(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "tags" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('tags' in value) || value['tags'] === undefined) + return false; + return true; } export function UpdateDatasetFromJSON(json) { return UpdateDatasetFromJSONTyped(json, false); } export function UpdateDatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -36,17 +39,17 @@ export function UpdateDatasetFromJSONTyped(json, ignoreDiscriminator) { 'tags': json['tags'], }; } -export function UpdateDatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UpdateDatasetToJSON(json) { + return UpdateDatasetToJSONTyped(json, false); +} +export function UpdateDatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'display_name': value.displayName, - 'name': value.name, - 'tags': value.tags, + 'description': value['description'], + 'display_name': value['displayName'], + 'name': value['name'], + 'tags': value['tags'], }; } diff --git a/typescript/dist/esm/models/UpdateLayer.d.ts b/typescript/dist/esm/models/UpdateLayer.d.ts index 6a59ada2..978b8f76 100644 --- a/typescript/dist/esm/models/UpdateLayer.d.ts +++ b/typescript/dist/esm/models/UpdateLayer.d.ts @@ -59,7 +59,8 @@ export interface UpdateLayer { /** * Check if a given object implements the UpdateLayer interface. */ -export declare function instanceOfUpdateLayer(value: object): boolean; +export declare function instanceOfUpdateLayer(value: object): value is UpdateLayer; export declare function UpdateLayerFromJSON(json: any): UpdateLayer; export declare function UpdateLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateLayer; -export declare function UpdateLayerToJSON(value?: UpdateLayer | null): any; +export declare function UpdateLayerToJSON(json: any): UpdateLayer; +export declare function UpdateLayerToJSONTyped(value?: UpdateLayer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UpdateLayer.js b/typescript/dist/esm/models/UpdateLayer.js index ec239ac8..6d869b5d 100644 --- a/typescript/dist/esm/models/UpdateLayer.js +++ b/typescript/dist/esm/models/UpdateLayer.js @@ -11,48 +11,49 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { SymbologyFromJSON, SymbologyToJSON, } from './Symbology'; import { WorkflowFromJSON, WorkflowToJSON, } from './Workflow'; /** * Check if a given object implements the UpdateLayer interface. */ export function instanceOfUpdateLayer(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('workflow' in value) || value['workflow'] === undefined) + return false; + return true; } export function UpdateLayerFromJSON(json) { return UpdateLayerFromJSONTyped(json, false); } export function UpdateLayerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], - 'metadata': !exists(json, 'metadata') ? undefined : json['metadata'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), + 'properties': json['properties'] == null ? undefined : json['properties'], + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), 'workflow': WorkflowFromJSON(json['workflow']), }; } -export function UpdateLayerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UpdateLayerToJSON(json) { + return UpdateLayerToJSONTyped(json, false); +} +export function UpdateLayerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'metadata': value.metadata, - 'name': value.name, - 'properties': value.properties, - 'symbology': SymbologyToJSON(value.symbology), - 'workflow': WorkflowToJSON(value.workflow), + 'description': value['description'], + 'metadata': value['metadata'], + 'name': value['name'], + 'properties': value['properties'], + 'symbology': SymbologyToJSON(value['symbology']), + 'workflow': WorkflowToJSON(value['workflow']), }; } diff --git a/typescript/dist/esm/models/UpdateLayerCollection.d.ts b/typescript/dist/esm/models/UpdateLayerCollection.d.ts index 7af58d48..7ffcc3b2 100644 --- a/typescript/dist/esm/models/UpdateLayerCollection.d.ts +++ b/typescript/dist/esm/models/UpdateLayerCollection.d.ts @@ -37,7 +37,8 @@ export interface UpdateLayerCollection { /** * Check if a given object implements the UpdateLayerCollection interface. */ -export declare function instanceOfUpdateLayerCollection(value: object): boolean; +export declare function instanceOfUpdateLayerCollection(value: object): value is UpdateLayerCollection; export declare function UpdateLayerCollectionFromJSON(json: any): UpdateLayerCollection; export declare function UpdateLayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateLayerCollection; -export declare function UpdateLayerCollectionToJSON(value?: UpdateLayerCollection | null): any; +export declare function UpdateLayerCollectionToJSON(json: any): UpdateLayerCollection; +export declare function UpdateLayerCollectionToJSONTyped(value?: UpdateLayerCollection | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UpdateLayerCollection.js b/typescript/dist/esm/models/UpdateLayerCollection.js index 7a6bc1bf..e675629b 100644 --- a/typescript/dist/esm/models/UpdateLayerCollection.js +++ b/typescript/dist/esm/models/UpdateLayerCollection.js @@ -11,39 +11,39 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * Check if a given object implements the UpdateLayerCollection interface. */ export function instanceOfUpdateLayerCollection(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } export function UpdateLayerCollectionFromJSON(json) { return UpdateLayerCollectionFromJSONTyped(json, false); } export function UpdateLayerCollectionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], }; } -export function UpdateLayerCollectionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UpdateLayerCollectionToJSON(json) { + return UpdateLayerCollectionToJSONTyped(json, false); +} +export function UpdateLayerCollectionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'name': value.name, - 'properties': value.properties, + 'description': value['description'], + 'name': value['name'], + 'properties': value['properties'], }; } diff --git a/typescript/dist/esm/models/UpdateProject.d.ts b/typescript/dist/esm/models/UpdateProject.d.ts index 011b258b..53a9a8c8 100644 --- a/typescript/dist/esm/models/UpdateProject.d.ts +++ b/typescript/dist/esm/models/UpdateProject.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { LayerUpdate } from './LayerUpdate'; +import type { TimeStep } from './TimeStep'; import type { PlotUpdate } from './PlotUpdate'; import type { STRectangle } from './STRectangle'; -import type { TimeStep } from './TimeStep'; +import type { LayerUpdate } from './LayerUpdate'; /** * * @export @@ -65,7 +65,8 @@ export interface UpdateProject { /** * Check if a given object implements the UpdateProject interface. */ -export declare function instanceOfUpdateProject(value: object): boolean; +export declare function instanceOfUpdateProject(value: object): value is UpdateProject; export declare function UpdateProjectFromJSON(json: any): UpdateProject; export declare function UpdateProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateProject; -export declare function UpdateProjectToJSON(value?: UpdateProject | null): any; +export declare function UpdateProjectToJSON(json: any): UpdateProject; +export declare function UpdateProjectToJSONTyped(value?: UpdateProject | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UpdateProject.js b/typescript/dist/esm/models/UpdateProject.js index b452e058..4b66d697 100644 --- a/typescript/dist/esm/models/UpdateProject.js +++ b/typescript/dist/esm/models/UpdateProject.js @@ -11,50 +11,49 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; -import { LayerUpdateFromJSON, LayerUpdateToJSON, } from './LayerUpdate'; +import { TimeStepFromJSON, TimeStepToJSON, } from './TimeStep'; import { PlotUpdateFromJSON, PlotUpdateToJSON, } from './PlotUpdate'; import { STRectangleFromJSON, STRectangleToJSON, } from './STRectangle'; -import { TimeStepFromJSON, TimeStepToJSON, } from './TimeStep'; +import { LayerUpdateFromJSON, LayerUpdateToJSON, } from './LayerUpdate'; /** * Check if a given object implements the UpdateProject interface. */ export function instanceOfUpdateProject(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + return true; } export function UpdateProjectFromJSON(json) { return UpdateProjectFromJSONTyped(json, false); } export function UpdateProjectFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bounds': !exists(json, 'bounds') ? undefined : STRectangleFromJSON(json['bounds']), - 'description': !exists(json, 'description') ? undefined : json['description'], + 'bounds': json['bounds'] == null ? undefined : STRectangleFromJSON(json['bounds']), + 'description': json['description'] == null ? undefined : json['description'], 'id': json['id'], - 'layers': !exists(json, 'layers') ? undefined : (json['layers'] === null ? null : json['layers'].map(LayerUpdateFromJSON)), - 'name': !exists(json, 'name') ? undefined : json['name'], - 'plots': !exists(json, 'plots') ? undefined : (json['plots'] === null ? null : json['plots'].map(PlotUpdateFromJSON)), - 'timeStep': !exists(json, 'timeStep') ? undefined : TimeStepFromJSON(json['timeStep']), + 'layers': json['layers'] == null ? undefined : (json['layers'].map(LayerUpdateFromJSON)), + 'name': json['name'] == null ? undefined : json['name'], + 'plots': json['plots'] == null ? undefined : (json['plots'].map(PlotUpdateFromJSON)), + 'timeStep': json['timeStep'] == null ? undefined : TimeStepFromJSON(json['timeStep']), }; } -export function UpdateProjectToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UpdateProjectToJSON(json) { + return UpdateProjectToJSONTyped(json, false); +} +export function UpdateProjectToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bounds': STRectangleToJSON(value.bounds), - 'description': value.description, - 'id': value.id, - 'layers': value.layers === undefined ? undefined : (value.layers === null ? null : value.layers.map(LayerUpdateToJSON)), - 'name': value.name, - 'plots': value.plots === undefined ? undefined : (value.plots === null ? null : value.plots.map(PlotUpdateToJSON)), - 'timeStep': TimeStepToJSON(value.timeStep), + 'bounds': STRectangleToJSON(value['bounds']), + 'description': value['description'], + 'id': value['id'], + 'layers': value['layers'] == null ? undefined : (value['layers'].map(LayerUpdateToJSON)), + 'name': value['name'], + 'plots': value['plots'] == null ? undefined : (value['plots'].map(PlotUpdateToJSON)), + 'timeStep': TimeStepToJSON(value['timeStep']), }; } diff --git a/typescript/dist/esm/models/UpdateQuota.d.ts b/typescript/dist/esm/models/UpdateQuota.d.ts index fa6a8c7a..070b6ebd 100644 --- a/typescript/dist/esm/models/UpdateQuota.d.ts +++ b/typescript/dist/esm/models/UpdateQuota.d.ts @@ -25,7 +25,8 @@ export interface UpdateQuota { /** * Check if a given object implements the UpdateQuota interface. */ -export declare function instanceOfUpdateQuota(value: object): boolean; +export declare function instanceOfUpdateQuota(value: object): value is UpdateQuota; export declare function UpdateQuotaFromJSON(json: any): UpdateQuota; export declare function UpdateQuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateQuota; -export declare function UpdateQuotaToJSON(value?: UpdateQuota | null): any; +export declare function UpdateQuotaToJSON(json: any): UpdateQuota; +export declare function UpdateQuotaToJSONTyped(value?: UpdateQuota | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UpdateQuota.js b/typescript/dist/esm/models/UpdateQuota.js index d0b96470..ff8241af 100644 --- a/typescript/dist/esm/models/UpdateQuota.js +++ b/typescript/dist/esm/models/UpdateQuota.js @@ -15,29 +15,29 @@ * Check if a given object implements the UpdateQuota interface. */ export function instanceOfUpdateQuota(value) { - let isInstance = true; - isInstance = isInstance && "available" in value; - return isInstance; + if (!('available' in value) || value['available'] === undefined) + return false; + return true; } export function UpdateQuotaFromJSON(json) { return UpdateQuotaFromJSONTyped(json, false); } export function UpdateQuotaFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'available': json['available'], }; } -export function UpdateQuotaToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UpdateQuotaToJSON(json) { + return UpdateQuotaToJSONTyped(json, false); +} +export function UpdateQuotaToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'available': value.available, + 'available': value['available'], }; } diff --git a/typescript/dist/esm/models/UploadFileLayersResponse.d.ts b/typescript/dist/esm/models/UploadFileLayersResponse.d.ts index d0f22470..5e860b7b 100644 --- a/typescript/dist/esm/models/UploadFileLayersResponse.d.ts +++ b/typescript/dist/esm/models/UploadFileLayersResponse.d.ts @@ -25,7 +25,8 @@ export interface UploadFileLayersResponse { /** * Check if a given object implements the UploadFileLayersResponse interface. */ -export declare function instanceOfUploadFileLayersResponse(value: object): boolean; +export declare function instanceOfUploadFileLayersResponse(value: object): value is UploadFileLayersResponse; export declare function UploadFileLayersResponseFromJSON(json: any): UploadFileLayersResponse; export declare function UploadFileLayersResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UploadFileLayersResponse; -export declare function UploadFileLayersResponseToJSON(value?: UploadFileLayersResponse | null): any; +export declare function UploadFileLayersResponseToJSON(json: any): UploadFileLayersResponse; +export declare function UploadFileLayersResponseToJSONTyped(value?: UploadFileLayersResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UploadFileLayersResponse.js b/typescript/dist/esm/models/UploadFileLayersResponse.js index 53977174..e43636fc 100644 --- a/typescript/dist/esm/models/UploadFileLayersResponse.js +++ b/typescript/dist/esm/models/UploadFileLayersResponse.js @@ -15,29 +15,29 @@ * Check if a given object implements the UploadFileLayersResponse interface. */ export function instanceOfUploadFileLayersResponse(value) { - let isInstance = true; - isInstance = isInstance && "layers" in value; - return isInstance; + if (!('layers' in value) || value['layers'] === undefined) + return false; + return true; } export function UploadFileLayersResponseFromJSON(json) { return UploadFileLayersResponseFromJSONTyped(json, false); } export function UploadFileLayersResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'layers': json['layers'], }; } -export function UploadFileLayersResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UploadFileLayersResponseToJSON(json) { + return UploadFileLayersResponseToJSONTyped(json, false); +} +export function UploadFileLayersResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'layers': value.layers, + 'layers': value['layers'], }; } diff --git a/typescript/dist/esm/models/UploadFilesResponse.d.ts b/typescript/dist/esm/models/UploadFilesResponse.d.ts index 73676cfc..a3936387 100644 --- a/typescript/dist/esm/models/UploadFilesResponse.d.ts +++ b/typescript/dist/esm/models/UploadFilesResponse.d.ts @@ -25,7 +25,8 @@ export interface UploadFilesResponse { /** * Check if a given object implements the UploadFilesResponse interface. */ -export declare function instanceOfUploadFilesResponse(value: object): boolean; +export declare function instanceOfUploadFilesResponse(value: object): value is UploadFilesResponse; export declare function UploadFilesResponseFromJSON(json: any): UploadFilesResponse; export declare function UploadFilesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UploadFilesResponse; -export declare function UploadFilesResponseToJSON(value?: UploadFilesResponse | null): any; +export declare function UploadFilesResponseToJSON(json: any): UploadFilesResponse; +export declare function UploadFilesResponseToJSONTyped(value?: UploadFilesResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UploadFilesResponse.js b/typescript/dist/esm/models/UploadFilesResponse.js index 2454620b..95ca7c2f 100644 --- a/typescript/dist/esm/models/UploadFilesResponse.js +++ b/typescript/dist/esm/models/UploadFilesResponse.js @@ -15,29 +15,29 @@ * Check if a given object implements the UploadFilesResponse interface. */ export function instanceOfUploadFilesResponse(value) { - let isInstance = true; - isInstance = isInstance && "files" in value; - return isInstance; + if (!('files' in value) || value['files'] === undefined) + return false; + return true; } export function UploadFilesResponseFromJSON(json) { return UploadFilesResponseFromJSONTyped(json, false); } export function UploadFilesResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'files': json['files'], }; } -export function UploadFilesResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UploadFilesResponseToJSON(json) { + return UploadFilesResponseToJSONTyped(json, false); +} +export function UploadFilesResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'files': value.files, + 'files': value['files'], }; } diff --git a/typescript/dist/esm/models/UsageSummaryGranularity.d.ts b/typescript/dist/esm/models/UsageSummaryGranularity.d.ts index ff762ef8..654be8db 100644 --- a/typescript/dist/esm/models/UsageSummaryGranularity.d.ts +++ b/typescript/dist/esm/models/UsageSummaryGranularity.d.ts @@ -21,6 +21,8 @@ export declare const UsageSummaryGranularity: { readonly Years: "years"; }; export type UsageSummaryGranularity = typeof UsageSummaryGranularity[keyof typeof UsageSummaryGranularity]; +export declare function instanceOfUsageSummaryGranularity(value: any): boolean; export declare function UsageSummaryGranularityFromJSON(json: any): UsageSummaryGranularity; export declare function UsageSummaryGranularityFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsageSummaryGranularity; export declare function UsageSummaryGranularityToJSON(value?: UsageSummaryGranularity | null): any; +export declare function UsageSummaryGranularityToJSONTyped(value: any, ignoreDiscriminator: boolean): UsageSummaryGranularity; diff --git a/typescript/dist/esm/models/UsageSummaryGranularity.js b/typescript/dist/esm/models/UsageSummaryGranularity.js index 8cdbf691..1b411f33 100644 --- a/typescript/dist/esm/models/UsageSummaryGranularity.js +++ b/typescript/dist/esm/models/UsageSummaryGranularity.js @@ -22,6 +22,16 @@ export const UsageSummaryGranularity = { Months: 'months', Years: 'years' }; +export function instanceOfUsageSummaryGranularity(value) { + for (const key in UsageSummaryGranularity) { + if (Object.prototype.hasOwnProperty.call(UsageSummaryGranularity, key)) { + if (UsageSummaryGranularity[key] === value) { + return true; + } + } + } + return false; +} export function UsageSummaryGranularityFromJSON(json) { return UsageSummaryGranularityFromJSONTyped(json, false); } @@ -31,3 +41,6 @@ export function UsageSummaryGranularityFromJSONTyped(json, ignoreDiscriminator) export function UsageSummaryGranularityToJSON(value) { return value; } +export function UsageSummaryGranularityToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/UserCredentials.d.ts b/typescript/dist/esm/models/UserCredentials.d.ts index f1f68f1b..9ba16621 100644 --- a/typescript/dist/esm/models/UserCredentials.d.ts +++ b/typescript/dist/esm/models/UserCredentials.d.ts @@ -31,7 +31,8 @@ export interface UserCredentials { /** * Check if a given object implements the UserCredentials interface. */ -export declare function instanceOfUserCredentials(value: object): boolean; +export declare function instanceOfUserCredentials(value: object): value is UserCredentials; export declare function UserCredentialsFromJSON(json: any): UserCredentials; export declare function UserCredentialsFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserCredentials; -export declare function UserCredentialsToJSON(value?: UserCredentials | null): any; +export declare function UserCredentialsToJSON(json: any): UserCredentials; +export declare function UserCredentialsToJSONTyped(value?: UserCredentials | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UserCredentials.js b/typescript/dist/esm/models/UserCredentials.js index c66be60c..6103e6b7 100644 --- a/typescript/dist/esm/models/UserCredentials.js +++ b/typescript/dist/esm/models/UserCredentials.js @@ -15,16 +15,17 @@ * Check if a given object implements the UserCredentials interface. */ export function instanceOfUserCredentials(value) { - let isInstance = true; - isInstance = isInstance && "email" in value; - isInstance = isInstance && "password" in value; - return isInstance; + if (!('email' in value) || value['email'] === undefined) + return false; + if (!('password' in value) || value['password'] === undefined) + return false; + return true; } export function UserCredentialsFromJSON(json) { return UserCredentialsFromJSONTyped(json, false); } export function UserCredentialsFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -32,15 +33,15 @@ export function UserCredentialsFromJSONTyped(json, ignoreDiscriminator) { 'password': json['password'], }; } -export function UserCredentialsToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserCredentialsToJSON(json) { + return UserCredentialsToJSONTyped(json, false); +} +export function UserCredentialsToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'email': value.email, - 'password': value.password, + 'email': value['email'], + 'password': value['password'], }; } diff --git a/typescript/dist/esm/models/UserInfo.d.ts b/typescript/dist/esm/models/UserInfo.d.ts index 3df6b91f..3e23772e 100644 --- a/typescript/dist/esm/models/UserInfo.d.ts +++ b/typescript/dist/esm/models/UserInfo.d.ts @@ -37,7 +37,8 @@ export interface UserInfo { /** * Check if a given object implements the UserInfo interface. */ -export declare function instanceOfUserInfo(value: object): boolean; +export declare function instanceOfUserInfo(value: object): value is UserInfo; export declare function UserInfoFromJSON(json: any): UserInfo; export declare function UserInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserInfo; -export declare function UserInfoToJSON(value?: UserInfo | null): any; +export declare function UserInfoToJSON(json: any): UserInfo; +export declare function UserInfoToJSONTyped(value?: UserInfo | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UserInfo.js b/typescript/dist/esm/models/UserInfo.js index 6ea55373..cb515dd0 100644 --- a/typescript/dist/esm/models/UserInfo.js +++ b/typescript/dist/esm/models/UserInfo.js @@ -11,38 +11,37 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * Check if a given object implements the UserInfo interface. */ export function instanceOfUserInfo(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + return true; } export function UserInfoFromJSON(json) { return UserInfoFromJSONTyped(json, false); } export function UserInfoFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'email': !exists(json, 'email') ? undefined : json['email'], + 'email': json['email'] == null ? undefined : json['email'], 'id': json['id'], - 'realName': !exists(json, 'realName') ? undefined : json['realName'], + 'realName': json['realName'] == null ? undefined : json['realName'], }; } -export function UserInfoToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserInfoToJSON(json) { + return UserInfoToJSONTyped(json, false); +} +export function UserInfoToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'email': value.email, - 'id': value.id, - 'realName': value.realName, + 'email': value['email'], + 'id': value['id'], + 'realName': value['realName'], }; } diff --git a/typescript/dist/esm/models/UserRegistration.d.ts b/typescript/dist/esm/models/UserRegistration.d.ts index 895ff879..08f44f8e 100644 --- a/typescript/dist/esm/models/UserRegistration.d.ts +++ b/typescript/dist/esm/models/UserRegistration.d.ts @@ -37,7 +37,8 @@ export interface UserRegistration { /** * Check if a given object implements the UserRegistration interface. */ -export declare function instanceOfUserRegistration(value: object): boolean; +export declare function instanceOfUserRegistration(value: object): value is UserRegistration; export declare function UserRegistrationFromJSON(json: any): UserRegistration; export declare function UserRegistrationFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserRegistration; -export declare function UserRegistrationToJSON(value?: UserRegistration | null): any; +export declare function UserRegistrationToJSON(json: any): UserRegistration; +export declare function UserRegistrationToJSONTyped(value?: UserRegistration | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UserRegistration.js b/typescript/dist/esm/models/UserRegistration.js index be3d960f..b4ea9caa 100644 --- a/typescript/dist/esm/models/UserRegistration.js +++ b/typescript/dist/esm/models/UserRegistration.js @@ -15,17 +15,19 @@ * Check if a given object implements the UserRegistration interface. */ export function instanceOfUserRegistration(value) { - let isInstance = true; - isInstance = isInstance && "email" in value; - isInstance = isInstance && "password" in value; - isInstance = isInstance && "realName" in value; - return isInstance; + if (!('email' in value) || value['email'] === undefined) + return false; + if (!('password' in value) || value['password'] === undefined) + return false; + if (!('realName' in value) || value['realName'] === undefined) + return false; + return true; } export function UserRegistrationFromJSON(json) { return UserRegistrationFromJSONTyped(json, false); } export function UserRegistrationFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -34,16 +36,16 @@ export function UserRegistrationFromJSONTyped(json, ignoreDiscriminator) { 'realName': json['realName'], }; } -export function UserRegistrationToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserRegistrationToJSON(json) { + return UserRegistrationToJSONTyped(json, false); +} +export function UserRegistrationToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'email': value.email, - 'password': value.password, - 'realName': value.realName, + 'email': value['email'], + 'password': value['password'], + 'realName': value['realName'], }; } diff --git a/typescript/dist/esm/models/UserSession.d.ts b/typescript/dist/esm/models/UserSession.d.ts index f24076af..17e32e54 100644 --- a/typescript/dist/esm/models/UserSession.d.ts +++ b/typescript/dist/esm/models/UserSession.d.ts @@ -63,7 +63,8 @@ export interface UserSession { /** * Check if a given object implements the UserSession interface. */ -export declare function instanceOfUserSession(value: object): boolean; +export declare function instanceOfUserSession(value: object): value is UserSession; export declare function UserSessionFromJSON(json: any): UserSession; export declare function UserSessionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserSession; -export declare function UserSessionToJSON(value?: UserSession | null): any; +export declare function UserSessionToJSON(json: any): UserSession; +export declare function UserSessionToJSONTyped(value?: UserSession | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/UserSession.js b/typescript/dist/esm/models/UserSession.js index 1a5ec0d7..faa1deed 100644 --- a/typescript/dist/esm/models/UserSession.js +++ b/typescript/dist/esm/models/UserSession.js @@ -11,52 +11,55 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; import { STRectangleFromJSON, STRectangleToJSON, } from './STRectangle'; import { UserInfoFromJSON, UserInfoToJSON, } from './UserInfo'; /** * Check if a given object implements the UserSession interface. */ export function instanceOfUserSession(value) { - let isInstance = true; - isInstance = isInstance && "created" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "roles" in value; - isInstance = isInstance && "user" in value; - isInstance = isInstance && "validUntil" in value; - return isInstance; + if (!('created' in value) || value['created'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('roles' in value) || value['roles'] === undefined) + return false; + if (!('user' in value) || value['user'] === undefined) + return false; + if (!('validUntil' in value) || value['validUntil'] === undefined) + return false; + return true; } export function UserSessionFromJSON(json) { return UserSessionFromJSONTyped(json, false); } export function UserSessionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'created': (new Date(json['created'])), 'id': json['id'], - 'project': !exists(json, 'project') ? undefined : json['project'], + 'project': json['project'] == null ? undefined : json['project'], 'roles': json['roles'], 'user': UserInfoFromJSON(json['user']), 'validUntil': (new Date(json['validUntil'])), - 'view': !exists(json, 'view') ? undefined : STRectangleFromJSON(json['view']), + 'view': json['view'] == null ? undefined : STRectangleFromJSON(json['view']), }; } -export function UserSessionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserSessionToJSON(json) { + return UserSessionToJSONTyped(json, false); +} +export function UserSessionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'created': (value.created.toISOString()), - 'id': value.id, - 'project': value.project, - 'roles': value.roles, - 'user': UserInfoToJSON(value.user), - 'validUntil': (value.validUntil.toISOString()), - 'view': STRectangleToJSON(value.view), + 'created': ((value['created']).toISOString()), + 'id': value['id'], + 'project': value['project'], + 'roles': value['roles'], + 'user': UserInfoToJSON(value['user']), + 'validUntil': ((value['validUntil']).toISOString()), + 'view': STRectangleToJSON(value['view']), }; } diff --git a/typescript/dist/esm/models/VectorColumnInfo.d.ts b/typescript/dist/esm/models/VectorColumnInfo.d.ts index 4a7538d5..02ab0892 100644 --- a/typescript/dist/esm/models/VectorColumnInfo.d.ts +++ b/typescript/dist/esm/models/VectorColumnInfo.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { FeatureDataType } from './FeatureDataType'; import type { Measurement } from './Measurement'; +import type { FeatureDataType } from './FeatureDataType'; /** * * @export @@ -33,7 +33,8 @@ export interface VectorColumnInfo { /** * Check if a given object implements the VectorColumnInfo interface. */ -export declare function instanceOfVectorColumnInfo(value: object): boolean; +export declare function instanceOfVectorColumnInfo(value: object): value is VectorColumnInfo; export declare function VectorColumnInfoFromJSON(json: any): VectorColumnInfo; export declare function VectorColumnInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): VectorColumnInfo; -export declare function VectorColumnInfoToJSON(value?: VectorColumnInfo | null): any; +export declare function VectorColumnInfoToJSON(json: any): VectorColumnInfo; +export declare function VectorColumnInfoToJSONTyped(value?: VectorColumnInfo | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/VectorColumnInfo.js b/typescript/dist/esm/models/VectorColumnInfo.js index 6dd5344f..93bb72f4 100644 --- a/typescript/dist/esm/models/VectorColumnInfo.js +++ b/typescript/dist/esm/models/VectorColumnInfo.js @@ -11,22 +11,23 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { FeatureDataTypeFromJSON, FeatureDataTypeToJSON, } from './FeatureDataType'; import { MeasurementFromJSON, MeasurementToJSON, } from './Measurement'; +import { FeatureDataTypeFromJSON, FeatureDataTypeToJSON, } from './FeatureDataType'; /** * Check if a given object implements the VectorColumnInfo interface. */ export function instanceOfVectorColumnInfo(value) { - let isInstance = true; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "measurement" in value; - return isInstance; + if (!('dataType' in value) || value['dataType'] === undefined) + return false; + if (!('measurement' in value) || value['measurement'] === undefined) + return false; + return true; } export function VectorColumnInfoFromJSON(json) { return VectorColumnInfoFromJSONTyped(json, false); } export function VectorColumnInfoFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -34,15 +35,15 @@ export function VectorColumnInfoFromJSONTyped(json, ignoreDiscriminator) { 'measurement': MeasurementFromJSON(json['measurement']), }; } -export function VectorColumnInfoToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function VectorColumnInfoToJSON(json) { + return VectorColumnInfoToJSONTyped(json, false); +} +export function VectorColumnInfoToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'dataType': FeatureDataTypeToJSON(value.dataType), - 'measurement': MeasurementToJSON(value.measurement), + 'dataType': FeatureDataTypeToJSON(value['dataType']), + 'measurement': MeasurementToJSON(value['measurement']), }; } diff --git a/typescript/dist/esm/models/VectorDataType.d.ts b/typescript/dist/esm/models/VectorDataType.d.ts index 90d65659..f3ce8f10 100644 --- a/typescript/dist/esm/models/VectorDataType.d.ts +++ b/typescript/dist/esm/models/VectorDataType.d.ts @@ -20,6 +20,8 @@ export declare const VectorDataType: { readonly MultiPolygon: "MultiPolygon"; }; export type VectorDataType = typeof VectorDataType[keyof typeof VectorDataType]; +export declare function instanceOfVectorDataType(value: any): boolean; export declare function VectorDataTypeFromJSON(json: any): VectorDataType; export declare function VectorDataTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): VectorDataType; export declare function VectorDataTypeToJSON(value?: VectorDataType | null): any; +export declare function VectorDataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): VectorDataType; diff --git a/typescript/dist/esm/models/VectorDataType.js b/typescript/dist/esm/models/VectorDataType.js index 3748e3f6..c8e482f2 100644 --- a/typescript/dist/esm/models/VectorDataType.js +++ b/typescript/dist/esm/models/VectorDataType.js @@ -21,6 +21,16 @@ export const VectorDataType = { MultiLineString: 'MultiLineString', MultiPolygon: 'MultiPolygon' }; +export function instanceOfVectorDataType(value) { + for (const key in VectorDataType) { + if (Object.prototype.hasOwnProperty.call(VectorDataType, key)) { + if (VectorDataType[key] === value) { + return true; + } + } + } + return false; +} export function VectorDataTypeFromJSON(json) { return VectorDataTypeFromJSONTyped(json, false); } @@ -30,3 +40,6 @@ export function VectorDataTypeFromJSONTyped(json, ignoreDiscriminator) { export function VectorDataTypeToJSON(value) { return value; } +export function VectorDataTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/VectorQueryRectangle.d.ts b/typescript/dist/esm/models/VectorQueryRectangle.d.ts index d2cb9126..6b878b63 100644 --- a/typescript/dist/esm/models/VectorQueryRectangle.d.ts +++ b/typescript/dist/esm/models/VectorQueryRectangle.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; import type { SpatialResolution } from './SpatialResolution'; import type { TimeInterval } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * A spatio-temporal rectangle with a specified resolution * @export @@ -40,7 +40,8 @@ export interface VectorQueryRectangle { /** * Check if a given object implements the VectorQueryRectangle interface. */ -export declare function instanceOfVectorQueryRectangle(value: object): boolean; +export declare function instanceOfVectorQueryRectangle(value: object): value is VectorQueryRectangle; export declare function VectorQueryRectangleFromJSON(json: any): VectorQueryRectangle; export declare function VectorQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): VectorQueryRectangle; -export declare function VectorQueryRectangleToJSON(value?: VectorQueryRectangle | null): any; +export declare function VectorQueryRectangleToJSON(json: any): VectorQueryRectangle; +export declare function VectorQueryRectangleToJSONTyped(value?: VectorQueryRectangle | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/VectorQueryRectangle.js b/typescript/dist/esm/models/VectorQueryRectangle.js index 1cfddbeb..9ff2114b 100644 --- a/typescript/dist/esm/models/VectorQueryRectangle.js +++ b/typescript/dist/esm/models/VectorQueryRectangle.js @@ -11,24 +11,26 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; import { SpatialResolutionFromJSON, SpatialResolutionToJSON, } from './SpatialResolution'; import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; +import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; /** * Check if a given object implements the VectorQueryRectangle interface. */ export function instanceOfVectorQueryRectangle(value) { - let isInstance = true; - isInstance = isInstance && "spatialBounds" in value; - isInstance = isInstance && "spatialResolution" in value; - isInstance = isInstance && "timeInterval" in value; - return isInstance; + if (!('spatialBounds' in value) || value['spatialBounds'] === undefined) + return false; + if (!('spatialResolution' in value) || value['spatialResolution'] === undefined) + return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) + return false; + return true; } export function VectorQueryRectangleFromJSON(json) { return VectorQueryRectangleFromJSONTyped(json, false); } export function VectorQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,16 +39,16 @@ export function VectorQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { 'timeInterval': TimeIntervalFromJSON(json['timeInterval']), }; } -export function VectorQueryRectangleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function VectorQueryRectangleToJSON(json) { + return VectorQueryRectangleToJSONTyped(json, false); +} +export function VectorQueryRectangleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'spatialBounds': BoundingBox2DToJSON(value.spatialBounds), - 'spatialResolution': SpatialResolutionToJSON(value.spatialResolution), - 'timeInterval': TimeIntervalToJSON(value.timeInterval), + 'spatialBounds': BoundingBox2DToJSON(value['spatialBounds']), + 'spatialResolution': SpatialResolutionToJSON(value['spatialResolution']), + 'timeInterval': TimeIntervalToJSON(value['timeInterval']), }; } diff --git a/typescript/dist/esm/models/VectorResultDescriptor.d.ts b/typescript/dist/esm/models/VectorResultDescriptor.d.ts index 4170742f..65071ac9 100644 --- a/typescript/dist/esm/models/VectorResultDescriptor.d.ts +++ b/typescript/dist/esm/models/VectorResultDescriptor.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; +import type { VectorDataType } from './VectorDataType'; import type { TimeInterval } from './TimeInterval'; import type { VectorColumnInfo } from './VectorColumnInfo'; -import type { VectorDataType } from './VectorDataType'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * * @export @@ -55,7 +55,8 @@ export interface VectorResultDescriptor { /** * Check if a given object implements the VectorResultDescriptor interface. */ -export declare function instanceOfVectorResultDescriptor(value: object): boolean; +export declare function instanceOfVectorResultDescriptor(value: object): value is VectorResultDescriptor; export declare function VectorResultDescriptorFromJSON(json: any): VectorResultDescriptor; export declare function VectorResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): VectorResultDescriptor; -export declare function VectorResultDescriptorToJSON(value?: VectorResultDescriptor | null): any; +export declare function VectorResultDescriptorToJSON(json: any): VectorResultDescriptor; +export declare function VectorResultDescriptorToJSONTyped(value?: VectorResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/VectorResultDescriptor.js b/typescript/dist/esm/models/VectorResultDescriptor.js index c42e3459..7f97a4cd 100644 --- a/typescript/dist/esm/models/VectorResultDescriptor.js +++ b/typescript/dist/esm/models/VectorResultDescriptor.js @@ -11,48 +11,50 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; +import { mapValues } from '../runtime'; +import { VectorDataTypeFromJSON, VectorDataTypeToJSON, } from './VectorDataType'; import { TimeIntervalFromJSON, TimeIntervalToJSON, } from './TimeInterval'; import { VectorColumnInfoFromJSON, VectorColumnInfoToJSON, } from './VectorColumnInfo'; -import { VectorDataTypeFromJSON, VectorDataTypeToJSON, } from './VectorDataType'; +import { BoundingBox2DFromJSON, BoundingBox2DToJSON, } from './BoundingBox2D'; /** * Check if a given object implements the VectorResultDescriptor interface. */ export function instanceOfVectorResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "columns" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - return isInstance; + if (!('columns' in value) || value['columns'] === undefined) + return false; + if (!('dataType' in value) || value['dataType'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + return true; } export function VectorResultDescriptorFromJSON(json) { return VectorResultDescriptorFromJSONTyped(json, false); } export function VectorResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !exists(json, 'bbox') ? undefined : BoundingBox2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : BoundingBox2DFromJSON(json['bbox']), 'columns': (mapValues(json['columns'], VectorColumnInfoFromJSON)), 'dataType': VectorDataTypeFromJSON(json['dataType']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), }; } -export function VectorResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function VectorResultDescriptorToJSON(json) { + return VectorResultDescriptorToJSONTyped(json, false); +} +export function VectorResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bbox': BoundingBox2DToJSON(value.bbox), - 'columns': (mapValues(value.columns, VectorColumnInfoToJSON)), - 'dataType': VectorDataTypeToJSON(value.dataType), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), + 'bbox': BoundingBox2DToJSON(value['bbox']), + 'columns': (mapValues(value['columns'], VectorColumnInfoToJSON)), + 'dataType': VectorDataTypeToJSON(value['dataType']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), }; } diff --git a/typescript/dist/esm/models/Volume.d.ts b/typescript/dist/esm/models/Volume.d.ts index 597f4625..c17f17f7 100644 --- a/typescript/dist/esm/models/Volume.d.ts +++ b/typescript/dist/esm/models/Volume.d.ts @@ -31,7 +31,8 @@ export interface Volume { /** * Check if a given object implements the Volume interface. */ -export declare function instanceOfVolume(value: object): boolean; +export declare function instanceOfVolume(value: object): value is Volume; export declare function VolumeFromJSON(json: any): Volume; export declare function VolumeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Volume; -export declare function VolumeToJSON(value?: Volume | null): any; +export declare function VolumeToJSON(json: any): Volume; +export declare function VolumeToJSONTyped(value?: Volume | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Volume.js b/typescript/dist/esm/models/Volume.js index c1c7cca1..83c61d0b 100644 --- a/typescript/dist/esm/models/Volume.js +++ b/typescript/dist/esm/models/Volume.js @@ -11,36 +11,35 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * Check if a given object implements the Volume interface. */ export function instanceOfVolume(value) { - let isInstance = true; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } export function VolumeFromJSON(json) { return VolumeFromJSONTyped(json, false); } export function VolumeFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'name': json['name'], - 'path': !exists(json, 'path') ? undefined : json['path'], + 'path': json['path'] == null ? undefined : json['path'], }; } -export function VolumeToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function VolumeToJSON(json) { + return VolumeToJSONTyped(json, false); +} +export function VolumeToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'name': value.name, - 'path': value.path, + 'name': value['name'], + 'path': value['path'], }; } diff --git a/typescript/dist/esm/models/VolumeFileLayersResponse.d.ts b/typescript/dist/esm/models/VolumeFileLayersResponse.d.ts index 77be37b3..d1e97fc9 100644 --- a/typescript/dist/esm/models/VolumeFileLayersResponse.d.ts +++ b/typescript/dist/esm/models/VolumeFileLayersResponse.d.ts @@ -25,7 +25,8 @@ export interface VolumeFileLayersResponse { /** * Check if a given object implements the VolumeFileLayersResponse interface. */ -export declare function instanceOfVolumeFileLayersResponse(value: object): boolean; +export declare function instanceOfVolumeFileLayersResponse(value: object): value is VolumeFileLayersResponse; export declare function VolumeFileLayersResponseFromJSON(json: any): VolumeFileLayersResponse; export declare function VolumeFileLayersResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): VolumeFileLayersResponse; -export declare function VolumeFileLayersResponseToJSON(value?: VolumeFileLayersResponse | null): any; +export declare function VolumeFileLayersResponseToJSON(json: any): VolumeFileLayersResponse; +export declare function VolumeFileLayersResponseToJSONTyped(value?: VolumeFileLayersResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/VolumeFileLayersResponse.js b/typescript/dist/esm/models/VolumeFileLayersResponse.js index 9854bff6..87b9a190 100644 --- a/typescript/dist/esm/models/VolumeFileLayersResponse.js +++ b/typescript/dist/esm/models/VolumeFileLayersResponse.js @@ -15,29 +15,29 @@ * Check if a given object implements the VolumeFileLayersResponse interface. */ export function instanceOfVolumeFileLayersResponse(value) { - let isInstance = true; - isInstance = isInstance && "layers" in value; - return isInstance; + if (!('layers' in value) || value['layers'] === undefined) + return false; + return true; } export function VolumeFileLayersResponseFromJSON(json) { return VolumeFileLayersResponseFromJSONTyped(json, false); } export function VolumeFileLayersResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'layers': json['layers'], }; } -export function VolumeFileLayersResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function VolumeFileLayersResponseToJSON(json) { + return VolumeFileLayersResponseToJSONTyped(json, false); +} +export function VolumeFileLayersResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'layers': value.layers, + 'layers': value['layers'], }; } diff --git a/typescript/dist/esm/models/WcsBoundingbox.d.ts b/typescript/dist/esm/models/WcsBoundingbox.d.ts index 3ddd2f6e..9967f822 100644 --- a/typescript/dist/esm/models/WcsBoundingbox.d.ts +++ b/typescript/dist/esm/models/WcsBoundingbox.d.ts @@ -31,7 +31,8 @@ export interface WcsBoundingbox { /** * Check if a given object implements the WcsBoundingbox interface. */ -export declare function instanceOfWcsBoundingbox(value: object): boolean; +export declare function instanceOfWcsBoundingbox(value: object): value is WcsBoundingbox; export declare function WcsBoundingboxFromJSON(json: any): WcsBoundingbox; export declare function WcsBoundingboxFromJSONTyped(json: any, ignoreDiscriminator: boolean): WcsBoundingbox; -export declare function WcsBoundingboxToJSON(value?: WcsBoundingbox | null): any; +export declare function WcsBoundingboxToJSON(json: any): WcsBoundingbox; +export declare function WcsBoundingboxToJSONTyped(value?: WcsBoundingbox | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/WcsBoundingbox.js b/typescript/dist/esm/models/WcsBoundingbox.js index 9377c8d0..efcc97d0 100644 --- a/typescript/dist/esm/models/WcsBoundingbox.js +++ b/typescript/dist/esm/models/WcsBoundingbox.js @@ -11,36 +11,35 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * Check if a given object implements the WcsBoundingbox interface. */ export function instanceOfWcsBoundingbox(value) { - let isInstance = true; - isInstance = isInstance && "bbox" in value; - return isInstance; + if (!('bbox' in value) || value['bbox'] === undefined) + return false; + return true; } export function WcsBoundingboxFromJSON(json) { return WcsBoundingboxFromJSONTyped(json, false); } export function WcsBoundingboxFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bbox': json['bbox'], - 'spatialReference': !exists(json, 'spatial_reference') ? undefined : json['spatial_reference'], + 'spatialReference': json['spatial_reference'] == null ? undefined : json['spatial_reference'], }; } -export function WcsBoundingboxToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function WcsBoundingboxToJSON(json) { + return WcsBoundingboxToJSONTyped(json, false); +} +export function WcsBoundingboxToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bbox': value.bbox, - 'spatial_reference': value.spatialReference, + 'bbox': value['bbox'], + 'spatial_reference': value['spatialReference'], }; } diff --git a/typescript/dist/esm/models/WcsService.d.ts b/typescript/dist/esm/models/WcsService.d.ts index 3893f5d8..399c7a2e 100644 --- a/typescript/dist/esm/models/WcsService.d.ts +++ b/typescript/dist/esm/models/WcsService.d.ts @@ -17,6 +17,8 @@ export declare const WcsService: { readonly Wcs: "WCS"; }; export type WcsService = typeof WcsService[keyof typeof WcsService]; +export declare function instanceOfWcsService(value: any): boolean; export declare function WcsServiceFromJSON(json: any): WcsService; export declare function WcsServiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): WcsService; export declare function WcsServiceToJSON(value?: WcsService | null): any; +export declare function WcsServiceToJSONTyped(value: any, ignoreDiscriminator: boolean): WcsService; diff --git a/typescript/dist/esm/models/WcsService.js b/typescript/dist/esm/models/WcsService.js index 1a4effb7..7d4b7970 100644 --- a/typescript/dist/esm/models/WcsService.js +++ b/typescript/dist/esm/models/WcsService.js @@ -18,6 +18,16 @@ export const WcsService = { Wcs: 'WCS' }; +export function instanceOfWcsService(value) { + for (const key in WcsService) { + if (Object.prototype.hasOwnProperty.call(WcsService, key)) { + if (WcsService[key] === value) { + return true; + } + } + } + return false; +} export function WcsServiceFromJSON(json) { return WcsServiceFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function WcsServiceFromJSONTyped(json, ignoreDiscriminator) { export function WcsServiceToJSON(value) { return value; } +export function WcsServiceToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/WcsVersion.d.ts b/typescript/dist/esm/models/WcsVersion.d.ts index de362b0f..3b172fe5 100644 --- a/typescript/dist/esm/models/WcsVersion.d.ts +++ b/typescript/dist/esm/models/WcsVersion.d.ts @@ -14,10 +14,12 @@ * @export */ export declare const WcsVersion: { - readonly _0: "1.1.0"; - readonly _1: "1.1.1"; + readonly _110: "1.1.0"; + readonly _111: "1.1.1"; }; export type WcsVersion = typeof WcsVersion[keyof typeof WcsVersion]; +export declare function instanceOfWcsVersion(value: any): boolean; export declare function WcsVersionFromJSON(json: any): WcsVersion; export declare function WcsVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): WcsVersion; export declare function WcsVersionToJSON(value?: WcsVersion | null): any; +export declare function WcsVersionToJSONTyped(value: any, ignoreDiscriminator: boolean): WcsVersion; diff --git a/typescript/dist/esm/models/WcsVersion.js b/typescript/dist/esm/models/WcsVersion.js index eeb24d93..e59c4c0a 100644 --- a/typescript/dist/esm/models/WcsVersion.js +++ b/typescript/dist/esm/models/WcsVersion.js @@ -16,9 +16,19 @@ * @export */ export const WcsVersion = { - _0: '1.1.0', - _1: '1.1.1' + _110: '1.1.0', + _111: '1.1.1' }; +export function instanceOfWcsVersion(value) { + for (const key in WcsVersion) { + if (Object.prototype.hasOwnProperty.call(WcsVersion, key)) { + if (WcsVersion[key] === value) { + return true; + } + } + } + return false; +} export function WcsVersionFromJSON(json) { return WcsVersionFromJSONTyped(json, false); } @@ -28,3 +38,6 @@ export function WcsVersionFromJSONTyped(json, ignoreDiscriminator) { export function WcsVersionToJSON(value) { return value; } +export function WcsVersionToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/WfsService.d.ts b/typescript/dist/esm/models/WfsService.d.ts index 9f8070d3..a503050f 100644 --- a/typescript/dist/esm/models/WfsService.d.ts +++ b/typescript/dist/esm/models/WfsService.d.ts @@ -17,6 +17,8 @@ export declare const WfsService: { readonly Wfs: "WFS"; }; export type WfsService = typeof WfsService[keyof typeof WfsService]; +export declare function instanceOfWfsService(value: any): boolean; export declare function WfsServiceFromJSON(json: any): WfsService; export declare function WfsServiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): WfsService; export declare function WfsServiceToJSON(value?: WfsService | null): any; +export declare function WfsServiceToJSONTyped(value: any, ignoreDiscriminator: boolean): WfsService; diff --git a/typescript/dist/esm/models/WfsService.js b/typescript/dist/esm/models/WfsService.js index b70ea424..8d746212 100644 --- a/typescript/dist/esm/models/WfsService.js +++ b/typescript/dist/esm/models/WfsService.js @@ -18,6 +18,16 @@ export const WfsService = { Wfs: 'WFS' }; +export function instanceOfWfsService(value) { + for (const key in WfsService) { + if (Object.prototype.hasOwnProperty.call(WfsService, key)) { + if (WfsService[key] === value) { + return true; + } + } + } + return false; +} export function WfsServiceFromJSON(json) { return WfsServiceFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function WfsServiceFromJSONTyped(json, ignoreDiscriminator) { export function WfsServiceToJSON(value) { return value; } +export function WfsServiceToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/WfsVersion.d.ts b/typescript/dist/esm/models/WfsVersion.d.ts index 9d1d2e9f..2291a77a 100644 --- a/typescript/dist/esm/models/WfsVersion.d.ts +++ b/typescript/dist/esm/models/WfsVersion.d.ts @@ -17,6 +17,8 @@ export declare const WfsVersion: { readonly _200: "2.0.0"; }; export type WfsVersion = typeof WfsVersion[keyof typeof WfsVersion]; +export declare function instanceOfWfsVersion(value: any): boolean; export declare function WfsVersionFromJSON(json: any): WfsVersion; export declare function WfsVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): WfsVersion; export declare function WfsVersionToJSON(value?: WfsVersion | null): any; +export declare function WfsVersionToJSONTyped(value: any, ignoreDiscriminator: boolean): WfsVersion; diff --git a/typescript/dist/esm/models/WfsVersion.js b/typescript/dist/esm/models/WfsVersion.js index c193ec29..9ee11e03 100644 --- a/typescript/dist/esm/models/WfsVersion.js +++ b/typescript/dist/esm/models/WfsVersion.js @@ -18,6 +18,16 @@ export const WfsVersion = { _200: '2.0.0' }; +export function instanceOfWfsVersion(value) { + for (const key in WfsVersion) { + if (Object.prototype.hasOwnProperty.call(WfsVersion, key)) { + if (WfsVersion[key] === value) { + return true; + } + } + } + return false; +} export function WfsVersionFromJSON(json) { return WfsVersionFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function WfsVersionFromJSONTyped(json, ignoreDiscriminator) { export function WfsVersionToJSON(value) { return value; } +export function WfsVersionToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/WmsService.d.ts b/typescript/dist/esm/models/WmsService.d.ts index 8038d8f6..dfc2b3db 100644 --- a/typescript/dist/esm/models/WmsService.d.ts +++ b/typescript/dist/esm/models/WmsService.d.ts @@ -17,6 +17,8 @@ export declare const WmsService: { readonly Wms: "WMS"; }; export type WmsService = typeof WmsService[keyof typeof WmsService]; +export declare function instanceOfWmsService(value: any): boolean; export declare function WmsServiceFromJSON(json: any): WmsService; export declare function WmsServiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): WmsService; export declare function WmsServiceToJSON(value?: WmsService | null): any; +export declare function WmsServiceToJSONTyped(value: any, ignoreDiscriminator: boolean): WmsService; diff --git a/typescript/dist/esm/models/WmsService.js b/typescript/dist/esm/models/WmsService.js index fc337bff..6c6776ac 100644 --- a/typescript/dist/esm/models/WmsService.js +++ b/typescript/dist/esm/models/WmsService.js @@ -18,6 +18,16 @@ export const WmsService = { Wms: 'WMS' }; +export function instanceOfWmsService(value) { + for (const key in WmsService) { + if (Object.prototype.hasOwnProperty.call(WmsService, key)) { + if (WmsService[key] === value) { + return true; + } + } + } + return false; +} export function WmsServiceFromJSON(json) { return WmsServiceFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function WmsServiceFromJSONTyped(json, ignoreDiscriminator) { export function WmsServiceToJSON(value) { return value; } +export function WmsServiceToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/WmsVersion.d.ts b/typescript/dist/esm/models/WmsVersion.d.ts index b30c4c79..06f9bdc8 100644 --- a/typescript/dist/esm/models/WmsVersion.d.ts +++ b/typescript/dist/esm/models/WmsVersion.d.ts @@ -17,6 +17,8 @@ export declare const WmsVersion: { readonly _130: "1.3.0"; }; export type WmsVersion = typeof WmsVersion[keyof typeof WmsVersion]; +export declare function instanceOfWmsVersion(value: any): boolean; export declare function WmsVersionFromJSON(json: any): WmsVersion; export declare function WmsVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): WmsVersion; export declare function WmsVersionToJSON(value?: WmsVersion | null): any; +export declare function WmsVersionToJSONTyped(value: any, ignoreDiscriminator: boolean): WmsVersion; diff --git a/typescript/dist/esm/models/WmsVersion.js b/typescript/dist/esm/models/WmsVersion.js index a5c90307..d6c78528 100644 --- a/typescript/dist/esm/models/WmsVersion.js +++ b/typescript/dist/esm/models/WmsVersion.js @@ -18,6 +18,16 @@ export const WmsVersion = { _130: '1.3.0' }; +export function instanceOfWmsVersion(value) { + for (const key in WmsVersion) { + if (Object.prototype.hasOwnProperty.call(WmsVersion, key)) { + if (WmsVersion[key] === value) { + return true; + } + } + } + return false; +} export function WmsVersionFromJSON(json) { return WmsVersionFromJSONTyped(json, false); } @@ -27,3 +37,6 @@ export function WmsVersionFromJSONTyped(json, ignoreDiscriminator) { export function WmsVersionToJSON(value) { return value; } +export function WmsVersionToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/esm/models/Workflow.d.ts b/typescript/dist/esm/models/Workflow.d.ts index 277ea139..8b12f05d 100644 --- a/typescript/dist/esm/models/Workflow.d.ts +++ b/typescript/dist/esm/models/Workflow.d.ts @@ -41,7 +41,8 @@ export type WorkflowTypeEnum = typeof WorkflowTypeEnum[keyof typeof WorkflowType /** * Check if a given object implements the Workflow interface. */ -export declare function instanceOfWorkflow(value: object): boolean; +export declare function instanceOfWorkflow(value: object): value is Workflow; export declare function WorkflowFromJSON(json: any): Workflow; export declare function WorkflowFromJSONTyped(json: any, ignoreDiscriminator: boolean): Workflow; -export declare function WorkflowToJSON(value?: Workflow | null): any; +export declare function WorkflowToJSON(json: any): Workflow; +export declare function WorkflowToJSONTyped(value?: Workflow | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/Workflow.js b/typescript/dist/esm/models/Workflow.js index b7bfe51e..d5e4bbc0 100644 --- a/typescript/dist/esm/models/Workflow.js +++ b/typescript/dist/esm/models/Workflow.js @@ -24,16 +24,17 @@ export const WorkflowTypeEnum = { * Check if a given object implements the Workflow interface. */ export function instanceOfWorkflow(value) { - let isInstance = true; - isInstance = isInstance && "operator" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('operator' in value) || value['operator'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } export function WorkflowFromJSON(json) { return WorkflowFromJSONTyped(json, false); } export function WorkflowFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,15 +42,15 @@ export function WorkflowFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -export function WorkflowToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function WorkflowToJSON(json) { + return WorkflowToJSONTyped(json, false); +} +export function WorkflowToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'operator': TypedOperatorOperatorToJSON(value.operator), - 'type': value.type, + 'operator': TypedOperatorOperatorToJSON(value['operator']), + 'type': value['type'], }; } diff --git a/typescript/dist/esm/models/WrappedPlotOutput.d.ts b/typescript/dist/esm/models/WrappedPlotOutput.d.ts index b5295159..59b5c0e7 100644 --- a/typescript/dist/esm/models/WrappedPlotOutput.d.ts +++ b/typescript/dist/esm/models/WrappedPlotOutput.d.ts @@ -38,7 +38,8 @@ export interface WrappedPlotOutput { /** * Check if a given object implements the WrappedPlotOutput interface. */ -export declare function instanceOfWrappedPlotOutput(value: object): boolean; +export declare function instanceOfWrappedPlotOutput(value: object): value is WrappedPlotOutput; export declare function WrappedPlotOutputFromJSON(json: any): WrappedPlotOutput; export declare function WrappedPlotOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): WrappedPlotOutput; -export declare function WrappedPlotOutputToJSON(value?: WrappedPlotOutput | null): any; +export declare function WrappedPlotOutputToJSON(json: any): WrappedPlotOutput; +export declare function WrappedPlotOutputToJSONTyped(value?: WrappedPlotOutput | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/esm/models/WrappedPlotOutput.js b/typescript/dist/esm/models/WrappedPlotOutput.js index d3886137..e9bc9548 100644 --- a/typescript/dist/esm/models/WrappedPlotOutput.js +++ b/typescript/dist/esm/models/WrappedPlotOutput.js @@ -16,17 +16,19 @@ import { PlotOutputFormatFromJSON, PlotOutputFormatToJSON, } from './PlotOutputF * Check if a given object implements the WrappedPlotOutput interface. */ export function instanceOfWrappedPlotOutput(value) { - let isInstance = true; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "outputFormat" in value; - isInstance = isInstance && "plotType" in value; - return isInstance; + if (!('data' in value) || value['data'] === undefined) + return false; + if (!('outputFormat' in value) || value['outputFormat'] === undefined) + return false; + if (!('plotType' in value) || value['plotType'] === undefined) + return false; + return true; } export function WrappedPlotOutputFromJSON(json) { return WrappedPlotOutputFromJSONTyped(json, false); } export function WrappedPlotOutputFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -35,16 +37,16 @@ export function WrappedPlotOutputFromJSONTyped(json, ignoreDiscriminator) { 'plotType': json['plotType'], }; } -export function WrappedPlotOutputToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function WrappedPlotOutputToJSON(json) { + return WrappedPlotOutputToJSONTyped(json, false); +} +export function WrappedPlotOutputToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'data': value.data, - 'outputFormat': PlotOutputFormatToJSON(value.outputFormat), - 'plotType': value.plotType, + 'data': value['data'], + 'outputFormat': PlotOutputFormatToJSON(value['outputFormat']), + 'plotType': value['plotType'], }; } diff --git a/typescript/dist/esm/models/index.d.ts b/typescript/dist/esm/models/index.d.ts index ccb8f378..4bfa5fb5 100644 --- a/typescript/dist/esm/models/index.d.ts +++ b/typescript/dist/esm/models/index.d.ts @@ -62,6 +62,7 @@ export * from './GetLegendGraphicRequest'; export * from './GetMapExceptionFormat'; export * from './GetMapFormat'; export * from './GetMapRequest'; +export * from './InlineObject'; export * from './InternalDataId'; export * from './Layer'; export * from './LayerCollection'; diff --git a/typescript/dist/esm/models/index.js b/typescript/dist/esm/models/index.js index 762a3e8b..f2d0bb1b 100644 --- a/typescript/dist/esm/models/index.js +++ b/typescript/dist/esm/models/index.js @@ -64,6 +64,7 @@ export * from './GetLegendGraphicRequest'; export * from './GetMapExceptionFormat'; export * from './GetMapFormat'; export * from './GetMapRequest'; +export * from './InlineObject'; export * from './InternalDataId'; export * from './Layer'; export * from './LayerCollection'; diff --git a/typescript/dist/esm/runtime.d.ts b/typescript/dist/esm/runtime.d.ts index 391b42be..2c52ed3d 100644 --- a/typescript/dist/esm/runtime.d.ts +++ b/typescript/dist/esm/runtime.d.ts @@ -17,7 +17,7 @@ export interface ConfigurationParameters { queryParamsStringify?: (params: HTTPQuery) => string; username?: string; password?: string; - apiKey?: string | ((name: string) => string); + apiKey?: string | Promise | ((name: string) => string | Promise); accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); headers?: HTTPHeaders; credentials?: RequestCredentials; @@ -32,7 +32,7 @@ export declare class Configuration { get queryParamsStringify(): (params: HTTPQuery) => string; get username(): string | undefined; get password(): string | undefined; - get apiKey(): ((name: string) => string) | undefined; + get apiKey(): ((name: string) => string | Promise) | undefined; get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined; get headers(): HTTPHeaders | undefined; get credentials(): RequestCredentials | undefined; @@ -122,8 +122,8 @@ export interface RequestOpts { query?: HTTPQuery; body?: HTTPBody; } -export declare function exists(json: any, key: string): boolean; export declare function querystring(params: HTTPQuery, prefix?: string): string; +export declare function exists(json: any, key: string): boolean; export declare function mapValues(data: any, fn: (item: any) => any): {}; export declare function canConsumeForm(consumes: Consume[]): boolean; export interface Consume { diff --git a/typescript/dist/esm/runtime.js b/typescript/dist/esm/runtime.js index 0471ab87..89f1bca4 100644 --- a/typescript/dist/esm/runtime.js +++ b/typescript/dist/esm/runtime.js @@ -69,7 +69,7 @@ export class Configuration { } export const DefaultConfig = new Configuration({ headers: { - 'User-Agent': 'geoengine/openapi-client/typescript/0.0.20' + 'User-Agent': 'geoengine/openapi-client/typescript/0.0.21' } }); /** @@ -249,10 +249,6 @@ export const COLLECTION_FORMATS = { tsv: "\t", pipes: "|", }; -export function exists(json, key) { - const value = json[key]; - return value !== null && value !== undefined; -} export function querystring(params, prefix = '') { return Object.keys(params) .map(key => querystringSingleKey(key, params[key], prefix)) @@ -278,6 +274,10 @@ function querystringSingleKey(key, value, keyPrefix = '') { } return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; } +export function exists(json, key) { + const value = json[key]; + return value !== null && value !== undefined; +} export function mapValues(data, fn) { return Object.keys(data).reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: fn(data[key]) })), {}); } diff --git a/typescript/dist/models/AddCollection200Response.d.ts b/typescript/dist/models/AddCollection200Response.d.ts index 88f8e1b0..539cbe7d 100644 --- a/typescript/dist/models/AddCollection200Response.d.ts +++ b/typescript/dist/models/AddCollection200Response.d.ts @@ -25,7 +25,8 @@ export interface AddCollection200Response { /** * Check if a given object implements the AddCollection200Response interface. */ -export declare function instanceOfAddCollection200Response(value: object): boolean; +export declare function instanceOfAddCollection200Response(value: object): value is AddCollection200Response; export declare function AddCollection200ResponseFromJSON(json: any): AddCollection200Response; export declare function AddCollection200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddCollection200Response; -export declare function AddCollection200ResponseToJSON(value?: AddCollection200Response | null): any; +export declare function AddCollection200ResponseToJSON(json: any): AddCollection200Response; +export declare function AddCollection200ResponseToJSONTyped(value?: AddCollection200Response | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/AddCollection200Response.js b/typescript/dist/models/AddCollection200Response.js index 465a7815..2fb25c21 100644 --- a/typescript/dist/models/AddCollection200Response.js +++ b/typescript/dist/models/AddCollection200Response.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.AddCollection200ResponseToJSON = exports.AddCollection200ResponseFromJSONTyped = exports.AddCollection200ResponseFromJSON = exports.instanceOfAddCollection200Response = void 0; +exports.instanceOfAddCollection200Response = instanceOfAddCollection200Response; +exports.AddCollection200ResponseFromJSON = AddCollection200ResponseFromJSON; +exports.AddCollection200ResponseFromJSONTyped = AddCollection200ResponseFromJSONTyped; +exports.AddCollection200ResponseToJSON = AddCollection200ResponseToJSON; +exports.AddCollection200ResponseToJSONTyped = AddCollection200ResponseToJSONTyped; /** * Check if a given object implements the AddCollection200Response interface. */ function instanceOfAddCollection200Response(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + return true; } -exports.instanceOfAddCollection200Response = instanceOfAddCollection200Response; function AddCollection200ResponseFromJSON(json) { return AddCollection200ResponseFromJSONTyped(json, false); } -exports.AddCollection200ResponseFromJSON = AddCollection200ResponseFromJSON; function AddCollection200ResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'id': json['id'], }; } -exports.AddCollection200ResponseFromJSONTyped = AddCollection200ResponseFromJSONTyped; -function AddCollection200ResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function AddCollection200ResponseToJSON(json) { + return AddCollection200ResponseToJSONTyped(json, false); +} +function AddCollection200ResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, + 'id': value['id'], }; } -exports.AddCollection200ResponseToJSON = AddCollection200ResponseToJSON; diff --git a/typescript/dist/models/AddDataset.d.ts b/typescript/dist/models/AddDataset.d.ts index 4e6ef7b6..56b75997 100644 --- a/typescript/dist/models/AddDataset.d.ts +++ b/typescript/dist/models/AddDataset.d.ts @@ -63,7 +63,8 @@ export interface AddDataset { /** * Check if a given object implements the AddDataset interface. */ -export declare function instanceOfAddDataset(value: object): boolean; +export declare function instanceOfAddDataset(value: object): value is AddDataset; export declare function AddDatasetFromJSON(json: any): AddDataset; export declare function AddDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddDataset; -export declare function AddDatasetToJSON(value?: AddDataset | null): any; +export declare function AddDatasetToJSON(json: any): AddDataset; +export declare function AddDatasetToJSONTyped(value?: AddDataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/AddDataset.js b/typescript/dist/models/AddDataset.js index 315bbb2e..bd0a6c8e 100644 --- a/typescript/dist/models/AddDataset.js +++ b/typescript/dist/models/AddDataset.js @@ -13,55 +13,56 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.AddDatasetToJSON = exports.AddDatasetFromJSONTyped = exports.AddDatasetFromJSON = exports.instanceOfAddDataset = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfAddDataset = instanceOfAddDataset; +exports.AddDatasetFromJSON = AddDatasetFromJSON; +exports.AddDatasetFromJSONTyped = AddDatasetFromJSONTyped; +exports.AddDatasetToJSON = AddDatasetToJSON; +exports.AddDatasetToJSONTyped = AddDatasetToJSONTyped; const Provenance_1 = require("./Provenance"); const Symbology_1 = require("./Symbology"); /** * Check if a given object implements the AddDataset interface. */ function instanceOfAddDataset(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "sourceOperator" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('sourceOperator' in value) || value['sourceOperator'] === undefined) + return false; + return true; } -exports.instanceOfAddDataset = instanceOfAddDataset; function AddDatasetFromJSON(json) { return AddDatasetFromJSONTyped(json, false); } -exports.AddDatasetFromJSON = AddDatasetFromJSON; function AddDatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'displayName': json['displayName'], - 'name': !(0, runtime_1.exists)(json, 'name') ? undefined : json['name'], - 'provenance': !(0, runtime_1.exists)(json, 'provenance') ? undefined : (json['provenance'] === null ? null : json['provenance'].map(Provenance_1.ProvenanceFromJSON)), + 'name': json['name'] == null ? undefined : json['name'], + 'provenance': json['provenance'] == null ? undefined : (json['provenance'].map(Provenance_1.ProvenanceFromJSON)), 'sourceOperator': json['sourceOperator'], - 'symbology': !(0, runtime_1.exists)(json, 'symbology') ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), - 'tags': !(0, runtime_1.exists)(json, 'tags') ? undefined : json['tags'], + 'symbology': json['symbology'] == null ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), + 'tags': json['tags'] == null ? undefined : json['tags'], }; } -exports.AddDatasetFromJSONTyped = AddDatasetFromJSONTyped; -function AddDatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function AddDatasetToJSON(json) { + return AddDatasetToJSONTyped(json, false); +} +function AddDatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'displayName': value.displayName, - 'name': value.name, - 'provenance': value.provenance === undefined ? undefined : (value.provenance === null ? null : value.provenance.map(Provenance_1.ProvenanceToJSON)), - 'sourceOperator': value.sourceOperator, - 'symbology': (0, Symbology_1.SymbologyToJSON)(value.symbology), - 'tags': value.tags, + 'description': value['description'], + 'displayName': value['displayName'], + 'name': value['name'], + 'provenance': value['provenance'] == null ? undefined : (value['provenance'].map(Provenance_1.ProvenanceToJSON)), + 'sourceOperator': value['sourceOperator'], + 'symbology': (0, Symbology_1.SymbologyToJSON)(value['symbology']), + 'tags': value['tags'], }; } -exports.AddDatasetToJSON = AddDatasetToJSON; diff --git a/typescript/dist/models/AddLayer.d.ts b/typescript/dist/models/AddLayer.d.ts index 340739e6..7801eab1 100644 --- a/typescript/dist/models/AddLayer.d.ts +++ b/typescript/dist/models/AddLayer.d.ts @@ -59,7 +59,8 @@ export interface AddLayer { /** * Check if a given object implements the AddLayer interface. */ -export declare function instanceOfAddLayer(value: object): boolean; +export declare function instanceOfAddLayer(value: object): value is AddLayer; export declare function AddLayerFromJSON(json: any): AddLayer; export declare function AddLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddLayer; -export declare function AddLayerToJSON(value?: AddLayer | null): any; +export declare function AddLayerToJSON(json: any): AddLayer; +export declare function AddLayerToJSONTyped(value?: AddLayer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/AddLayer.js b/typescript/dist/models/AddLayer.js index cae0b4cc..c7d7f407 100644 --- a/typescript/dist/models/AddLayer.js +++ b/typescript/dist/models/AddLayer.js @@ -13,53 +13,54 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.AddLayerToJSON = exports.AddLayerFromJSONTyped = exports.AddLayerFromJSON = exports.instanceOfAddLayer = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfAddLayer = instanceOfAddLayer; +exports.AddLayerFromJSON = AddLayerFromJSON; +exports.AddLayerFromJSONTyped = AddLayerFromJSONTyped; +exports.AddLayerToJSON = AddLayerToJSON; +exports.AddLayerToJSONTyped = AddLayerToJSONTyped; const Symbology_1 = require("./Symbology"); const Workflow_1 = require("./Workflow"); /** * Check if a given object implements the AddLayer interface. */ function instanceOfAddLayer(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('workflow' in value) || value['workflow'] === undefined) + return false; + return true; } -exports.instanceOfAddLayer = instanceOfAddLayer; function AddLayerFromJSON(json) { return AddLayerFromJSONTyped(json, false); } -exports.AddLayerFromJSON = AddLayerFromJSON; function AddLayerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], - 'metadata': !(0, runtime_1.exists)(json, 'metadata') ? undefined : json['metadata'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], 'name': json['name'], - 'properties': !(0, runtime_1.exists)(json, 'properties') ? undefined : json['properties'], - 'symbology': !(0, runtime_1.exists)(json, 'symbology') ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), + 'properties': json['properties'] == null ? undefined : json['properties'], + 'symbology': json['symbology'] == null ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), 'workflow': (0, Workflow_1.WorkflowFromJSON)(json['workflow']), }; } -exports.AddLayerFromJSONTyped = AddLayerFromJSONTyped; -function AddLayerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function AddLayerToJSON(json) { + return AddLayerToJSONTyped(json, false); +} +function AddLayerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'metadata': value.metadata, - 'name': value.name, - 'properties': value.properties, - 'symbology': (0, Symbology_1.SymbologyToJSON)(value.symbology), - 'workflow': (0, Workflow_1.WorkflowToJSON)(value.workflow), + 'description': value['description'], + 'metadata': value['metadata'], + 'name': value['name'], + 'properties': value['properties'], + 'symbology': (0, Symbology_1.SymbologyToJSON)(value['symbology']), + 'workflow': (0, Workflow_1.WorkflowToJSON)(value['workflow']), }; } -exports.AddLayerToJSON = AddLayerToJSON; diff --git a/typescript/dist/models/AddLayerCollection.d.ts b/typescript/dist/models/AddLayerCollection.d.ts index b3656b4a..475a5dd4 100644 --- a/typescript/dist/models/AddLayerCollection.d.ts +++ b/typescript/dist/models/AddLayerCollection.d.ts @@ -37,7 +37,8 @@ export interface AddLayerCollection { /** * Check if a given object implements the AddLayerCollection interface. */ -export declare function instanceOfAddLayerCollection(value: object): boolean; +export declare function instanceOfAddLayerCollection(value: object): value is AddLayerCollection; export declare function AddLayerCollectionFromJSON(json: any): AddLayerCollection; export declare function AddLayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddLayerCollection; -export declare function AddLayerCollectionToJSON(value?: AddLayerCollection | null): any; +export declare function AddLayerCollectionToJSON(json: any): AddLayerCollection; +export declare function AddLayerCollectionToJSONTyped(value?: AddLayerCollection | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/AddLayerCollection.js b/typescript/dist/models/AddLayerCollection.js index b7addee2..da4bb1bf 100644 --- a/typescript/dist/models/AddLayerCollection.js +++ b/typescript/dist/models/AddLayerCollection.js @@ -13,44 +13,44 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.AddLayerCollectionToJSON = exports.AddLayerCollectionFromJSONTyped = exports.AddLayerCollectionFromJSON = exports.instanceOfAddLayerCollection = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfAddLayerCollection = instanceOfAddLayerCollection; +exports.AddLayerCollectionFromJSON = AddLayerCollectionFromJSON; +exports.AddLayerCollectionFromJSONTyped = AddLayerCollectionFromJSONTyped; +exports.AddLayerCollectionToJSON = AddLayerCollectionToJSON; +exports.AddLayerCollectionToJSONTyped = AddLayerCollectionToJSONTyped; /** * Check if a given object implements the AddLayerCollection interface. */ function instanceOfAddLayerCollection(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } -exports.instanceOfAddLayerCollection = instanceOfAddLayerCollection; function AddLayerCollectionFromJSON(json) { return AddLayerCollectionFromJSONTyped(json, false); } -exports.AddLayerCollectionFromJSON = AddLayerCollectionFromJSON; function AddLayerCollectionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'name': json['name'], - 'properties': !(0, runtime_1.exists)(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], }; } -exports.AddLayerCollectionFromJSONTyped = AddLayerCollectionFromJSONTyped; -function AddLayerCollectionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function AddLayerCollectionToJSON(json) { + return AddLayerCollectionToJSONTyped(json, false); +} +function AddLayerCollectionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'name': value.name, - 'properties': value.properties, + 'description': value['description'], + 'name': value['name'], + 'properties': value['properties'], }; } -exports.AddLayerCollectionToJSON = AddLayerCollectionToJSON; diff --git a/typescript/dist/models/AddRole.d.ts b/typescript/dist/models/AddRole.d.ts index 6a61c006..ba12ddac 100644 --- a/typescript/dist/models/AddRole.d.ts +++ b/typescript/dist/models/AddRole.d.ts @@ -25,7 +25,8 @@ export interface AddRole { /** * Check if a given object implements the AddRole interface. */ -export declare function instanceOfAddRole(value: object): boolean; +export declare function instanceOfAddRole(value: object): value is AddRole; export declare function AddRoleFromJSON(json: any): AddRole; export declare function AddRoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddRole; -export declare function AddRoleToJSON(value?: AddRole | null): any; +export declare function AddRoleToJSON(json: any): AddRole; +export declare function AddRoleToJSONTyped(value?: AddRole | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/AddRole.js b/typescript/dist/models/AddRole.js index 6260daf5..3d3991f4 100644 --- a/typescript/dist/models/AddRole.js +++ b/typescript/dist/models/AddRole.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.AddRoleToJSON = exports.AddRoleFromJSONTyped = exports.AddRoleFromJSON = exports.instanceOfAddRole = void 0; +exports.instanceOfAddRole = instanceOfAddRole; +exports.AddRoleFromJSON = AddRoleFromJSON; +exports.AddRoleFromJSONTyped = AddRoleFromJSONTyped; +exports.AddRoleToJSON = AddRoleToJSON; +exports.AddRoleToJSONTyped = AddRoleToJSONTyped; /** * Check if a given object implements the AddRole interface. */ function instanceOfAddRole(value) { - let isInstance = true; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } -exports.instanceOfAddRole = instanceOfAddRole; function AddRoleFromJSON(json) { return AddRoleFromJSONTyped(json, false); } -exports.AddRoleFromJSON = AddRoleFromJSON; function AddRoleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'name': json['name'], }; } -exports.AddRoleFromJSONTyped = AddRoleFromJSONTyped; -function AddRoleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function AddRoleToJSON(json) { + return AddRoleToJSONTyped(json, false); +} +function AddRoleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'name': value.name, + 'name': value['name'], }; } -exports.AddRoleToJSON = AddRoleToJSON; diff --git a/typescript/dist/models/AuthCodeRequestURL.d.ts b/typescript/dist/models/AuthCodeRequestURL.d.ts index 646b5413..448be092 100644 --- a/typescript/dist/models/AuthCodeRequestURL.d.ts +++ b/typescript/dist/models/AuthCodeRequestURL.d.ts @@ -25,7 +25,8 @@ export interface AuthCodeRequestURL { /** * Check if a given object implements the AuthCodeRequestURL interface. */ -export declare function instanceOfAuthCodeRequestURL(value: object): boolean; +export declare function instanceOfAuthCodeRequestURL(value: object): value is AuthCodeRequestURL; export declare function AuthCodeRequestURLFromJSON(json: any): AuthCodeRequestURL; export declare function AuthCodeRequestURLFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthCodeRequestURL; -export declare function AuthCodeRequestURLToJSON(value?: AuthCodeRequestURL | null): any; +export declare function AuthCodeRequestURLToJSON(json: any): AuthCodeRequestURL; +export declare function AuthCodeRequestURLToJSONTyped(value?: AuthCodeRequestURL | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/AuthCodeRequestURL.js b/typescript/dist/models/AuthCodeRequestURL.js index 6f92d0ee..0d675632 100644 --- a/typescript/dist/models/AuthCodeRequestURL.js +++ b/typescript/dist/models/AuthCodeRequestURL.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.AuthCodeRequestURLToJSON = exports.AuthCodeRequestURLFromJSONTyped = exports.AuthCodeRequestURLFromJSON = exports.instanceOfAuthCodeRequestURL = void 0; +exports.instanceOfAuthCodeRequestURL = instanceOfAuthCodeRequestURL; +exports.AuthCodeRequestURLFromJSON = AuthCodeRequestURLFromJSON; +exports.AuthCodeRequestURLFromJSONTyped = AuthCodeRequestURLFromJSONTyped; +exports.AuthCodeRequestURLToJSON = AuthCodeRequestURLToJSON; +exports.AuthCodeRequestURLToJSONTyped = AuthCodeRequestURLToJSONTyped; /** * Check if a given object implements the AuthCodeRequestURL interface. */ function instanceOfAuthCodeRequestURL(value) { - let isInstance = true; - isInstance = isInstance && "url" in value; - return isInstance; + if (!('url' in value) || value['url'] === undefined) + return false; + return true; } -exports.instanceOfAuthCodeRequestURL = instanceOfAuthCodeRequestURL; function AuthCodeRequestURLFromJSON(json) { return AuthCodeRequestURLFromJSONTyped(json, false); } -exports.AuthCodeRequestURLFromJSON = AuthCodeRequestURLFromJSON; function AuthCodeRequestURLFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'url': json['url'], }; } -exports.AuthCodeRequestURLFromJSONTyped = AuthCodeRequestURLFromJSONTyped; -function AuthCodeRequestURLToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function AuthCodeRequestURLToJSON(json) { + return AuthCodeRequestURLToJSONTyped(json, false); +} +function AuthCodeRequestURLToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'url': value.url, + 'url': value['url'], }; } -exports.AuthCodeRequestURLToJSON = AuthCodeRequestURLToJSON; diff --git a/typescript/dist/models/AuthCodeResponse.d.ts b/typescript/dist/models/AuthCodeResponse.d.ts index bbcabaa8..6a31af14 100644 --- a/typescript/dist/models/AuthCodeResponse.d.ts +++ b/typescript/dist/models/AuthCodeResponse.d.ts @@ -37,7 +37,8 @@ export interface AuthCodeResponse { /** * Check if a given object implements the AuthCodeResponse interface. */ -export declare function instanceOfAuthCodeResponse(value: object): boolean; +export declare function instanceOfAuthCodeResponse(value: object): value is AuthCodeResponse; export declare function AuthCodeResponseFromJSON(json: any): AuthCodeResponse; export declare function AuthCodeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthCodeResponse; -export declare function AuthCodeResponseToJSON(value?: AuthCodeResponse | null): any; +export declare function AuthCodeResponseToJSON(json: any): AuthCodeResponse; +export declare function AuthCodeResponseToJSONTyped(value?: AuthCodeResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/AuthCodeResponse.js b/typescript/dist/models/AuthCodeResponse.js index 42758ee2..5a9bcb34 100644 --- a/typescript/dist/models/AuthCodeResponse.js +++ b/typescript/dist/models/AuthCodeResponse.js @@ -13,24 +13,28 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.AuthCodeResponseToJSON = exports.AuthCodeResponseFromJSONTyped = exports.AuthCodeResponseFromJSON = exports.instanceOfAuthCodeResponse = void 0; +exports.instanceOfAuthCodeResponse = instanceOfAuthCodeResponse; +exports.AuthCodeResponseFromJSON = AuthCodeResponseFromJSON; +exports.AuthCodeResponseFromJSONTyped = AuthCodeResponseFromJSONTyped; +exports.AuthCodeResponseToJSON = AuthCodeResponseToJSON; +exports.AuthCodeResponseToJSONTyped = AuthCodeResponseToJSONTyped; /** * Check if a given object implements the AuthCodeResponse interface. */ function instanceOfAuthCodeResponse(value) { - let isInstance = true; - isInstance = isInstance && "code" in value; - isInstance = isInstance && "sessionState" in value; - isInstance = isInstance && "state" in value; - return isInstance; + if (!('code' in value) || value['code'] === undefined) + return false; + if (!('sessionState' in value) || value['sessionState'] === undefined) + return false; + if (!('state' in value) || value['state'] === undefined) + return false; + return true; } -exports.instanceOfAuthCodeResponse = instanceOfAuthCodeResponse; function AuthCodeResponseFromJSON(json) { return AuthCodeResponseFromJSONTyped(json, false); } -exports.AuthCodeResponseFromJSON = AuthCodeResponseFromJSON; function AuthCodeResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,18 +43,16 @@ function AuthCodeResponseFromJSONTyped(json, ignoreDiscriminator) { 'state': json['state'], }; } -exports.AuthCodeResponseFromJSONTyped = AuthCodeResponseFromJSONTyped; -function AuthCodeResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function AuthCodeResponseToJSON(json) { + return AuthCodeResponseToJSONTyped(json, false); +} +function AuthCodeResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'code': value.code, - 'sessionState': value.sessionState, - 'state': value.state, + 'code': value['code'], + 'sessionState': value['sessionState'], + 'state': value['state'], }; } -exports.AuthCodeResponseToJSON = AuthCodeResponseToJSON; diff --git a/typescript/dist/models/AutoCreateDataset.d.ts b/typescript/dist/models/AutoCreateDataset.d.ts index e6077852..1f524aff 100644 --- a/typescript/dist/models/AutoCreateDataset.d.ts +++ b/typescript/dist/models/AutoCreateDataset.d.ts @@ -55,7 +55,8 @@ export interface AutoCreateDataset { /** * Check if a given object implements the AutoCreateDataset interface. */ -export declare function instanceOfAutoCreateDataset(value: object): boolean; +export declare function instanceOfAutoCreateDataset(value: object): value is AutoCreateDataset; export declare function AutoCreateDatasetFromJSON(json: any): AutoCreateDataset; export declare function AutoCreateDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoCreateDataset; -export declare function AutoCreateDatasetToJSON(value?: AutoCreateDataset | null): any; +export declare function AutoCreateDatasetToJSON(json: any): AutoCreateDataset; +export declare function AutoCreateDatasetToJSONTyped(value?: AutoCreateDataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/AutoCreateDataset.js b/typescript/dist/models/AutoCreateDataset.js index 34b97ced..2b7128df 100644 --- a/typescript/dist/models/AutoCreateDataset.js +++ b/typescript/dist/models/AutoCreateDataset.js @@ -13,52 +13,54 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.AutoCreateDatasetToJSON = exports.AutoCreateDatasetFromJSONTyped = exports.AutoCreateDatasetFromJSON = exports.instanceOfAutoCreateDataset = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfAutoCreateDataset = instanceOfAutoCreateDataset; +exports.AutoCreateDatasetFromJSON = AutoCreateDatasetFromJSON; +exports.AutoCreateDatasetFromJSONTyped = AutoCreateDatasetFromJSONTyped; +exports.AutoCreateDatasetToJSON = AutoCreateDatasetToJSON; +exports.AutoCreateDatasetToJSONTyped = AutoCreateDatasetToJSONTyped; /** * Check if a given object implements the AutoCreateDataset interface. */ function instanceOfAutoCreateDataset(value) { - let isInstance = true; - isInstance = isInstance && "datasetDescription" in value; - isInstance = isInstance && "datasetName" in value; - isInstance = isInstance && "mainFile" in value; - isInstance = isInstance && "upload" in value; - return isInstance; + if (!('datasetDescription' in value) || value['datasetDescription'] === undefined) + return false; + if (!('datasetName' in value) || value['datasetName'] === undefined) + return false; + if (!('mainFile' in value) || value['mainFile'] === undefined) + return false; + if (!('upload' in value) || value['upload'] === undefined) + return false; + return true; } -exports.instanceOfAutoCreateDataset = instanceOfAutoCreateDataset; function AutoCreateDatasetFromJSON(json) { return AutoCreateDatasetFromJSONTyped(json, false); } -exports.AutoCreateDatasetFromJSON = AutoCreateDatasetFromJSON; function AutoCreateDatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'datasetDescription': json['datasetDescription'], 'datasetName': json['datasetName'], - 'layerName': !(0, runtime_1.exists)(json, 'layerName') ? undefined : json['layerName'], + 'layerName': json['layerName'] == null ? undefined : json['layerName'], 'mainFile': json['mainFile'], - 'tags': !(0, runtime_1.exists)(json, 'tags') ? undefined : json['tags'], + 'tags': json['tags'] == null ? undefined : json['tags'], 'upload': json['upload'], }; } -exports.AutoCreateDatasetFromJSONTyped = AutoCreateDatasetFromJSONTyped; -function AutoCreateDatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function AutoCreateDatasetToJSON(json) { + return AutoCreateDatasetToJSONTyped(json, false); +} +function AutoCreateDatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'datasetDescription': value.datasetDescription, - 'datasetName': value.datasetName, - 'layerName': value.layerName, - 'mainFile': value.mainFile, - 'tags': value.tags, - 'upload': value.upload, + 'datasetDescription': value['datasetDescription'], + 'datasetName': value['datasetName'], + 'layerName': value['layerName'], + 'mainFile': value['mainFile'], + 'tags': value['tags'], + 'upload': value['upload'], }; } -exports.AutoCreateDatasetToJSON = AutoCreateDatasetToJSON; diff --git a/typescript/dist/models/AxisOrder.d.ts b/typescript/dist/models/AxisOrder.d.ts index 9bf43dd4..82772b8e 100644 --- a/typescript/dist/models/AxisOrder.d.ts +++ b/typescript/dist/models/AxisOrder.d.ts @@ -18,6 +18,8 @@ export declare const AxisOrder: { readonly EastNorth: "eastNorth"; }; export type AxisOrder = typeof AxisOrder[keyof typeof AxisOrder]; +export declare function instanceOfAxisOrder(value: any): boolean; export declare function AxisOrderFromJSON(json: any): AxisOrder; export declare function AxisOrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): AxisOrder; export declare function AxisOrderToJSON(value?: AxisOrder | null): any; +export declare function AxisOrderToJSONTyped(value: any, ignoreDiscriminator: boolean): AxisOrder; diff --git a/typescript/dist/models/AxisOrder.js b/typescript/dist/models/AxisOrder.js index 360c22fd..7145f63b 100644 --- a/typescript/dist/models/AxisOrder.js +++ b/typescript/dist/models/AxisOrder.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.AxisOrderToJSON = exports.AxisOrderFromJSONTyped = exports.AxisOrderFromJSON = exports.AxisOrder = void 0; +exports.AxisOrder = void 0; +exports.instanceOfAxisOrder = instanceOfAxisOrder; +exports.AxisOrderFromJSON = AxisOrderFromJSON; +exports.AxisOrderFromJSONTyped = AxisOrderFromJSONTyped; +exports.AxisOrderToJSON = AxisOrderToJSON; +exports.AxisOrderToJSONTyped = AxisOrderToJSONTyped; /** * * @export @@ -22,15 +27,25 @@ exports.AxisOrder = { NorthEast: 'northEast', EastNorth: 'eastNorth' }; +function instanceOfAxisOrder(value) { + for (const key in exports.AxisOrder) { + if (Object.prototype.hasOwnProperty.call(exports.AxisOrder, key)) { + if (exports.AxisOrder[key] === value) { + return true; + } + } + } + return false; +} function AxisOrderFromJSON(json) { return AxisOrderFromJSONTyped(json, false); } -exports.AxisOrderFromJSON = AxisOrderFromJSON; function AxisOrderFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.AxisOrderFromJSONTyped = AxisOrderFromJSONTyped; function AxisOrderToJSON(value) { return value; } -exports.AxisOrderToJSON = AxisOrderToJSON; +function AxisOrderToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/BoundingBox2D.d.ts b/typescript/dist/models/BoundingBox2D.d.ts index eb528813..08f18375 100644 --- a/typescript/dist/models/BoundingBox2D.d.ts +++ b/typescript/dist/models/BoundingBox2D.d.ts @@ -33,7 +33,8 @@ export interface BoundingBox2D { /** * Check if a given object implements the BoundingBox2D interface. */ -export declare function instanceOfBoundingBox2D(value: object): boolean; +export declare function instanceOfBoundingBox2D(value: object): value is BoundingBox2D; export declare function BoundingBox2DFromJSON(json: any): BoundingBox2D; export declare function BoundingBox2DFromJSONTyped(json: any, ignoreDiscriminator: boolean): BoundingBox2D; -export declare function BoundingBox2DToJSON(value?: BoundingBox2D | null): any; +export declare function BoundingBox2DToJSON(json: any): BoundingBox2D; +export declare function BoundingBox2DToJSONTyped(value?: BoundingBox2D | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/BoundingBox2D.js b/typescript/dist/models/BoundingBox2D.js index e48fdc8f..59bdcf95 100644 --- a/typescript/dist/models/BoundingBox2D.js +++ b/typescript/dist/models/BoundingBox2D.js @@ -13,24 +13,27 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.BoundingBox2DToJSON = exports.BoundingBox2DFromJSONTyped = exports.BoundingBox2DFromJSON = exports.instanceOfBoundingBox2D = void 0; +exports.instanceOfBoundingBox2D = instanceOfBoundingBox2D; +exports.BoundingBox2DFromJSON = BoundingBox2DFromJSON; +exports.BoundingBox2DFromJSONTyped = BoundingBox2DFromJSONTyped; +exports.BoundingBox2DToJSON = BoundingBox2DToJSON; +exports.BoundingBox2DToJSONTyped = BoundingBox2DToJSONTyped; const Coordinate2D_1 = require("./Coordinate2D"); /** * Check if a given object implements the BoundingBox2D interface. */ function instanceOfBoundingBox2D(value) { - let isInstance = true; - isInstance = isInstance && "lowerLeftCoordinate" in value; - isInstance = isInstance && "upperRightCoordinate" in value; - return isInstance; + if (!('lowerLeftCoordinate' in value) || value['lowerLeftCoordinate'] === undefined) + return false; + if (!('upperRightCoordinate' in value) || value['upperRightCoordinate'] === undefined) + return false; + return true; } -exports.instanceOfBoundingBox2D = instanceOfBoundingBox2D; function BoundingBox2DFromJSON(json) { return BoundingBox2DFromJSONTyped(json, false); } -exports.BoundingBox2DFromJSON = BoundingBox2DFromJSON; function BoundingBox2DFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,17 +41,15 @@ function BoundingBox2DFromJSONTyped(json, ignoreDiscriminator) { 'upperRightCoordinate': (0, Coordinate2D_1.Coordinate2DFromJSON)(json['upperRightCoordinate']), }; } -exports.BoundingBox2DFromJSONTyped = BoundingBox2DFromJSONTyped; -function BoundingBox2DToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function BoundingBox2DToJSON(json) { + return BoundingBox2DToJSONTyped(json, false); +} +function BoundingBox2DToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'lowerLeftCoordinate': (0, Coordinate2D_1.Coordinate2DToJSON)(value.lowerLeftCoordinate), - 'upperRightCoordinate': (0, Coordinate2D_1.Coordinate2DToJSON)(value.upperRightCoordinate), + 'lowerLeftCoordinate': (0, Coordinate2D_1.Coordinate2DToJSON)(value['lowerLeftCoordinate']), + 'upperRightCoordinate': (0, Coordinate2D_1.Coordinate2DToJSON)(value['upperRightCoordinate']), }; } -exports.BoundingBox2DToJSON = BoundingBox2DToJSON; diff --git a/typescript/dist/models/Breakpoint.d.ts b/typescript/dist/models/Breakpoint.d.ts index dbae252d..05d84313 100644 --- a/typescript/dist/models/Breakpoint.d.ts +++ b/typescript/dist/models/Breakpoint.d.ts @@ -31,7 +31,8 @@ export interface Breakpoint { /** * Check if a given object implements the Breakpoint interface. */ -export declare function instanceOfBreakpoint(value: object): boolean; +export declare function instanceOfBreakpoint(value: object): value is Breakpoint; export declare function BreakpointFromJSON(json: any): Breakpoint; export declare function BreakpointFromJSONTyped(json: any, ignoreDiscriminator: boolean): Breakpoint; -export declare function BreakpointToJSON(value?: Breakpoint | null): any; +export declare function BreakpointToJSON(json: any): Breakpoint; +export declare function BreakpointToJSONTyped(value?: Breakpoint | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Breakpoint.js b/typescript/dist/models/Breakpoint.js index 916095d8..4add0d5e 100644 --- a/typescript/dist/models/Breakpoint.js +++ b/typescript/dist/models/Breakpoint.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.BreakpointToJSON = exports.BreakpointFromJSONTyped = exports.BreakpointFromJSON = exports.instanceOfBreakpoint = void 0; +exports.instanceOfBreakpoint = instanceOfBreakpoint; +exports.BreakpointFromJSON = BreakpointFromJSON; +exports.BreakpointFromJSONTyped = BreakpointFromJSONTyped; +exports.BreakpointToJSON = BreakpointToJSON; +exports.BreakpointToJSONTyped = BreakpointToJSONTyped; /** * Check if a given object implements the Breakpoint interface. */ function instanceOfBreakpoint(value) { - let isInstance = true; - isInstance = isInstance && "color" in value; - isInstance = isInstance && "value" in value; - return isInstance; + if (!('color' in value) || value['color'] === undefined) + return false; + if (!('value' in value) || value['value'] === undefined) + return false; + return true; } -exports.instanceOfBreakpoint = instanceOfBreakpoint; function BreakpointFromJSON(json) { return BreakpointFromJSONTyped(json, false); } -exports.BreakpointFromJSON = BreakpointFromJSON; function BreakpointFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function BreakpointFromJSONTyped(json, ignoreDiscriminator) { 'value': json['value'], }; } -exports.BreakpointFromJSONTyped = BreakpointFromJSONTyped; -function BreakpointToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function BreakpointToJSON(json) { + return BreakpointToJSONTyped(json, false); +} +function BreakpointToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'color': value.color, - 'value': value.value, + 'color': value['color'], + 'value': value['value'], }; } -exports.BreakpointToJSON = BreakpointToJSON; diff --git a/typescript/dist/models/ClassificationMeasurement.d.ts b/typescript/dist/models/ClassificationMeasurement.d.ts index e209302f..a5798843 100644 --- a/typescript/dist/models/ClassificationMeasurement.d.ts +++ b/typescript/dist/models/ClassificationMeasurement.d.ts @@ -46,7 +46,8 @@ export type ClassificationMeasurementTypeEnum = typeof ClassificationMeasurement /** * Check if a given object implements the ClassificationMeasurement interface. */ -export declare function instanceOfClassificationMeasurement(value: object): boolean; +export declare function instanceOfClassificationMeasurement(value: object): value is ClassificationMeasurement; export declare function ClassificationMeasurementFromJSON(json: any): ClassificationMeasurement; export declare function ClassificationMeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClassificationMeasurement; -export declare function ClassificationMeasurementToJSON(value?: ClassificationMeasurement | null): any; +export declare function ClassificationMeasurementToJSON(json: any): ClassificationMeasurement; +export declare function ClassificationMeasurementToJSONTyped(value?: ClassificationMeasurement | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ClassificationMeasurement.js b/typescript/dist/models/ClassificationMeasurement.js index d6c90f63..09217789 100644 --- a/typescript/dist/models/ClassificationMeasurement.js +++ b/typescript/dist/models/ClassificationMeasurement.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ClassificationMeasurementToJSON = exports.ClassificationMeasurementFromJSONTyped = exports.ClassificationMeasurementFromJSON = exports.instanceOfClassificationMeasurement = exports.ClassificationMeasurementTypeEnum = void 0; +exports.ClassificationMeasurementTypeEnum = void 0; +exports.instanceOfClassificationMeasurement = instanceOfClassificationMeasurement; +exports.ClassificationMeasurementFromJSON = ClassificationMeasurementFromJSON; +exports.ClassificationMeasurementFromJSONTyped = ClassificationMeasurementFromJSONTyped; +exports.ClassificationMeasurementToJSON = ClassificationMeasurementToJSON; +exports.ClassificationMeasurementToJSONTyped = ClassificationMeasurementToJSONTyped; /** * @export */ @@ -24,19 +29,19 @@ exports.ClassificationMeasurementTypeEnum = { * Check if a given object implements the ClassificationMeasurement interface. */ function instanceOfClassificationMeasurement(value) { - let isInstance = true; - isInstance = isInstance && "classes" in value; - isInstance = isInstance && "measurement" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('classes' in value) || value['classes'] === undefined) + return false; + if (!('measurement' in value) || value['measurement'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfClassificationMeasurement = instanceOfClassificationMeasurement; function ClassificationMeasurementFromJSON(json) { return ClassificationMeasurementFromJSONTyped(json, false); } -exports.ClassificationMeasurementFromJSON = ClassificationMeasurementFromJSON; function ClassificationMeasurementFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -45,18 +50,16 @@ function ClassificationMeasurementFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.ClassificationMeasurementFromJSONTyped = ClassificationMeasurementFromJSONTyped; -function ClassificationMeasurementToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ClassificationMeasurementToJSON(json) { + return ClassificationMeasurementToJSONTyped(json, false); +} +function ClassificationMeasurementToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'classes': value.classes, - 'measurement': value.measurement, - 'type': value.type, + 'classes': value['classes'], + 'measurement': value['measurement'], + 'type': value['type'], }; } -exports.ClassificationMeasurementToJSON = ClassificationMeasurementToJSON; diff --git a/typescript/dist/models/CollectionItem.d.ts b/typescript/dist/models/CollectionItem.d.ts index 7cd6117a..045dec7a 100644 --- a/typescript/dist/models/CollectionItem.d.ts +++ b/typescript/dist/models/CollectionItem.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { LayerCollectionListing } from './LayerCollectionListing'; -import { LayerListing } from './LayerListing'; +import type { LayerCollectionListing } from './LayerCollectionListing'; +import type { LayerListing } from './LayerListing'; /** * @type CollectionItem * @@ -23,4 +23,5 @@ export type CollectionItem = { } & LayerListing; export declare function CollectionItemFromJSON(json: any): CollectionItem; export declare function CollectionItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionItem; -export declare function CollectionItemToJSON(value?: CollectionItem | null): any; +export declare function CollectionItemToJSON(json: any): any; +export declare function CollectionItemToJSONTyped(value?: CollectionItem | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/CollectionItem.js b/typescript/dist/models/CollectionItem.js index ed82ba6e..fdd91b08 100644 --- a/typescript/dist/models/CollectionItem.js +++ b/typescript/dist/models/CollectionItem.js @@ -13,41 +13,41 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.CollectionItemToJSON = exports.CollectionItemFromJSONTyped = exports.CollectionItemFromJSON = void 0; +exports.CollectionItemFromJSON = CollectionItemFromJSON; +exports.CollectionItemFromJSONTyped = CollectionItemFromJSONTyped; +exports.CollectionItemToJSON = CollectionItemToJSON; +exports.CollectionItemToJSONTyped = CollectionItemToJSONTyped; const LayerCollectionListing_1 = require("./LayerCollectionListing"); const LayerListing_1 = require("./LayerListing"); function CollectionItemFromJSON(json) { return CollectionItemFromJSONTyped(json, false); } -exports.CollectionItemFromJSON = CollectionItemFromJSON; function CollectionItemFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'collection': - return Object.assign(Object.assign({}, (0, LayerCollectionListing_1.LayerCollectionListingFromJSONTyped)(json, true)), { type: 'collection' }); + return Object.assign({}, (0, LayerCollectionListing_1.LayerCollectionListingFromJSONTyped)(json, true), { type: 'collection' }); case 'layer': - return Object.assign(Object.assign({}, (0, LayerListing_1.LayerListingFromJSONTyped)(json, true)), { type: 'layer' }); + return Object.assign({}, (0, LayerListing_1.LayerListingFromJSONTyped)(json, true), { type: 'layer' }); default: throw new Error(`No variant of CollectionItem exists with 'type=${json['type']}'`); } } -exports.CollectionItemFromJSONTyped = CollectionItemFromJSONTyped; -function CollectionItemToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function CollectionItemToJSON(json) { + return CollectionItemToJSONTyped(json, false); +} +function CollectionItemToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'collection': - return (0, LayerCollectionListing_1.LayerCollectionListingToJSON)(value); + return Object.assign({}, (0, LayerCollectionListing_1.LayerCollectionListingToJSON)(value), { type: 'collection' }); case 'layer': - return (0, LayerListing_1.LayerListingToJSON)(value); + return Object.assign({}, (0, LayerListing_1.LayerListingToJSON)(value), { type: 'layer' }); default: throw new Error(`No variant of CollectionItem exists with 'type=${value['type']}'`); } } -exports.CollectionItemToJSON = CollectionItemToJSON; diff --git a/typescript/dist/models/CollectionType.d.ts b/typescript/dist/models/CollectionType.d.ts index d3cceb54..42b4ae96 100644 --- a/typescript/dist/models/CollectionType.d.ts +++ b/typescript/dist/models/CollectionType.d.ts @@ -17,6 +17,8 @@ export declare const CollectionType: { readonly FeatureCollection: "FeatureCollection"; }; export type CollectionType = typeof CollectionType[keyof typeof CollectionType]; +export declare function instanceOfCollectionType(value: any): boolean; export declare function CollectionTypeFromJSON(json: any): CollectionType; export declare function CollectionTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionType; export declare function CollectionTypeToJSON(value?: CollectionType | null): any; +export declare function CollectionTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): CollectionType; diff --git a/typescript/dist/models/CollectionType.js b/typescript/dist/models/CollectionType.js index 1765a051..48f82098 100644 --- a/typescript/dist/models/CollectionType.js +++ b/typescript/dist/models/CollectionType.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.CollectionTypeToJSON = exports.CollectionTypeFromJSONTyped = exports.CollectionTypeFromJSON = exports.CollectionType = void 0; +exports.CollectionType = void 0; +exports.instanceOfCollectionType = instanceOfCollectionType; +exports.CollectionTypeFromJSON = CollectionTypeFromJSON; +exports.CollectionTypeFromJSONTyped = CollectionTypeFromJSONTyped; +exports.CollectionTypeToJSON = CollectionTypeToJSON; +exports.CollectionTypeToJSONTyped = CollectionTypeToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.CollectionTypeToJSON = exports.CollectionTypeFromJSONTyped = exports.Col exports.CollectionType = { FeatureCollection: 'FeatureCollection' }; +function instanceOfCollectionType(value) { + for (const key in exports.CollectionType) { + if (Object.prototype.hasOwnProperty.call(exports.CollectionType, key)) { + if (exports.CollectionType[key] === value) { + return true; + } + } + } + return false; +} function CollectionTypeFromJSON(json) { return CollectionTypeFromJSONTyped(json, false); } -exports.CollectionTypeFromJSON = CollectionTypeFromJSON; function CollectionTypeFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.CollectionTypeFromJSONTyped = CollectionTypeFromJSONTyped; function CollectionTypeToJSON(value) { return value; } -exports.CollectionTypeToJSON = CollectionTypeToJSON; +function CollectionTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/ColorParam.d.ts b/typescript/dist/models/ColorParam.d.ts index 137c8b33..27e62d45 100644 --- a/typescript/dist/models/ColorParam.d.ts +++ b/typescript/dist/models/ColorParam.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ColorParamStatic } from './ColorParamStatic'; -import { DerivedColor } from './DerivedColor'; +import type { ColorParamStatic } from './ColorParamStatic'; +import type { DerivedColor } from './DerivedColor'; /** * @type ColorParam * @@ -23,4 +23,5 @@ export type ColorParam = { } & ColorParamStatic; export declare function ColorParamFromJSON(json: any): ColorParam; export declare function ColorParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): ColorParam; -export declare function ColorParamToJSON(value?: ColorParam | null): any; +export declare function ColorParamToJSON(json: any): any; +export declare function ColorParamToJSONTyped(value?: ColorParam | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ColorParam.js b/typescript/dist/models/ColorParam.js index 7a5ad0db..1d13aa25 100644 --- a/typescript/dist/models/ColorParam.js +++ b/typescript/dist/models/ColorParam.js @@ -13,41 +13,41 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ColorParamToJSON = exports.ColorParamFromJSONTyped = exports.ColorParamFromJSON = void 0; +exports.ColorParamFromJSON = ColorParamFromJSON; +exports.ColorParamFromJSONTyped = ColorParamFromJSONTyped; +exports.ColorParamToJSON = ColorParamToJSON; +exports.ColorParamToJSONTyped = ColorParamToJSONTyped; const ColorParamStatic_1 = require("./ColorParamStatic"); const DerivedColor_1 = require("./DerivedColor"); function ColorParamFromJSON(json) { return ColorParamFromJSONTyped(json, false); } -exports.ColorParamFromJSON = ColorParamFromJSON; function ColorParamFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'derived': - return Object.assign(Object.assign({}, (0, DerivedColor_1.DerivedColorFromJSONTyped)(json, true)), { type: 'derived' }); + return Object.assign({}, (0, DerivedColor_1.DerivedColorFromJSONTyped)(json, true), { type: 'derived' }); case 'static': - return Object.assign(Object.assign({}, (0, ColorParamStatic_1.ColorParamStaticFromJSONTyped)(json, true)), { type: 'static' }); + return Object.assign({}, (0, ColorParamStatic_1.ColorParamStaticFromJSONTyped)(json, true), { type: 'static' }); default: throw new Error(`No variant of ColorParam exists with 'type=${json['type']}'`); } } -exports.ColorParamFromJSONTyped = ColorParamFromJSONTyped; -function ColorParamToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ColorParamToJSON(json) { + return ColorParamToJSONTyped(json, false); +} +function ColorParamToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'derived': - return (0, DerivedColor_1.DerivedColorToJSON)(value); + return Object.assign({}, (0, DerivedColor_1.DerivedColorToJSON)(value), { type: 'derived' }); case 'static': - return (0, ColorParamStatic_1.ColorParamStaticToJSON)(value); + return Object.assign({}, (0, ColorParamStatic_1.ColorParamStaticToJSON)(value), { type: 'static' }); default: throw new Error(`No variant of ColorParam exists with 'type=${value['type']}'`); } } -exports.ColorParamToJSON = ColorParamToJSON; diff --git a/typescript/dist/models/ColorParamStatic.d.ts b/typescript/dist/models/ColorParamStatic.d.ts index 3290501e..5b67fd37 100644 --- a/typescript/dist/models/ColorParamStatic.d.ts +++ b/typescript/dist/models/ColorParamStatic.d.ts @@ -33,13 +33,13 @@ export interface ColorParamStatic { */ export declare const ColorParamStaticTypeEnum: { readonly Static: "static"; - readonly Derived: "derived"; }; export type ColorParamStaticTypeEnum = typeof ColorParamStaticTypeEnum[keyof typeof ColorParamStaticTypeEnum]; /** * Check if a given object implements the ColorParamStatic interface. */ -export declare function instanceOfColorParamStatic(value: object): boolean; +export declare function instanceOfColorParamStatic(value: object): value is ColorParamStatic; export declare function ColorParamStaticFromJSON(json: any): ColorParamStatic; export declare function ColorParamStaticFromJSONTyped(json: any, ignoreDiscriminator: boolean): ColorParamStatic; -export declare function ColorParamStaticToJSON(value?: ColorParamStatic | null): any; +export declare function ColorParamStaticToJSON(json: any): ColorParamStatic; +export declare function ColorParamStaticToJSONTyped(value?: ColorParamStatic | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ColorParamStatic.js b/typescript/dist/models/ColorParamStatic.js index 4c502af3..5c8a56af 100644 --- a/typescript/dist/models/ColorParamStatic.js +++ b/typescript/dist/models/ColorParamStatic.js @@ -13,30 +13,33 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ColorParamStaticToJSON = exports.ColorParamStaticFromJSONTyped = exports.ColorParamStaticFromJSON = exports.instanceOfColorParamStatic = exports.ColorParamStaticTypeEnum = void 0; +exports.ColorParamStaticTypeEnum = void 0; +exports.instanceOfColorParamStatic = instanceOfColorParamStatic; +exports.ColorParamStaticFromJSON = ColorParamStaticFromJSON; +exports.ColorParamStaticFromJSONTyped = ColorParamStaticFromJSONTyped; +exports.ColorParamStaticToJSON = ColorParamStaticToJSON; +exports.ColorParamStaticToJSONTyped = ColorParamStaticToJSONTyped; /** * @export */ exports.ColorParamStaticTypeEnum = { - Static: 'static', - Derived: 'derived' + Static: 'static' }; /** * Check if a given object implements the ColorParamStatic interface. */ function instanceOfColorParamStatic(value) { - let isInstance = true; - isInstance = isInstance && "color" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('color' in value) || value['color'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfColorParamStatic = instanceOfColorParamStatic; function ColorParamStaticFromJSON(json) { return ColorParamStaticFromJSONTyped(json, false); } -exports.ColorParamStaticFromJSON = ColorParamStaticFromJSON; function ColorParamStaticFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -44,17 +47,15 @@ function ColorParamStaticFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.ColorParamStaticFromJSONTyped = ColorParamStaticFromJSONTyped; -function ColorParamStaticToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ColorParamStaticToJSON(json) { + return ColorParamStaticToJSONTyped(json, false); +} +function ColorParamStaticToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'color': value.color, - 'type': value.type, + 'color': value['color'], + 'type': value['type'], }; } -exports.ColorParamStaticToJSON = ColorParamStaticToJSON; diff --git a/typescript/dist/models/Colorizer.d.ts b/typescript/dist/models/Colorizer.d.ts index 83e37092..7d75528c 100644 --- a/typescript/dist/models/Colorizer.d.ts +++ b/typescript/dist/models/Colorizer.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { LinearGradient } from './LinearGradient'; -import { LogarithmicGradient } from './LogarithmicGradient'; -import { PaletteColorizer } from './PaletteColorizer'; +import type { LinearGradient } from './LinearGradient'; +import type { LogarithmicGradient } from './LogarithmicGradient'; +import type { PaletteColorizer } from './PaletteColorizer'; /** * @type Colorizer * @@ -26,4 +26,5 @@ export type Colorizer = { } & PaletteColorizer; export declare function ColorizerFromJSON(json: any): Colorizer; export declare function ColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): Colorizer; -export declare function ColorizerToJSON(value?: Colorizer | null): any; +export declare function ColorizerToJSON(json: any): any; +export declare function ColorizerToJSONTyped(value?: Colorizer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Colorizer.js b/typescript/dist/models/Colorizer.js index a369c06f..87b8830e 100644 --- a/typescript/dist/models/Colorizer.js +++ b/typescript/dist/models/Colorizer.js @@ -13,46 +13,46 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ColorizerToJSON = exports.ColorizerFromJSONTyped = exports.ColorizerFromJSON = void 0; +exports.ColorizerFromJSON = ColorizerFromJSON; +exports.ColorizerFromJSONTyped = ColorizerFromJSONTyped; +exports.ColorizerToJSON = ColorizerToJSON; +exports.ColorizerToJSONTyped = ColorizerToJSONTyped; const LinearGradient_1 = require("./LinearGradient"); const LogarithmicGradient_1 = require("./LogarithmicGradient"); const PaletteColorizer_1 = require("./PaletteColorizer"); function ColorizerFromJSON(json) { return ColorizerFromJSONTyped(json, false); } -exports.ColorizerFromJSON = ColorizerFromJSON; function ColorizerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'linearGradient': - return Object.assign(Object.assign({}, (0, LinearGradient_1.LinearGradientFromJSONTyped)(json, true)), { type: 'linearGradient' }); + return Object.assign({}, (0, LinearGradient_1.LinearGradientFromJSONTyped)(json, true), { type: 'linearGradient' }); case 'logarithmicGradient': - return Object.assign(Object.assign({}, (0, LogarithmicGradient_1.LogarithmicGradientFromJSONTyped)(json, true)), { type: 'logarithmicGradient' }); + return Object.assign({}, (0, LogarithmicGradient_1.LogarithmicGradientFromJSONTyped)(json, true), { type: 'logarithmicGradient' }); case 'palette': - return Object.assign(Object.assign({}, (0, PaletteColorizer_1.PaletteColorizerFromJSONTyped)(json, true)), { type: 'palette' }); + return Object.assign({}, (0, PaletteColorizer_1.PaletteColorizerFromJSONTyped)(json, true), { type: 'palette' }); default: throw new Error(`No variant of Colorizer exists with 'type=${json['type']}'`); } } -exports.ColorizerFromJSONTyped = ColorizerFromJSONTyped; -function ColorizerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ColorizerToJSON(json) { + return ColorizerToJSONTyped(json, false); +} +function ColorizerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'linearGradient': - return (0, LinearGradient_1.LinearGradientToJSON)(value); + return Object.assign({}, (0, LinearGradient_1.LinearGradientToJSON)(value), { type: 'linearGradient' }); case 'logarithmicGradient': - return (0, LogarithmicGradient_1.LogarithmicGradientToJSON)(value); + return Object.assign({}, (0, LogarithmicGradient_1.LogarithmicGradientToJSON)(value), { type: 'logarithmicGradient' }); case 'palette': - return (0, PaletteColorizer_1.PaletteColorizerToJSON)(value); + return Object.assign({}, (0, PaletteColorizer_1.PaletteColorizerToJSON)(value), { type: 'palette' }); default: throw new Error(`No variant of Colorizer exists with 'type=${value['type']}'`); } } -exports.ColorizerToJSON = ColorizerToJSON; diff --git a/typescript/dist/models/ComputationQuota.d.ts b/typescript/dist/models/ComputationQuota.d.ts index 7d671174..714a306a 100644 --- a/typescript/dist/models/ComputationQuota.d.ts +++ b/typescript/dist/models/ComputationQuota.d.ts @@ -43,7 +43,8 @@ export interface ComputationQuota { /** * Check if a given object implements the ComputationQuota interface. */ -export declare function instanceOfComputationQuota(value: object): boolean; +export declare function instanceOfComputationQuota(value: object): value is ComputationQuota; export declare function ComputationQuotaFromJSON(json: any): ComputationQuota; export declare function ComputationQuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): ComputationQuota; -export declare function ComputationQuotaToJSON(value?: ComputationQuota | null): any; +export declare function ComputationQuotaToJSON(json: any): ComputationQuota; +export declare function ComputationQuotaToJSONTyped(value?: ComputationQuota | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ComputationQuota.js b/typescript/dist/models/ComputationQuota.js index f49ef8bd..6746c4b2 100644 --- a/typescript/dist/models/ComputationQuota.js +++ b/typescript/dist/models/ComputationQuota.js @@ -13,25 +13,30 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ComputationQuotaToJSON = exports.ComputationQuotaFromJSONTyped = exports.ComputationQuotaFromJSON = exports.instanceOfComputationQuota = void 0; +exports.instanceOfComputationQuota = instanceOfComputationQuota; +exports.ComputationQuotaFromJSON = ComputationQuotaFromJSON; +exports.ComputationQuotaFromJSONTyped = ComputationQuotaFromJSONTyped; +exports.ComputationQuotaToJSON = ComputationQuotaToJSON; +exports.ComputationQuotaToJSONTyped = ComputationQuotaToJSONTyped; /** * Check if a given object implements the ComputationQuota interface. */ function instanceOfComputationQuota(value) { - let isInstance = true; - isInstance = isInstance && "computationId" in value; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "timestamp" in value; - isInstance = isInstance && "workflowId" in value; - return isInstance; + if (!('computationId' in value) || value['computationId'] === undefined) + return false; + if (!('count' in value) || value['count'] === undefined) + return false; + if (!('timestamp' in value) || value['timestamp'] === undefined) + return false; + if (!('workflowId' in value) || value['workflowId'] === undefined) + return false; + return true; } -exports.instanceOfComputationQuota = instanceOfComputationQuota; function ComputationQuotaFromJSON(json) { return ComputationQuotaFromJSONTyped(json, false); } -exports.ComputationQuotaFromJSON = ComputationQuotaFromJSON; function ComputationQuotaFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,19 +46,17 @@ function ComputationQuotaFromJSONTyped(json, ignoreDiscriminator) { 'workflowId': json['workflowId'], }; } -exports.ComputationQuotaFromJSONTyped = ComputationQuotaFromJSONTyped; -function ComputationQuotaToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ComputationQuotaToJSON(json) { + return ComputationQuotaToJSONTyped(json, false); +} +function ComputationQuotaToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'computationId': value.computationId, - 'count': value.count, - 'timestamp': (value.timestamp.toISOString()), - 'workflowId': value.workflowId, + 'computationId': value['computationId'], + 'count': value['count'], + 'timestamp': ((value['timestamp']).toISOString()), + 'workflowId': value['workflowId'], }; } -exports.ComputationQuotaToJSON = ComputationQuotaToJSON; diff --git a/typescript/dist/models/ContinuousMeasurement.d.ts b/typescript/dist/models/ContinuousMeasurement.d.ts index ab24d241..41c613d1 100644 --- a/typescript/dist/models/ContinuousMeasurement.d.ts +++ b/typescript/dist/models/ContinuousMeasurement.d.ts @@ -44,7 +44,8 @@ export type ContinuousMeasurementTypeEnum = typeof ContinuousMeasurementTypeEnum /** * Check if a given object implements the ContinuousMeasurement interface. */ -export declare function instanceOfContinuousMeasurement(value: object): boolean; +export declare function instanceOfContinuousMeasurement(value: object): value is ContinuousMeasurement; export declare function ContinuousMeasurementFromJSON(json: any): ContinuousMeasurement; export declare function ContinuousMeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContinuousMeasurement; -export declare function ContinuousMeasurementToJSON(value?: ContinuousMeasurement | null): any; +export declare function ContinuousMeasurementToJSON(json: any): ContinuousMeasurement; +export declare function ContinuousMeasurementToJSONTyped(value?: ContinuousMeasurement | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ContinuousMeasurement.js b/typescript/dist/models/ContinuousMeasurement.js index 196ef905..0fc7b892 100644 --- a/typescript/dist/models/ContinuousMeasurement.js +++ b/typescript/dist/models/ContinuousMeasurement.js @@ -13,8 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ContinuousMeasurementToJSON = exports.ContinuousMeasurementFromJSONTyped = exports.ContinuousMeasurementFromJSON = exports.instanceOfContinuousMeasurement = exports.ContinuousMeasurementTypeEnum = void 0; -const runtime_1 = require("../runtime"); +exports.ContinuousMeasurementTypeEnum = void 0; +exports.instanceOfContinuousMeasurement = instanceOfContinuousMeasurement; +exports.ContinuousMeasurementFromJSON = ContinuousMeasurementFromJSON; +exports.ContinuousMeasurementFromJSONTyped = ContinuousMeasurementFromJSONTyped; +exports.ContinuousMeasurementToJSON = ContinuousMeasurementToJSON; +exports.ContinuousMeasurementToJSONTyped = ContinuousMeasurementToJSONTyped; /** * @export */ @@ -25,38 +29,35 @@ exports.ContinuousMeasurementTypeEnum = { * Check if a given object implements the ContinuousMeasurement interface. */ function instanceOfContinuousMeasurement(value) { - let isInstance = true; - isInstance = isInstance && "measurement" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('measurement' in value) || value['measurement'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfContinuousMeasurement = instanceOfContinuousMeasurement; function ContinuousMeasurementFromJSON(json) { return ContinuousMeasurementFromJSONTyped(json, false); } -exports.ContinuousMeasurementFromJSON = ContinuousMeasurementFromJSON; function ContinuousMeasurementFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'measurement': json['measurement'], 'type': json['type'], - 'unit': !(0, runtime_1.exists)(json, 'unit') ? undefined : json['unit'], + 'unit': json['unit'] == null ? undefined : json['unit'], }; } -exports.ContinuousMeasurementFromJSONTyped = ContinuousMeasurementFromJSONTyped; -function ContinuousMeasurementToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ContinuousMeasurementToJSON(json) { + return ContinuousMeasurementToJSONTyped(json, false); +} +function ContinuousMeasurementToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'measurement': value.measurement, - 'type': value.type, - 'unit': value.unit, + 'measurement': value['measurement'], + 'type': value['type'], + 'unit': value['unit'], }; } -exports.ContinuousMeasurementToJSON = ContinuousMeasurementToJSON; diff --git a/typescript/dist/models/Coordinate2D.d.ts b/typescript/dist/models/Coordinate2D.d.ts index 4f3192fa..5e97411d 100644 --- a/typescript/dist/models/Coordinate2D.d.ts +++ b/typescript/dist/models/Coordinate2D.d.ts @@ -31,7 +31,8 @@ export interface Coordinate2D { /** * Check if a given object implements the Coordinate2D interface. */ -export declare function instanceOfCoordinate2D(value: object): boolean; +export declare function instanceOfCoordinate2D(value: object): value is Coordinate2D; export declare function Coordinate2DFromJSON(json: any): Coordinate2D; export declare function Coordinate2DFromJSONTyped(json: any, ignoreDiscriminator: boolean): Coordinate2D; -export declare function Coordinate2DToJSON(value?: Coordinate2D | null): any; +export declare function Coordinate2DToJSON(json: any): Coordinate2D; +export declare function Coordinate2DToJSONTyped(value?: Coordinate2D | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Coordinate2D.js b/typescript/dist/models/Coordinate2D.js index 15b05d8e..da6c9faf 100644 --- a/typescript/dist/models/Coordinate2D.js +++ b/typescript/dist/models/Coordinate2D.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.Coordinate2DToJSON = exports.Coordinate2DFromJSONTyped = exports.Coordinate2DFromJSON = exports.instanceOfCoordinate2D = void 0; +exports.instanceOfCoordinate2D = instanceOfCoordinate2D; +exports.Coordinate2DFromJSON = Coordinate2DFromJSON; +exports.Coordinate2DFromJSONTyped = Coordinate2DFromJSONTyped; +exports.Coordinate2DToJSON = Coordinate2DToJSON; +exports.Coordinate2DToJSONTyped = Coordinate2DToJSONTyped; /** * Check if a given object implements the Coordinate2D interface. */ function instanceOfCoordinate2D(value) { - let isInstance = true; - isInstance = isInstance && "x" in value; - isInstance = isInstance && "y" in value; - return isInstance; + if (!('x' in value) || value['x'] === undefined) + return false; + if (!('y' in value) || value['y'] === undefined) + return false; + return true; } -exports.instanceOfCoordinate2D = instanceOfCoordinate2D; function Coordinate2DFromJSON(json) { return Coordinate2DFromJSONTyped(json, false); } -exports.Coordinate2DFromJSON = Coordinate2DFromJSON; function Coordinate2DFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function Coordinate2DFromJSONTyped(json, ignoreDiscriminator) { 'y': json['y'], }; } -exports.Coordinate2DFromJSONTyped = Coordinate2DFromJSONTyped; -function Coordinate2DToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function Coordinate2DToJSON(json) { + return Coordinate2DToJSONTyped(json, false); +} +function Coordinate2DToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'x': value.x, - 'y': value.y, + 'x': value['x'], + 'y': value['y'], }; } -exports.Coordinate2DToJSON = Coordinate2DToJSON; diff --git a/typescript/dist/models/CreateDataset.d.ts b/typescript/dist/models/CreateDataset.d.ts index fdacea9b..ba7f4cad 100644 --- a/typescript/dist/models/CreateDataset.d.ts +++ b/typescript/dist/models/CreateDataset.d.ts @@ -33,7 +33,8 @@ export interface CreateDataset { /** * Check if a given object implements the CreateDataset interface. */ -export declare function instanceOfCreateDataset(value: object): boolean; +export declare function instanceOfCreateDataset(value: object): value is CreateDataset; export declare function CreateDatasetFromJSON(json: any): CreateDataset; export declare function CreateDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDataset; -export declare function CreateDatasetToJSON(value?: CreateDataset | null): any; +export declare function CreateDatasetToJSON(json: any): CreateDataset; +export declare function CreateDatasetToJSONTyped(value?: CreateDataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/CreateDataset.js b/typescript/dist/models/CreateDataset.js index 38b5d3d3..c78fbb4c 100644 --- a/typescript/dist/models/CreateDataset.js +++ b/typescript/dist/models/CreateDataset.js @@ -13,25 +13,28 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.CreateDatasetToJSON = exports.CreateDatasetFromJSONTyped = exports.CreateDatasetFromJSON = exports.instanceOfCreateDataset = void 0; +exports.instanceOfCreateDataset = instanceOfCreateDataset; +exports.CreateDatasetFromJSON = CreateDatasetFromJSON; +exports.CreateDatasetFromJSONTyped = CreateDatasetFromJSONTyped; +exports.CreateDatasetToJSON = CreateDatasetToJSON; +exports.CreateDatasetToJSONTyped = CreateDatasetToJSONTyped; const DataPath_1 = require("./DataPath"); const DatasetDefinition_1 = require("./DatasetDefinition"); /** * Check if a given object implements the CreateDataset interface. */ function instanceOfCreateDataset(value) { - let isInstance = true; - isInstance = isInstance && "dataPath" in value; - isInstance = isInstance && "definition" in value; - return isInstance; + if (!('dataPath' in value) || value['dataPath'] === undefined) + return false; + if (!('definition' in value) || value['definition'] === undefined) + return false; + return true; } -exports.instanceOfCreateDataset = instanceOfCreateDataset; function CreateDatasetFromJSON(json) { return CreateDatasetFromJSONTyped(json, false); } -exports.CreateDatasetFromJSON = CreateDatasetFromJSON; function CreateDatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,17 +42,15 @@ function CreateDatasetFromJSONTyped(json, ignoreDiscriminator) { 'definition': (0, DatasetDefinition_1.DatasetDefinitionFromJSON)(json['definition']), }; } -exports.CreateDatasetFromJSONTyped = CreateDatasetFromJSONTyped; -function CreateDatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function CreateDatasetToJSON(json) { + return CreateDatasetToJSONTyped(json, false); +} +function CreateDatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'dataPath': (0, DataPath_1.DataPathToJSON)(value.dataPath), - 'definition': (0, DatasetDefinition_1.DatasetDefinitionToJSON)(value.definition), + 'dataPath': (0, DataPath_1.DataPathToJSON)(value['dataPath']), + 'definition': (0, DatasetDefinition_1.DatasetDefinitionToJSON)(value['definition']), }; } -exports.CreateDatasetToJSON = CreateDatasetToJSON; diff --git a/typescript/dist/models/CreateDatasetHandler200Response.d.ts b/typescript/dist/models/CreateDatasetHandler200Response.d.ts index 713bb809..162af55f 100644 --- a/typescript/dist/models/CreateDatasetHandler200Response.d.ts +++ b/typescript/dist/models/CreateDatasetHandler200Response.d.ts @@ -25,7 +25,8 @@ export interface CreateDatasetHandler200Response { /** * Check if a given object implements the CreateDatasetHandler200Response interface. */ -export declare function instanceOfCreateDatasetHandler200Response(value: object): boolean; +export declare function instanceOfCreateDatasetHandler200Response(value: object): value is CreateDatasetHandler200Response; export declare function CreateDatasetHandler200ResponseFromJSON(json: any): CreateDatasetHandler200Response; export declare function CreateDatasetHandler200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDatasetHandler200Response; -export declare function CreateDatasetHandler200ResponseToJSON(value?: CreateDatasetHandler200Response | null): any; +export declare function CreateDatasetHandler200ResponseToJSON(json: any): CreateDatasetHandler200Response; +export declare function CreateDatasetHandler200ResponseToJSONTyped(value?: CreateDatasetHandler200Response | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/CreateDatasetHandler200Response.js b/typescript/dist/models/CreateDatasetHandler200Response.js index 330a9ae4..b31593cf 100644 --- a/typescript/dist/models/CreateDatasetHandler200Response.js +++ b/typescript/dist/models/CreateDatasetHandler200Response.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.CreateDatasetHandler200ResponseToJSON = exports.CreateDatasetHandler200ResponseFromJSONTyped = exports.CreateDatasetHandler200ResponseFromJSON = exports.instanceOfCreateDatasetHandler200Response = void 0; +exports.instanceOfCreateDatasetHandler200Response = instanceOfCreateDatasetHandler200Response; +exports.CreateDatasetHandler200ResponseFromJSON = CreateDatasetHandler200ResponseFromJSON; +exports.CreateDatasetHandler200ResponseFromJSONTyped = CreateDatasetHandler200ResponseFromJSONTyped; +exports.CreateDatasetHandler200ResponseToJSON = CreateDatasetHandler200ResponseToJSON; +exports.CreateDatasetHandler200ResponseToJSONTyped = CreateDatasetHandler200ResponseToJSONTyped; /** * Check if a given object implements the CreateDatasetHandler200Response interface. */ function instanceOfCreateDatasetHandler200Response(value) { - let isInstance = true; - isInstance = isInstance && "datasetName" in value; - return isInstance; + if (!('datasetName' in value) || value['datasetName'] === undefined) + return false; + return true; } -exports.instanceOfCreateDatasetHandler200Response = instanceOfCreateDatasetHandler200Response; function CreateDatasetHandler200ResponseFromJSON(json) { return CreateDatasetHandler200ResponseFromJSONTyped(json, false); } -exports.CreateDatasetHandler200ResponseFromJSON = CreateDatasetHandler200ResponseFromJSON; function CreateDatasetHandler200ResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'datasetName': json['datasetName'], }; } -exports.CreateDatasetHandler200ResponseFromJSONTyped = CreateDatasetHandler200ResponseFromJSONTyped; -function CreateDatasetHandler200ResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function CreateDatasetHandler200ResponseToJSON(json) { + return CreateDatasetHandler200ResponseToJSONTyped(json, false); +} +function CreateDatasetHandler200ResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'datasetName': value.datasetName, + 'datasetName': value['datasetName'], }; } -exports.CreateDatasetHandler200ResponseToJSON = CreateDatasetHandler200ResponseToJSON; diff --git a/typescript/dist/models/CreateProject.d.ts b/typescript/dist/models/CreateProject.d.ts index 597e2766..f1dcd7dc 100644 --- a/typescript/dist/models/CreateProject.d.ts +++ b/typescript/dist/models/CreateProject.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { STRectangle } from './STRectangle'; import type { TimeStep } from './TimeStep'; +import type { STRectangle } from './STRectangle'; /** * * @export @@ -45,7 +45,8 @@ export interface CreateProject { /** * Check if a given object implements the CreateProject interface. */ -export declare function instanceOfCreateProject(value: object): boolean; +export declare function instanceOfCreateProject(value: object): value is CreateProject; export declare function CreateProjectFromJSON(json: any): CreateProject; export declare function CreateProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateProject; -export declare function CreateProjectToJSON(value?: CreateProject | null): any; +export declare function CreateProjectToJSON(json: any): CreateProject; +export declare function CreateProjectToJSONTyped(value?: CreateProject | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/CreateProject.js b/typescript/dist/models/CreateProject.js index 14127738..2eedb3c5 100644 --- a/typescript/dist/models/CreateProject.js +++ b/typescript/dist/models/CreateProject.js @@ -13,49 +13,50 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.CreateProjectToJSON = exports.CreateProjectFromJSONTyped = exports.CreateProjectFromJSON = exports.instanceOfCreateProject = void 0; -const runtime_1 = require("../runtime"); -const STRectangle_1 = require("./STRectangle"); +exports.instanceOfCreateProject = instanceOfCreateProject; +exports.CreateProjectFromJSON = CreateProjectFromJSON; +exports.CreateProjectFromJSONTyped = CreateProjectFromJSONTyped; +exports.CreateProjectToJSON = CreateProjectToJSON; +exports.CreateProjectToJSONTyped = CreateProjectToJSONTyped; const TimeStep_1 = require("./TimeStep"); +const STRectangle_1 = require("./STRectangle"); /** * Check if a given object implements the CreateProject interface. */ function instanceOfCreateProject(value) { - let isInstance = true; - isInstance = isInstance && "bounds" in value; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('bounds' in value) || value['bounds'] === undefined) + return false; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } -exports.instanceOfCreateProject = instanceOfCreateProject; function CreateProjectFromJSON(json) { return CreateProjectFromJSONTyped(json, false); } -exports.CreateProjectFromJSON = CreateProjectFromJSON; function CreateProjectFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bounds': (0, STRectangle_1.STRectangleFromJSON)(json['bounds']), 'description': json['description'], 'name': json['name'], - 'timeStep': !(0, runtime_1.exists)(json, 'timeStep') ? undefined : (0, TimeStep_1.TimeStepFromJSON)(json['timeStep']), + 'timeStep': json['timeStep'] == null ? undefined : (0, TimeStep_1.TimeStepFromJSON)(json['timeStep']), }; } -exports.CreateProjectFromJSONTyped = CreateProjectFromJSONTyped; -function CreateProjectToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function CreateProjectToJSON(json) { + return CreateProjectToJSONTyped(json, false); +} +function CreateProjectToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bounds': (0, STRectangle_1.STRectangleToJSON)(value.bounds), - 'description': value.description, - 'name': value.name, - 'timeStep': (0, TimeStep_1.TimeStepToJSON)(value.timeStep), + 'bounds': (0, STRectangle_1.STRectangleToJSON)(value['bounds']), + 'description': value['description'], + 'name': value['name'], + 'timeStep': (0, TimeStep_1.TimeStepToJSON)(value['timeStep']), }; } -exports.CreateProjectToJSON = CreateProjectToJSON; diff --git a/typescript/dist/models/CsvHeader.d.ts b/typescript/dist/models/CsvHeader.d.ts index eeed3dbc..70b4f799 100644 --- a/typescript/dist/models/CsvHeader.d.ts +++ b/typescript/dist/models/CsvHeader.d.ts @@ -19,6 +19,8 @@ export declare const CsvHeader: { readonly Auto: "auto"; }; export type CsvHeader = typeof CsvHeader[keyof typeof CsvHeader]; +export declare function instanceOfCsvHeader(value: any): boolean; export declare function CsvHeaderFromJSON(json: any): CsvHeader; export declare function CsvHeaderFromJSONTyped(json: any, ignoreDiscriminator: boolean): CsvHeader; export declare function CsvHeaderToJSON(value?: CsvHeader | null): any; +export declare function CsvHeaderToJSONTyped(value: any, ignoreDiscriminator: boolean): CsvHeader; diff --git a/typescript/dist/models/CsvHeader.js b/typescript/dist/models/CsvHeader.js index 410ccc0a..7a51c670 100644 --- a/typescript/dist/models/CsvHeader.js +++ b/typescript/dist/models/CsvHeader.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.CsvHeaderToJSON = exports.CsvHeaderFromJSONTyped = exports.CsvHeaderFromJSON = exports.CsvHeader = void 0; +exports.CsvHeader = void 0; +exports.instanceOfCsvHeader = instanceOfCsvHeader; +exports.CsvHeaderFromJSON = CsvHeaderFromJSON; +exports.CsvHeaderFromJSONTyped = CsvHeaderFromJSONTyped; +exports.CsvHeaderToJSON = CsvHeaderToJSON; +exports.CsvHeaderToJSONTyped = CsvHeaderToJSONTyped; /** * * @export @@ -23,15 +28,25 @@ exports.CsvHeader = { No: 'no', Auto: 'auto' }; +function instanceOfCsvHeader(value) { + for (const key in exports.CsvHeader) { + if (Object.prototype.hasOwnProperty.call(exports.CsvHeader, key)) { + if (exports.CsvHeader[key] === value) { + return true; + } + } + } + return false; +} function CsvHeaderFromJSON(json) { return CsvHeaderFromJSONTyped(json, false); } -exports.CsvHeaderFromJSON = CsvHeaderFromJSON; function CsvHeaderFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.CsvHeaderFromJSONTyped = CsvHeaderFromJSONTyped; function CsvHeaderToJSON(value) { return value; } -exports.CsvHeaderToJSON = CsvHeaderToJSON; +function CsvHeaderToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/DataId.d.ts b/typescript/dist/models/DataId.d.ts index ab01e7ea..730c86e1 100644 --- a/typescript/dist/models/DataId.d.ts +++ b/typescript/dist/models/DataId.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ExternalDataId } from './ExternalDataId'; -import { InternalDataId } from './InternalDataId'; +import type { ExternalDataId } from './ExternalDataId'; +import type { InternalDataId } from './InternalDataId'; /** * @type DataId * @@ -23,4 +23,5 @@ export type DataId = { } & InternalDataId; export declare function DataIdFromJSON(json: any): DataId; export declare function DataIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataId; -export declare function DataIdToJSON(value?: DataId | null): any; +export declare function DataIdToJSON(json: any): any; +export declare function DataIdToJSONTyped(value?: DataId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DataId.js b/typescript/dist/models/DataId.js index b869fbbe..70ec67b4 100644 --- a/typescript/dist/models/DataId.js +++ b/typescript/dist/models/DataId.js @@ -13,41 +13,41 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DataIdToJSON = exports.DataIdFromJSONTyped = exports.DataIdFromJSON = void 0; +exports.DataIdFromJSON = DataIdFromJSON; +exports.DataIdFromJSONTyped = DataIdFromJSONTyped; +exports.DataIdToJSON = DataIdToJSON; +exports.DataIdToJSONTyped = DataIdToJSONTyped; const ExternalDataId_1 = require("./ExternalDataId"); const InternalDataId_1 = require("./InternalDataId"); function DataIdFromJSON(json) { return DataIdFromJSONTyped(json, false); } -exports.DataIdFromJSON = DataIdFromJSON; function DataIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'external': - return Object.assign(Object.assign({}, (0, ExternalDataId_1.ExternalDataIdFromJSONTyped)(json, true)), { type: 'external' }); + return Object.assign({}, (0, ExternalDataId_1.ExternalDataIdFromJSONTyped)(json, true), { type: 'external' }); case 'internal': - return Object.assign(Object.assign({}, (0, InternalDataId_1.InternalDataIdFromJSONTyped)(json, true)), { type: 'internal' }); + return Object.assign({}, (0, InternalDataId_1.InternalDataIdFromJSONTyped)(json, true), { type: 'internal' }); default: throw new Error(`No variant of DataId exists with 'type=${json['type']}'`); } } -exports.DataIdFromJSONTyped = DataIdFromJSONTyped; -function DataIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DataIdToJSON(json) { + return DataIdToJSONTyped(json, false); +} +function DataIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'external': - return (0, ExternalDataId_1.ExternalDataIdToJSON)(value); + return Object.assign({}, (0, ExternalDataId_1.ExternalDataIdToJSON)(value), { type: 'external' }); case 'internal': - return (0, InternalDataId_1.InternalDataIdToJSON)(value); + return Object.assign({}, (0, InternalDataId_1.InternalDataIdToJSON)(value), { type: 'internal' }); default: throw new Error(`No variant of DataId exists with 'type=${value['type']}'`); } } -exports.DataIdToJSON = DataIdToJSON; diff --git a/typescript/dist/models/DataPath.d.ts b/typescript/dist/models/DataPath.d.ts index be15a3a0..b1f02bce 100644 --- a/typescript/dist/models/DataPath.d.ts +++ b/typescript/dist/models/DataPath.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DataPathOneOf } from './DataPathOneOf'; -import { DataPathOneOf1 } from './DataPathOneOf1'; +import type { DataPathOneOf } from './DataPathOneOf'; +import type { DataPathOneOf1 } from './DataPathOneOf1'; /** * @type DataPath * @@ -19,4 +19,5 @@ import { DataPathOneOf1 } from './DataPathOneOf1'; export type DataPath = DataPathOneOf | DataPathOneOf1; export declare function DataPathFromJSON(json: any): DataPath; export declare function DataPathFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataPath; -export declare function DataPathToJSON(value?: DataPath | null): any; +export declare function DataPathToJSON(json: any): any; +export declare function DataPathToJSONTyped(value?: DataPath | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DataPath.js b/typescript/dist/models/DataPath.js index 8984cfb4..45fe8f54 100644 --- a/typescript/dist/models/DataPath.js +++ b/typescript/dist/models/DataPath.js @@ -13,26 +13,33 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DataPathToJSON = exports.DataPathFromJSONTyped = exports.DataPathFromJSON = void 0; +exports.DataPathFromJSON = DataPathFromJSON; +exports.DataPathFromJSONTyped = DataPathFromJSONTyped; +exports.DataPathToJSON = DataPathToJSON; +exports.DataPathToJSONTyped = DataPathToJSONTyped; const DataPathOneOf_1 = require("./DataPathOneOf"); const DataPathOneOf1_1 = require("./DataPathOneOf1"); function DataPathFromJSON(json) { return DataPathFromJSONTyped(json, false); } -exports.DataPathFromJSON = DataPathFromJSON; function DataPathFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - return Object.assign(Object.assign({}, (0, DataPathOneOf_1.DataPathOneOfFromJSONTyped)(json, true)), (0, DataPathOneOf1_1.DataPathOneOf1FromJSONTyped)(json, true)); -} -exports.DataPathFromJSONTyped = DataPathFromJSONTyped; -function DataPathToJSON(value) { - if (value === undefined) { - return undefined; + if ((0, DataPathOneOf_1.instanceOfDataPathOneOf)(json)) { + return (0, DataPathOneOf_1.DataPathOneOfFromJSONTyped)(json, true); } - if (value === null) { - return null; + if ((0, DataPathOneOf1_1.instanceOfDataPathOneOf1)(json)) { + return (0, DataPathOneOf1_1.DataPathOneOf1FromJSONTyped)(json, true); + } + return {}; +} +function DataPathToJSON(json) { + return DataPathToJSONTyped(json, false); +} +function DataPathToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } if ((0, DataPathOneOf_1.instanceOfDataPathOneOf)(value)) { return (0, DataPathOneOf_1.DataPathOneOfToJSON)(value); @@ -42,4 +49,3 @@ function DataPathToJSON(value) { } return {}; } -exports.DataPathToJSON = DataPathToJSON; diff --git a/typescript/dist/models/DataPathOneOf.d.ts b/typescript/dist/models/DataPathOneOf.d.ts index b0816be4..5182804a 100644 --- a/typescript/dist/models/DataPathOneOf.d.ts +++ b/typescript/dist/models/DataPathOneOf.d.ts @@ -25,7 +25,8 @@ export interface DataPathOneOf { /** * Check if a given object implements the DataPathOneOf interface. */ -export declare function instanceOfDataPathOneOf(value: object): boolean; +export declare function instanceOfDataPathOneOf(value: object): value is DataPathOneOf; export declare function DataPathOneOfFromJSON(json: any): DataPathOneOf; export declare function DataPathOneOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataPathOneOf; -export declare function DataPathOneOfToJSON(value?: DataPathOneOf | null): any; +export declare function DataPathOneOfToJSON(json: any): DataPathOneOf; +export declare function DataPathOneOfToJSONTyped(value?: DataPathOneOf | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DataPathOneOf.js b/typescript/dist/models/DataPathOneOf.js index f55c11b6..ae756525 100644 --- a/typescript/dist/models/DataPathOneOf.js +++ b/typescript/dist/models/DataPathOneOf.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DataPathOneOfToJSON = exports.DataPathOneOfFromJSONTyped = exports.DataPathOneOfFromJSON = exports.instanceOfDataPathOneOf = void 0; +exports.instanceOfDataPathOneOf = instanceOfDataPathOneOf; +exports.DataPathOneOfFromJSON = DataPathOneOfFromJSON; +exports.DataPathOneOfFromJSONTyped = DataPathOneOfFromJSONTyped; +exports.DataPathOneOfToJSON = DataPathOneOfToJSON; +exports.DataPathOneOfToJSONTyped = DataPathOneOfToJSONTyped; /** * Check if a given object implements the DataPathOneOf interface. */ function instanceOfDataPathOneOf(value) { - let isInstance = true; - isInstance = isInstance && "volume" in value; - return isInstance; + if (!('volume' in value) || value['volume'] === undefined) + return false; + return true; } -exports.instanceOfDataPathOneOf = instanceOfDataPathOneOf; function DataPathOneOfFromJSON(json) { return DataPathOneOfFromJSONTyped(json, false); } -exports.DataPathOneOfFromJSON = DataPathOneOfFromJSON; function DataPathOneOfFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'volume': json['volume'], }; } -exports.DataPathOneOfFromJSONTyped = DataPathOneOfFromJSONTyped; -function DataPathOneOfToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DataPathOneOfToJSON(json) { + return DataPathOneOfToJSONTyped(json, false); +} +function DataPathOneOfToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'volume': value.volume, + 'volume': value['volume'], }; } -exports.DataPathOneOfToJSON = DataPathOneOfToJSON; diff --git a/typescript/dist/models/DataPathOneOf1.d.ts b/typescript/dist/models/DataPathOneOf1.d.ts index 31d20891..94767d68 100644 --- a/typescript/dist/models/DataPathOneOf1.d.ts +++ b/typescript/dist/models/DataPathOneOf1.d.ts @@ -25,7 +25,8 @@ export interface DataPathOneOf1 { /** * Check if a given object implements the DataPathOneOf1 interface. */ -export declare function instanceOfDataPathOneOf1(value: object): boolean; +export declare function instanceOfDataPathOneOf1(value: object): value is DataPathOneOf1; export declare function DataPathOneOf1FromJSON(json: any): DataPathOneOf1; export declare function DataPathOneOf1FromJSONTyped(json: any, ignoreDiscriminator: boolean): DataPathOneOf1; -export declare function DataPathOneOf1ToJSON(value?: DataPathOneOf1 | null): any; +export declare function DataPathOneOf1ToJSON(json: any): DataPathOneOf1; +export declare function DataPathOneOf1ToJSONTyped(value?: DataPathOneOf1 | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DataPathOneOf1.js b/typescript/dist/models/DataPathOneOf1.js index 2a6bd637..65cedafa 100644 --- a/typescript/dist/models/DataPathOneOf1.js +++ b/typescript/dist/models/DataPathOneOf1.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DataPathOneOf1ToJSON = exports.DataPathOneOf1FromJSONTyped = exports.DataPathOneOf1FromJSON = exports.instanceOfDataPathOneOf1 = void 0; +exports.instanceOfDataPathOneOf1 = instanceOfDataPathOneOf1; +exports.DataPathOneOf1FromJSON = DataPathOneOf1FromJSON; +exports.DataPathOneOf1FromJSONTyped = DataPathOneOf1FromJSONTyped; +exports.DataPathOneOf1ToJSON = DataPathOneOf1ToJSON; +exports.DataPathOneOf1ToJSONTyped = DataPathOneOf1ToJSONTyped; /** * Check if a given object implements the DataPathOneOf1 interface. */ function instanceOfDataPathOneOf1(value) { - let isInstance = true; - isInstance = isInstance && "upload" in value; - return isInstance; + if (!('upload' in value) || value['upload'] === undefined) + return false; + return true; } -exports.instanceOfDataPathOneOf1 = instanceOfDataPathOneOf1; function DataPathOneOf1FromJSON(json) { return DataPathOneOf1FromJSONTyped(json, false); } -exports.DataPathOneOf1FromJSON = DataPathOneOf1FromJSON; function DataPathOneOf1FromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'upload': json['upload'], }; } -exports.DataPathOneOf1FromJSONTyped = DataPathOneOf1FromJSONTyped; -function DataPathOneOf1ToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DataPathOneOf1ToJSON(json) { + return DataPathOneOf1ToJSONTyped(json, false); +} +function DataPathOneOf1ToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'upload': value.upload, + 'upload': value['upload'], }; } -exports.DataPathOneOf1ToJSON = DataPathOneOf1ToJSON; diff --git a/typescript/dist/models/DataUsage.d.ts b/typescript/dist/models/DataUsage.d.ts index e4d2035e..c406d613 100644 --- a/typescript/dist/models/DataUsage.d.ts +++ b/typescript/dist/models/DataUsage.d.ts @@ -49,7 +49,8 @@ export interface DataUsage { /** * Check if a given object implements the DataUsage interface. */ -export declare function instanceOfDataUsage(value: object): boolean; +export declare function instanceOfDataUsage(value: object): value is DataUsage; export declare function DataUsageFromJSON(json: any): DataUsage; export declare function DataUsageFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataUsage; -export declare function DataUsageToJSON(value?: DataUsage | null): any; +export declare function DataUsageToJSON(json: any): DataUsage; +export declare function DataUsageToJSONTyped(value?: DataUsage | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DataUsage.js b/typescript/dist/models/DataUsage.js index b9a1440a..aafdb75e 100644 --- a/typescript/dist/models/DataUsage.js +++ b/typescript/dist/models/DataUsage.js @@ -13,26 +13,32 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DataUsageToJSON = exports.DataUsageFromJSONTyped = exports.DataUsageFromJSON = exports.instanceOfDataUsage = void 0; +exports.instanceOfDataUsage = instanceOfDataUsage; +exports.DataUsageFromJSON = DataUsageFromJSON; +exports.DataUsageFromJSONTyped = DataUsageFromJSONTyped; +exports.DataUsageToJSON = DataUsageToJSON; +exports.DataUsageToJSONTyped = DataUsageToJSONTyped; /** * Check if a given object implements the DataUsage interface. */ function instanceOfDataUsage(value) { - let isInstance = true; - isInstance = isInstance && "computationId" in value; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "timestamp" in value; - isInstance = isInstance && "userId" in value; - return isInstance; + if (!('computationId' in value) || value['computationId'] === undefined) + return false; + if (!('count' in value) || value['count'] === undefined) + return false; + if (!('data' in value) || value['data'] === undefined) + return false; + if (!('timestamp' in value) || value['timestamp'] === undefined) + return false; + if (!('userId' in value) || value['userId'] === undefined) + return false; + return true; } -exports.instanceOfDataUsage = instanceOfDataUsage; function DataUsageFromJSON(json) { return DataUsageFromJSONTyped(json, false); } -exports.DataUsageFromJSON = DataUsageFromJSON; function DataUsageFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,20 +49,18 @@ function DataUsageFromJSONTyped(json, ignoreDiscriminator) { 'userId': json['userId'], }; } -exports.DataUsageFromJSONTyped = DataUsageFromJSONTyped; -function DataUsageToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DataUsageToJSON(json) { + return DataUsageToJSONTyped(json, false); +} +function DataUsageToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'computationId': value.computationId, - 'count': value.count, - 'data': value.data, - 'timestamp': (value.timestamp.toISOString()), - 'userId': value.userId, + 'computationId': value['computationId'], + 'count': value['count'], + 'data': value['data'], + 'timestamp': ((value['timestamp']).toISOString()), + 'userId': value['userId'], }; } -exports.DataUsageToJSON = DataUsageToJSON; diff --git a/typescript/dist/models/DataUsageSummary.d.ts b/typescript/dist/models/DataUsageSummary.d.ts index 37c28d1a..818080e3 100644 --- a/typescript/dist/models/DataUsageSummary.d.ts +++ b/typescript/dist/models/DataUsageSummary.d.ts @@ -37,7 +37,8 @@ export interface DataUsageSummary { /** * Check if a given object implements the DataUsageSummary interface. */ -export declare function instanceOfDataUsageSummary(value: object): boolean; +export declare function instanceOfDataUsageSummary(value: object): value is DataUsageSummary; export declare function DataUsageSummaryFromJSON(json: any): DataUsageSummary; export declare function DataUsageSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataUsageSummary; -export declare function DataUsageSummaryToJSON(value?: DataUsageSummary | null): any; +export declare function DataUsageSummaryToJSON(json: any): DataUsageSummary; +export declare function DataUsageSummaryToJSONTyped(value?: DataUsageSummary | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DataUsageSummary.js b/typescript/dist/models/DataUsageSummary.js index 8f6063fe..b5321c7c 100644 --- a/typescript/dist/models/DataUsageSummary.js +++ b/typescript/dist/models/DataUsageSummary.js @@ -13,24 +13,28 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DataUsageSummaryToJSON = exports.DataUsageSummaryFromJSONTyped = exports.DataUsageSummaryFromJSON = exports.instanceOfDataUsageSummary = void 0; +exports.instanceOfDataUsageSummary = instanceOfDataUsageSummary; +exports.DataUsageSummaryFromJSON = DataUsageSummaryFromJSON; +exports.DataUsageSummaryFromJSONTyped = DataUsageSummaryFromJSONTyped; +exports.DataUsageSummaryToJSON = DataUsageSummaryToJSON; +exports.DataUsageSummaryToJSONTyped = DataUsageSummaryToJSONTyped; /** * Check if a given object implements the DataUsageSummary interface. */ function instanceOfDataUsageSummary(value) { - let isInstance = true; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "timestamp" in value; - return isInstance; + if (!('count' in value) || value['count'] === undefined) + return false; + if (!('data' in value) || value['data'] === undefined) + return false; + if (!('timestamp' in value) || value['timestamp'] === undefined) + return false; + return true; } -exports.instanceOfDataUsageSummary = instanceOfDataUsageSummary; function DataUsageSummaryFromJSON(json) { return DataUsageSummaryFromJSONTyped(json, false); } -exports.DataUsageSummaryFromJSON = DataUsageSummaryFromJSON; function DataUsageSummaryFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,18 +43,16 @@ function DataUsageSummaryFromJSONTyped(json, ignoreDiscriminator) { 'timestamp': (new Date(json['timestamp'])), }; } -exports.DataUsageSummaryFromJSONTyped = DataUsageSummaryFromJSONTyped; -function DataUsageSummaryToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DataUsageSummaryToJSON(json) { + return DataUsageSummaryToJSONTyped(json, false); +} +function DataUsageSummaryToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'count': value.count, - 'data': value.data, - 'timestamp': (value.timestamp.toISOString()), + 'count': value['count'], + 'data': value['data'], + 'timestamp': ((value['timestamp']).toISOString()), }; } -exports.DataUsageSummaryToJSON = DataUsageSummaryToJSON; diff --git a/typescript/dist/models/Dataset.d.ts b/typescript/dist/models/Dataset.d.ts index 91ca3554..5dd433f5 100644 --- a/typescript/dist/models/Dataset.d.ts +++ b/typescript/dist/models/Dataset.d.ts @@ -76,7 +76,8 @@ export interface Dataset { /** * Check if a given object implements the Dataset interface. */ -export declare function instanceOfDataset(value: object): boolean; +export declare function instanceOfDataset(value: object): value is Dataset; export declare function DatasetFromJSON(json: any): Dataset; export declare function DatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Dataset; -export declare function DatasetToJSON(value?: Dataset | null): any; +export declare function DatasetToJSON(json: any): Dataset; +export declare function DatasetToJSONTyped(value?: Dataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Dataset.js b/typescript/dist/models/Dataset.js index bb2b3e11..f172d4ed 100644 --- a/typescript/dist/models/Dataset.js +++ b/typescript/dist/models/Dataset.js @@ -13,8 +13,11 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DatasetToJSON = exports.DatasetFromJSONTyped = exports.DatasetFromJSON = exports.instanceOfDataset = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfDataset = instanceOfDataset; +exports.DatasetFromJSON = DatasetFromJSON; +exports.DatasetFromJSONTyped = DatasetFromJSONTyped; +exports.DatasetToJSON = DatasetToJSON; +exports.DatasetToJSONTyped = DatasetToJSONTyped; const Provenance_1 = require("./Provenance"); const Symbology_1 = require("./Symbology"); const TypedResultDescriptor_1 = require("./TypedResultDescriptor"); @@ -22,22 +25,25 @@ const TypedResultDescriptor_1 = require("./TypedResultDescriptor"); * Check if a given object implements the Dataset interface. */ function instanceOfDataset(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "sourceOperator" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('sourceOperator' in value) || value['sourceOperator'] === undefined) + return false; + return true; } -exports.instanceOfDataset = instanceOfDataset; function DatasetFromJSON(json) { return DatasetFromJSONTyped(json, false); } -exports.DatasetFromJSON = DatasetFromJSON; function DatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -45,31 +51,29 @@ function DatasetFromJSONTyped(json, ignoreDiscriminator) { 'displayName': json['displayName'], 'id': json['id'], 'name': json['name'], - 'provenance': !(0, runtime_1.exists)(json, 'provenance') ? undefined : (json['provenance'] === null ? null : json['provenance'].map(Provenance_1.ProvenanceFromJSON)), + 'provenance': json['provenance'] == null ? undefined : (json['provenance'].map(Provenance_1.ProvenanceFromJSON)), 'resultDescriptor': (0, TypedResultDescriptor_1.TypedResultDescriptorFromJSON)(json['resultDescriptor']), 'sourceOperator': json['sourceOperator'], - 'symbology': !(0, runtime_1.exists)(json, 'symbology') ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), - 'tags': !(0, runtime_1.exists)(json, 'tags') ? undefined : json['tags'], + 'symbology': json['symbology'] == null ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), + 'tags': json['tags'] == null ? undefined : json['tags'], }; } -exports.DatasetFromJSONTyped = DatasetFromJSONTyped; -function DatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DatasetToJSON(json) { + return DatasetToJSONTyped(json, false); +} +function DatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'displayName': value.displayName, - 'id': value.id, - 'name': value.name, - 'provenance': value.provenance === undefined ? undefined : (value.provenance === null ? null : value.provenance.map(Provenance_1.ProvenanceToJSON)), - 'resultDescriptor': (0, TypedResultDescriptor_1.TypedResultDescriptorToJSON)(value.resultDescriptor), - 'sourceOperator': value.sourceOperator, - 'symbology': (0, Symbology_1.SymbologyToJSON)(value.symbology), - 'tags': value.tags, + 'description': value['description'], + 'displayName': value['displayName'], + 'id': value['id'], + 'name': value['name'], + 'provenance': value['provenance'] == null ? undefined : (value['provenance'].map(Provenance_1.ProvenanceToJSON)), + 'resultDescriptor': (0, TypedResultDescriptor_1.TypedResultDescriptorToJSON)(value['resultDescriptor']), + 'sourceOperator': value['sourceOperator'], + 'symbology': (0, Symbology_1.SymbologyToJSON)(value['symbology']), + 'tags': value['tags'], }; } -exports.DatasetToJSON = DatasetToJSON; diff --git a/typescript/dist/models/DatasetDefinition.d.ts b/typescript/dist/models/DatasetDefinition.d.ts index 5f645eec..4ff6160a 100644 --- a/typescript/dist/models/DatasetDefinition.d.ts +++ b/typescript/dist/models/DatasetDefinition.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { AddDataset } from './AddDataset'; import type { MetaDataDefinition } from './MetaDataDefinition'; +import type { AddDataset } from './AddDataset'; /** * * @export @@ -33,7 +33,8 @@ export interface DatasetDefinition { /** * Check if a given object implements the DatasetDefinition interface. */ -export declare function instanceOfDatasetDefinition(value: object): boolean; +export declare function instanceOfDatasetDefinition(value: object): value is DatasetDefinition; export declare function DatasetDefinitionFromJSON(json: any): DatasetDefinition; export declare function DatasetDefinitionFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatasetDefinition; -export declare function DatasetDefinitionToJSON(value?: DatasetDefinition | null): any; +export declare function DatasetDefinitionToJSON(json: any): DatasetDefinition; +export declare function DatasetDefinitionToJSONTyped(value?: DatasetDefinition | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DatasetDefinition.js b/typescript/dist/models/DatasetDefinition.js index af46c2a9..a97f04f6 100644 --- a/typescript/dist/models/DatasetDefinition.js +++ b/typescript/dist/models/DatasetDefinition.js @@ -13,25 +13,28 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DatasetDefinitionToJSON = exports.DatasetDefinitionFromJSONTyped = exports.DatasetDefinitionFromJSON = exports.instanceOfDatasetDefinition = void 0; -const AddDataset_1 = require("./AddDataset"); +exports.instanceOfDatasetDefinition = instanceOfDatasetDefinition; +exports.DatasetDefinitionFromJSON = DatasetDefinitionFromJSON; +exports.DatasetDefinitionFromJSONTyped = DatasetDefinitionFromJSONTyped; +exports.DatasetDefinitionToJSON = DatasetDefinitionToJSON; +exports.DatasetDefinitionToJSONTyped = DatasetDefinitionToJSONTyped; const MetaDataDefinition_1 = require("./MetaDataDefinition"); +const AddDataset_1 = require("./AddDataset"); /** * Check if a given object implements the DatasetDefinition interface. */ function instanceOfDatasetDefinition(value) { - let isInstance = true; - isInstance = isInstance && "metaData" in value; - isInstance = isInstance && "properties" in value; - return isInstance; + if (!('metaData' in value) || value['metaData'] === undefined) + return false; + if (!('properties' in value) || value['properties'] === undefined) + return false; + return true; } -exports.instanceOfDatasetDefinition = instanceOfDatasetDefinition; function DatasetDefinitionFromJSON(json) { return DatasetDefinitionFromJSONTyped(json, false); } -exports.DatasetDefinitionFromJSON = DatasetDefinitionFromJSON; function DatasetDefinitionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,17 +42,15 @@ function DatasetDefinitionFromJSONTyped(json, ignoreDiscriminator) { 'properties': (0, AddDataset_1.AddDatasetFromJSON)(json['properties']), }; } -exports.DatasetDefinitionFromJSONTyped = DatasetDefinitionFromJSONTyped; -function DatasetDefinitionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DatasetDefinitionToJSON(json) { + return DatasetDefinitionToJSONTyped(json, false); +} +function DatasetDefinitionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'metaData': (0, MetaDataDefinition_1.MetaDataDefinitionToJSON)(value.metaData), - 'properties': (0, AddDataset_1.AddDatasetToJSON)(value.properties), + 'metaData': (0, MetaDataDefinition_1.MetaDataDefinitionToJSON)(value['metaData']), + 'properties': (0, AddDataset_1.AddDatasetToJSON)(value['properties']), }; } -exports.DatasetDefinitionToJSON = DatasetDefinitionToJSON; diff --git a/typescript/dist/models/DatasetListing.d.ts b/typescript/dist/models/DatasetListing.d.ts index f5c590ad..01328add 100644 --- a/typescript/dist/models/DatasetListing.d.ts +++ b/typescript/dist/models/DatasetListing.d.ts @@ -69,7 +69,8 @@ export interface DatasetListing { /** * Check if a given object implements the DatasetListing interface. */ -export declare function instanceOfDatasetListing(value: object): boolean; +export declare function instanceOfDatasetListing(value: object): value is DatasetListing; export declare function DatasetListingFromJSON(json: any): DatasetListing; export declare function DatasetListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatasetListing; -export declare function DatasetListingToJSON(value?: DatasetListing | null): any; +export declare function DatasetListingToJSON(json: any): DatasetListing; +export declare function DatasetListingToJSONTyped(value?: DatasetListing | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DatasetListing.js b/typescript/dist/models/DatasetListing.js index 86048f20..28716955 100644 --- a/typescript/dist/models/DatasetListing.js +++ b/typescript/dist/models/DatasetListing.js @@ -13,31 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DatasetListingToJSON = exports.DatasetListingFromJSONTyped = exports.DatasetListingFromJSON = exports.instanceOfDatasetListing = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfDatasetListing = instanceOfDatasetListing; +exports.DatasetListingFromJSON = DatasetListingFromJSON; +exports.DatasetListingFromJSONTyped = DatasetListingFromJSONTyped; +exports.DatasetListingToJSON = DatasetListingToJSON; +exports.DatasetListingToJSONTyped = DatasetListingToJSONTyped; const Symbology_1 = require("./Symbology"); const TypedResultDescriptor_1 = require("./TypedResultDescriptor"); /** * Check if a given object implements the DatasetListing interface. */ function instanceOfDatasetListing(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "sourceOperator" in value; - isInstance = isInstance && "tags" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('sourceOperator' in value) || value['sourceOperator'] === undefined) + return false; + if (!('tags' in value) || value['tags'] === undefined) + return false; + return true; } -exports.instanceOfDatasetListing = instanceOfDatasetListing; function DatasetListingFromJSON(json) { return DatasetListingFromJSONTyped(json, false); } -exports.DatasetListingFromJSON = DatasetListingFromJSON; function DatasetListingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -47,27 +54,25 @@ function DatasetListingFromJSONTyped(json, ignoreDiscriminator) { 'name': json['name'], 'resultDescriptor': (0, TypedResultDescriptor_1.TypedResultDescriptorFromJSON)(json['resultDescriptor']), 'sourceOperator': json['sourceOperator'], - 'symbology': !(0, runtime_1.exists)(json, 'symbology') ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), + 'symbology': json['symbology'] == null ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), 'tags': json['tags'], }; } -exports.DatasetListingFromJSONTyped = DatasetListingFromJSONTyped; -function DatasetListingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DatasetListingToJSON(json) { + return DatasetListingToJSONTyped(json, false); +} +function DatasetListingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'displayName': value.displayName, - 'id': value.id, - 'name': value.name, - 'resultDescriptor': (0, TypedResultDescriptor_1.TypedResultDescriptorToJSON)(value.resultDescriptor), - 'sourceOperator': value.sourceOperator, - 'symbology': (0, Symbology_1.SymbologyToJSON)(value.symbology), - 'tags': value.tags, + 'description': value['description'], + 'displayName': value['displayName'], + 'id': value['id'], + 'name': value['name'], + 'resultDescriptor': (0, TypedResultDescriptor_1.TypedResultDescriptorToJSON)(value['resultDescriptor']), + 'sourceOperator': value['sourceOperator'], + 'symbology': (0, Symbology_1.SymbologyToJSON)(value['symbology']), + 'tags': value['tags'], }; } -exports.DatasetListingToJSON = DatasetListingToJSON; diff --git a/typescript/dist/models/DatasetResource.d.ts b/typescript/dist/models/DatasetResource.d.ts index b2267d2d..c9dc85e6 100644 --- a/typescript/dist/models/DatasetResource.d.ts +++ b/typescript/dist/models/DatasetResource.d.ts @@ -38,7 +38,8 @@ export type DatasetResourceTypeEnum = typeof DatasetResourceTypeEnum[keyof typeo /** * Check if a given object implements the DatasetResource interface. */ -export declare function instanceOfDatasetResource(value: object): boolean; +export declare function instanceOfDatasetResource(value: object): value is DatasetResource; export declare function DatasetResourceFromJSON(json: any): DatasetResource; export declare function DatasetResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatasetResource; -export declare function DatasetResourceToJSON(value?: DatasetResource | null): any; +export declare function DatasetResourceToJSON(json: any): DatasetResource; +export declare function DatasetResourceToJSONTyped(value?: DatasetResource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DatasetResource.js b/typescript/dist/models/DatasetResource.js index 3d1a4894..792ea0c0 100644 --- a/typescript/dist/models/DatasetResource.js +++ b/typescript/dist/models/DatasetResource.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DatasetResourceToJSON = exports.DatasetResourceFromJSONTyped = exports.DatasetResourceFromJSON = exports.instanceOfDatasetResource = exports.DatasetResourceTypeEnum = void 0; +exports.DatasetResourceTypeEnum = void 0; +exports.instanceOfDatasetResource = instanceOfDatasetResource; +exports.DatasetResourceFromJSON = DatasetResourceFromJSON; +exports.DatasetResourceFromJSONTyped = DatasetResourceFromJSONTyped; +exports.DatasetResourceToJSON = DatasetResourceToJSON; +exports.DatasetResourceToJSONTyped = DatasetResourceToJSONTyped; /** * @export */ @@ -24,18 +29,17 @@ exports.DatasetResourceTypeEnum = { * Check if a given object implements the DatasetResource interface. */ function instanceOfDatasetResource(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfDatasetResource = instanceOfDatasetResource; function DatasetResourceFromJSON(json) { return DatasetResourceFromJSONTyped(json, false); } -exports.DatasetResourceFromJSON = DatasetResourceFromJSON; function DatasetResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +47,15 @@ function DatasetResourceFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.DatasetResourceFromJSONTyped = DatasetResourceFromJSONTyped; -function DatasetResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DatasetResourceToJSON(json) { + return DatasetResourceToJSONTyped(json, false); +} +function DatasetResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } -exports.DatasetResourceToJSON = DatasetResourceToJSON; diff --git a/typescript/dist/models/DateTime.d.ts b/typescript/dist/models/DateTime.d.ts index 15f27d04..c0634073 100644 --- a/typescript/dist/models/DateTime.d.ts +++ b/typescript/dist/models/DateTime.d.ts @@ -25,7 +25,8 @@ export interface DateTime { /** * Check if a given object implements the DateTime interface. */ -export declare function instanceOfDateTime(value: object): boolean; +export declare function instanceOfDateTime(value: object): value is DateTime; export declare function DateTimeFromJSON(json: any): DateTime; export declare function DateTimeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DateTime; -export declare function DateTimeToJSON(value?: DateTime | null): any; +export declare function DateTimeToJSON(json: any): DateTime; +export declare function DateTimeToJSONTyped(value?: DateTime | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DateTime.js b/typescript/dist/models/DateTime.js index 18d7b38b..3308e4e0 100644 --- a/typescript/dist/models/DateTime.js +++ b/typescript/dist/models/DateTime.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DateTimeToJSON = exports.DateTimeFromJSONTyped = exports.DateTimeFromJSON = exports.instanceOfDateTime = void 0; +exports.instanceOfDateTime = instanceOfDateTime; +exports.DateTimeFromJSON = DateTimeFromJSON; +exports.DateTimeFromJSONTyped = DateTimeFromJSONTyped; +exports.DateTimeToJSON = DateTimeToJSON; +exports.DateTimeToJSONTyped = DateTimeToJSONTyped; /** * Check if a given object implements the DateTime interface. */ function instanceOfDateTime(value) { - let isInstance = true; - isInstance = isInstance && "datetime" in value; - return isInstance; + if (!('datetime' in value) || value['datetime'] === undefined) + return false; + return true; } -exports.instanceOfDateTime = instanceOfDateTime; function DateTimeFromJSON(json) { return DateTimeFromJSONTyped(json, false); } -exports.DateTimeFromJSON = DateTimeFromJSON; function DateTimeFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'datetime': (new Date(json['datetime'])), }; } -exports.DateTimeFromJSONTyped = DateTimeFromJSONTyped; -function DateTimeToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DateTimeToJSON(json) { + return DateTimeToJSONTyped(json, false); +} +function DateTimeToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'datetime': (value.datetime.toISOString()), + 'datetime': ((value['datetime']).toISOString()), }; } -exports.DateTimeToJSON = DateTimeToJSON; diff --git a/typescript/dist/models/DateTimeParseFormat.js b/typescript/dist/models/DateTimeParseFormat.js index 776bcf2b..7b69e798 100644 --- a/typescript/dist/models/DateTimeParseFormat.js +++ b/typescript/dist/models/DateTimeParseFormat.js @@ -13,7 +13,10 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DateTimeParseFormatToJSON = exports.DateTimeParseFormatFromJSONTyped = exports.DateTimeParseFormatFromJSON = exports.instanceOfDateTimeParseFormat = void 0; +exports.instanceOfDateTimeParseFormat = instanceOfDateTimeParseFormat; +exports.DateTimeParseFormatFromJSON = DateTimeParseFormatFromJSON; +exports.DateTimeParseFormatFromJSONTyped = DateTimeParseFormatFromJSONTyped; +exports.DateTimeParseFormatToJSON = DateTimeParseFormatToJSON; /** * Check if a given object implements the DateTimeParseFormat interface. */ @@ -24,11 +27,9 @@ function instanceOfDateTimeParseFormat(value) { isInstance = isInstance && "hasTz" in value; return isInstance; } -exports.instanceOfDateTimeParseFormat = instanceOfDateTimeParseFormat; function DateTimeParseFormatFromJSON(json) { return DateTimeParseFormatFromJSONTyped(json, false); } -exports.DateTimeParseFormatFromJSON = DateTimeParseFormatFromJSON; function DateTimeParseFormatFromJSONTyped(json, ignoreDiscriminator) { if ((json === undefined) || (json === null)) { return json; @@ -39,7 +40,6 @@ function DateTimeParseFormatFromJSONTyped(json, ignoreDiscriminator) { 'hasTz': json['has_tz'], }; } -exports.DateTimeParseFormatFromJSONTyped = DateTimeParseFormatFromJSONTyped; function DateTimeParseFormatToJSON(value) { if (value === undefined) { return undefined; @@ -53,4 +53,3 @@ function DateTimeParseFormatToJSON(value) { 'has_tz': value.hasTz, }; } -exports.DateTimeParseFormatToJSON = DateTimeParseFormatToJSON; diff --git a/typescript/dist/models/DerivedColor.d.ts b/typescript/dist/models/DerivedColor.d.ts index d704d4b7..4a4bed2c 100644 --- a/typescript/dist/models/DerivedColor.d.ts +++ b/typescript/dist/models/DerivedColor.d.ts @@ -45,7 +45,8 @@ export type DerivedColorTypeEnum = typeof DerivedColorTypeEnum[keyof typeof Deri /** * Check if a given object implements the DerivedColor interface. */ -export declare function instanceOfDerivedColor(value: object): boolean; +export declare function instanceOfDerivedColor(value: object): value is DerivedColor; export declare function DerivedColorFromJSON(json: any): DerivedColor; export declare function DerivedColorFromJSONTyped(json: any, ignoreDiscriminator: boolean): DerivedColor; -export declare function DerivedColorToJSON(value?: DerivedColor | null): any; +export declare function DerivedColorToJSON(json: any): DerivedColor; +export declare function DerivedColorToJSONTyped(value?: DerivedColor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DerivedColor.js b/typescript/dist/models/DerivedColor.js index 5c461584..9ce5a5de 100644 --- a/typescript/dist/models/DerivedColor.js +++ b/typescript/dist/models/DerivedColor.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DerivedColorToJSON = exports.DerivedColorFromJSONTyped = exports.DerivedColorFromJSON = exports.instanceOfDerivedColor = exports.DerivedColorTypeEnum = void 0; +exports.DerivedColorTypeEnum = void 0; +exports.instanceOfDerivedColor = instanceOfDerivedColor; +exports.DerivedColorFromJSON = DerivedColorFromJSON; +exports.DerivedColorFromJSONTyped = DerivedColorFromJSONTyped; +exports.DerivedColorToJSON = DerivedColorToJSON; +exports.DerivedColorToJSONTyped = DerivedColorToJSONTyped; const Colorizer_1 = require("./Colorizer"); /** * @export @@ -25,19 +30,19 @@ exports.DerivedColorTypeEnum = { * Check if a given object implements the DerivedColor interface. */ function instanceOfDerivedColor(value) { - let isInstance = true; - isInstance = isInstance && "attribute" in value; - isInstance = isInstance && "colorizer" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('attribute' in value) || value['attribute'] === undefined) + return false; + if (!('colorizer' in value) || value['colorizer'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfDerivedColor = instanceOfDerivedColor; function DerivedColorFromJSON(json) { return DerivedColorFromJSONTyped(json, false); } -exports.DerivedColorFromJSON = DerivedColorFromJSON; function DerivedColorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -46,18 +51,16 @@ function DerivedColorFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.DerivedColorFromJSONTyped = DerivedColorFromJSONTyped; -function DerivedColorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DerivedColorToJSON(json) { + return DerivedColorToJSONTyped(json, false); +} +function DerivedColorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'attribute': value.attribute, - 'colorizer': (0, Colorizer_1.ColorizerToJSON)(value.colorizer), - 'type': value.type, + 'attribute': value['attribute'], + 'colorizer': (0, Colorizer_1.ColorizerToJSON)(value['colorizer']), + 'type': value['type'], }; } -exports.DerivedColorToJSON = DerivedColorToJSON; diff --git a/typescript/dist/models/DerivedNumber.d.ts b/typescript/dist/models/DerivedNumber.d.ts index 6a21127b..33d8105b 100644 --- a/typescript/dist/models/DerivedNumber.d.ts +++ b/typescript/dist/models/DerivedNumber.d.ts @@ -50,7 +50,8 @@ export type DerivedNumberTypeEnum = typeof DerivedNumberTypeEnum[keyof typeof De /** * Check if a given object implements the DerivedNumber interface. */ -export declare function instanceOfDerivedNumber(value: object): boolean; +export declare function instanceOfDerivedNumber(value: object): value is DerivedNumber; export declare function DerivedNumberFromJSON(json: any): DerivedNumber; export declare function DerivedNumberFromJSONTyped(json: any, ignoreDiscriminator: boolean): DerivedNumber; -export declare function DerivedNumberToJSON(value?: DerivedNumber | null): any; +export declare function DerivedNumberToJSON(json: any): DerivedNumber; +export declare function DerivedNumberToJSONTyped(value?: DerivedNumber | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/DerivedNumber.js b/typescript/dist/models/DerivedNumber.js index 30f82699..83c4d1a0 100644 --- a/typescript/dist/models/DerivedNumber.js +++ b/typescript/dist/models/DerivedNumber.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DerivedNumberToJSON = exports.DerivedNumberFromJSONTyped = exports.DerivedNumberFromJSON = exports.instanceOfDerivedNumber = exports.DerivedNumberTypeEnum = void 0; +exports.DerivedNumberTypeEnum = void 0; +exports.instanceOfDerivedNumber = instanceOfDerivedNumber; +exports.DerivedNumberFromJSON = DerivedNumberFromJSON; +exports.DerivedNumberFromJSONTyped = DerivedNumberFromJSONTyped; +exports.DerivedNumberToJSON = DerivedNumberToJSON; +exports.DerivedNumberToJSONTyped = DerivedNumberToJSONTyped; /** * @export */ @@ -24,20 +29,21 @@ exports.DerivedNumberTypeEnum = { * Check if a given object implements the DerivedNumber interface. */ function instanceOfDerivedNumber(value) { - let isInstance = true; - isInstance = isInstance && "attribute" in value; - isInstance = isInstance && "defaultValue" in value; - isInstance = isInstance && "factor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('attribute' in value) || value['attribute'] === undefined) + return false; + if (!('defaultValue' in value) || value['defaultValue'] === undefined) + return false; + if (!('factor' in value) || value['factor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfDerivedNumber = instanceOfDerivedNumber; function DerivedNumberFromJSON(json) { return DerivedNumberFromJSONTyped(json, false); } -exports.DerivedNumberFromJSON = DerivedNumberFromJSON; function DerivedNumberFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -47,19 +53,17 @@ function DerivedNumberFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.DerivedNumberFromJSONTyped = DerivedNumberFromJSONTyped; -function DerivedNumberToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function DerivedNumberToJSON(json) { + return DerivedNumberToJSONTyped(json, false); +} +function DerivedNumberToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'attribute': value.attribute, - 'defaultValue': value.defaultValue, - 'factor': value.factor, - 'type': value.type, + 'attribute': value['attribute'], + 'defaultValue': value['defaultValue'], + 'factor': value['factor'], + 'type': value['type'], }; } -exports.DerivedNumberToJSON = DerivedNumberToJSON; diff --git a/typescript/dist/models/DescribeCoverageRequest.d.ts b/typescript/dist/models/DescribeCoverageRequest.d.ts index 8abf5f19..5cc34e7e 100644 --- a/typescript/dist/models/DescribeCoverageRequest.d.ts +++ b/typescript/dist/models/DescribeCoverageRequest.d.ts @@ -17,6 +17,8 @@ export declare const DescribeCoverageRequest: { readonly DescribeCoverage: "DescribeCoverage"; }; export type DescribeCoverageRequest = typeof DescribeCoverageRequest[keyof typeof DescribeCoverageRequest]; +export declare function instanceOfDescribeCoverageRequest(value: any): boolean; export declare function DescribeCoverageRequestFromJSON(json: any): DescribeCoverageRequest; export declare function DescribeCoverageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DescribeCoverageRequest; export declare function DescribeCoverageRequestToJSON(value?: DescribeCoverageRequest | null): any; +export declare function DescribeCoverageRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): DescribeCoverageRequest; diff --git a/typescript/dist/models/DescribeCoverageRequest.js b/typescript/dist/models/DescribeCoverageRequest.js index 58b48635..f5ea1952 100644 --- a/typescript/dist/models/DescribeCoverageRequest.js +++ b/typescript/dist/models/DescribeCoverageRequest.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.DescribeCoverageRequestToJSON = exports.DescribeCoverageRequestFromJSONTyped = exports.DescribeCoverageRequestFromJSON = exports.DescribeCoverageRequest = void 0; +exports.DescribeCoverageRequest = void 0; +exports.instanceOfDescribeCoverageRequest = instanceOfDescribeCoverageRequest; +exports.DescribeCoverageRequestFromJSON = DescribeCoverageRequestFromJSON; +exports.DescribeCoverageRequestFromJSONTyped = DescribeCoverageRequestFromJSONTyped; +exports.DescribeCoverageRequestToJSON = DescribeCoverageRequestToJSON; +exports.DescribeCoverageRequestToJSONTyped = DescribeCoverageRequestToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.DescribeCoverageRequestToJSON = exports.DescribeCoverageRequestFromJSONT exports.DescribeCoverageRequest = { DescribeCoverage: 'DescribeCoverage' }; +function instanceOfDescribeCoverageRequest(value) { + for (const key in exports.DescribeCoverageRequest) { + if (Object.prototype.hasOwnProperty.call(exports.DescribeCoverageRequest, key)) { + if (exports.DescribeCoverageRequest[key] === value) { + return true; + } + } + } + return false; +} function DescribeCoverageRequestFromJSON(json) { return DescribeCoverageRequestFromJSONTyped(json, false); } -exports.DescribeCoverageRequestFromJSON = DescribeCoverageRequestFromJSON; function DescribeCoverageRequestFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.DescribeCoverageRequestFromJSONTyped = DescribeCoverageRequestFromJSONTyped; function DescribeCoverageRequestToJSON(value) { return value; } -exports.DescribeCoverageRequestToJSON = DescribeCoverageRequestToJSON; +function DescribeCoverageRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/ErrorResponse.d.ts b/typescript/dist/models/ErrorResponse.d.ts index 75036720..854640e6 100644 --- a/typescript/dist/models/ErrorResponse.d.ts +++ b/typescript/dist/models/ErrorResponse.d.ts @@ -31,7 +31,8 @@ export interface ErrorResponse { /** * Check if a given object implements the ErrorResponse interface. */ -export declare function instanceOfErrorResponse(value: object): boolean; +export declare function instanceOfErrorResponse(value: object): value is ErrorResponse; export declare function ErrorResponseFromJSON(json: any): ErrorResponse; export declare function ErrorResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorResponse; -export declare function ErrorResponseToJSON(value?: ErrorResponse | null): any; +export declare function ErrorResponseToJSON(json: any): ErrorResponse; +export declare function ErrorResponseToJSONTyped(value?: ErrorResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ErrorResponse.js b/typescript/dist/models/ErrorResponse.js index 83bc0ca5..8b1f8ef9 100644 --- a/typescript/dist/models/ErrorResponse.js +++ b/typescript/dist/models/ErrorResponse.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ErrorResponseToJSON = exports.ErrorResponseFromJSONTyped = exports.ErrorResponseFromJSON = exports.instanceOfErrorResponse = void 0; +exports.instanceOfErrorResponse = instanceOfErrorResponse; +exports.ErrorResponseFromJSON = ErrorResponseFromJSON; +exports.ErrorResponseFromJSONTyped = ErrorResponseFromJSONTyped; +exports.ErrorResponseToJSON = ErrorResponseToJSON; +exports.ErrorResponseToJSONTyped = ErrorResponseToJSONTyped; /** * Check if a given object implements the ErrorResponse interface. */ function instanceOfErrorResponse(value) { - let isInstance = true; - isInstance = isInstance && "error" in value; - isInstance = isInstance && "message" in value; - return isInstance; + if (!('error' in value) || value['error'] === undefined) + return false; + if (!('message' in value) || value['message'] === undefined) + return false; + return true; } -exports.instanceOfErrorResponse = instanceOfErrorResponse; function ErrorResponseFromJSON(json) { return ErrorResponseFromJSONTyped(json, false); } -exports.ErrorResponseFromJSON = ErrorResponseFromJSON; function ErrorResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function ErrorResponseFromJSONTyped(json, ignoreDiscriminator) { 'message': json['message'], }; } -exports.ErrorResponseFromJSONTyped = ErrorResponseFromJSONTyped; -function ErrorResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ErrorResponseToJSON(json) { + return ErrorResponseToJSONTyped(json, false); +} +function ErrorResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'error': value.error, - 'message': value.message, + 'error': value['error'], + 'message': value['message'], }; } -exports.ErrorResponseToJSON = ErrorResponseToJSON; diff --git a/typescript/dist/models/ExternalDataId.d.ts b/typescript/dist/models/ExternalDataId.d.ts index cf1fd7d4..7d545dd8 100644 --- a/typescript/dist/models/ExternalDataId.d.ts +++ b/typescript/dist/models/ExternalDataId.d.ts @@ -44,7 +44,8 @@ export type ExternalDataIdTypeEnum = typeof ExternalDataIdTypeEnum[keyof typeof /** * Check if a given object implements the ExternalDataId interface. */ -export declare function instanceOfExternalDataId(value: object): boolean; +export declare function instanceOfExternalDataId(value: object): value is ExternalDataId; export declare function ExternalDataIdFromJSON(json: any): ExternalDataId; export declare function ExternalDataIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExternalDataId; -export declare function ExternalDataIdToJSON(value?: ExternalDataId | null): any; +export declare function ExternalDataIdToJSON(json: any): ExternalDataId; +export declare function ExternalDataIdToJSONTyped(value?: ExternalDataId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ExternalDataId.js b/typescript/dist/models/ExternalDataId.js index b1d0a776..751d33fd 100644 --- a/typescript/dist/models/ExternalDataId.js +++ b/typescript/dist/models/ExternalDataId.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExternalDataIdToJSON = exports.ExternalDataIdFromJSONTyped = exports.ExternalDataIdFromJSON = exports.instanceOfExternalDataId = exports.ExternalDataIdTypeEnum = void 0; +exports.ExternalDataIdTypeEnum = void 0; +exports.instanceOfExternalDataId = instanceOfExternalDataId; +exports.ExternalDataIdFromJSON = ExternalDataIdFromJSON; +exports.ExternalDataIdFromJSONTyped = ExternalDataIdFromJSONTyped; +exports.ExternalDataIdToJSON = ExternalDataIdToJSON; +exports.ExternalDataIdToJSONTyped = ExternalDataIdToJSONTyped; /** * @export */ @@ -24,19 +29,19 @@ exports.ExternalDataIdTypeEnum = { * Check if a given object implements the ExternalDataId interface. */ function instanceOfExternalDataId(value) { - let isInstance = true; - isInstance = isInstance && "layerId" in value; - isInstance = isInstance && "providerId" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('layerId' in value) || value['layerId'] === undefined) + return false; + if (!('providerId' in value) || value['providerId'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfExternalDataId = instanceOfExternalDataId; function ExternalDataIdFromJSON(json) { return ExternalDataIdFromJSONTyped(json, false); } -exports.ExternalDataIdFromJSON = ExternalDataIdFromJSON; function ExternalDataIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -45,18 +50,16 @@ function ExternalDataIdFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.ExternalDataIdFromJSONTyped = ExternalDataIdFromJSONTyped; -function ExternalDataIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ExternalDataIdToJSON(json) { + return ExternalDataIdToJSONTyped(json, false); +} +function ExternalDataIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'layerId': value.layerId, - 'providerId': value.providerId, - 'type': value.type, + 'layerId': value['layerId'], + 'providerId': value['providerId'], + 'type': value['type'], }; } -exports.ExternalDataIdToJSON = ExternalDataIdToJSON; diff --git a/typescript/dist/models/FeatureDataType.d.ts b/typescript/dist/models/FeatureDataType.d.ts index 17a2b28c..a0b12e48 100644 --- a/typescript/dist/models/FeatureDataType.d.ts +++ b/typescript/dist/models/FeatureDataType.d.ts @@ -22,6 +22,8 @@ export declare const FeatureDataType: { readonly DateTime: "dateTime"; }; export type FeatureDataType = typeof FeatureDataType[keyof typeof FeatureDataType]; +export declare function instanceOfFeatureDataType(value: any): boolean; export declare function FeatureDataTypeFromJSON(json: any): FeatureDataType; export declare function FeatureDataTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureDataType; export declare function FeatureDataTypeToJSON(value?: FeatureDataType | null): any; +export declare function FeatureDataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): FeatureDataType; diff --git a/typescript/dist/models/FeatureDataType.js b/typescript/dist/models/FeatureDataType.js index c20163b3..3245522d 100644 --- a/typescript/dist/models/FeatureDataType.js +++ b/typescript/dist/models/FeatureDataType.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.FeatureDataTypeToJSON = exports.FeatureDataTypeFromJSONTyped = exports.FeatureDataTypeFromJSON = exports.FeatureDataType = void 0; +exports.FeatureDataType = void 0; +exports.instanceOfFeatureDataType = instanceOfFeatureDataType; +exports.FeatureDataTypeFromJSON = FeatureDataTypeFromJSON; +exports.FeatureDataTypeFromJSONTyped = FeatureDataTypeFromJSONTyped; +exports.FeatureDataTypeToJSON = FeatureDataTypeToJSON; +exports.FeatureDataTypeToJSONTyped = FeatureDataTypeToJSONTyped; /** * * @export @@ -26,15 +31,25 @@ exports.FeatureDataType = { Bool: 'bool', DateTime: 'dateTime' }; +function instanceOfFeatureDataType(value) { + for (const key in exports.FeatureDataType) { + if (Object.prototype.hasOwnProperty.call(exports.FeatureDataType, key)) { + if (exports.FeatureDataType[key] === value) { + return true; + } + } + } + return false; +} function FeatureDataTypeFromJSON(json) { return FeatureDataTypeFromJSONTyped(json, false); } -exports.FeatureDataTypeFromJSON = FeatureDataTypeFromJSON; function FeatureDataTypeFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.FeatureDataTypeFromJSONTyped = FeatureDataTypeFromJSONTyped; function FeatureDataTypeToJSON(value) { return value; } -exports.FeatureDataTypeToJSON = FeatureDataTypeToJSON; +function FeatureDataTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/FileNotFoundHandling.d.ts b/typescript/dist/models/FileNotFoundHandling.d.ts index e4aa2e05..8467ab74 100644 --- a/typescript/dist/models/FileNotFoundHandling.d.ts +++ b/typescript/dist/models/FileNotFoundHandling.d.ts @@ -18,6 +18,8 @@ export declare const FileNotFoundHandling: { readonly Error: "Error"; }; export type FileNotFoundHandling = typeof FileNotFoundHandling[keyof typeof FileNotFoundHandling]; +export declare function instanceOfFileNotFoundHandling(value: any): boolean; export declare function FileNotFoundHandlingFromJSON(json: any): FileNotFoundHandling; export declare function FileNotFoundHandlingFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileNotFoundHandling; export declare function FileNotFoundHandlingToJSON(value?: FileNotFoundHandling | null): any; +export declare function FileNotFoundHandlingToJSONTyped(value: any, ignoreDiscriminator: boolean): FileNotFoundHandling; diff --git a/typescript/dist/models/FileNotFoundHandling.js b/typescript/dist/models/FileNotFoundHandling.js index ff27ccd2..84e33954 100644 --- a/typescript/dist/models/FileNotFoundHandling.js +++ b/typescript/dist/models/FileNotFoundHandling.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.FileNotFoundHandlingToJSON = exports.FileNotFoundHandlingFromJSONTyped = exports.FileNotFoundHandlingFromJSON = exports.FileNotFoundHandling = void 0; +exports.FileNotFoundHandling = void 0; +exports.instanceOfFileNotFoundHandling = instanceOfFileNotFoundHandling; +exports.FileNotFoundHandlingFromJSON = FileNotFoundHandlingFromJSON; +exports.FileNotFoundHandlingFromJSONTyped = FileNotFoundHandlingFromJSONTyped; +exports.FileNotFoundHandlingToJSON = FileNotFoundHandlingToJSON; +exports.FileNotFoundHandlingToJSONTyped = FileNotFoundHandlingToJSONTyped; /** * * @export @@ -22,15 +27,25 @@ exports.FileNotFoundHandling = { NoData: 'NoData', Error: 'Error' }; +function instanceOfFileNotFoundHandling(value) { + for (const key in exports.FileNotFoundHandling) { + if (Object.prototype.hasOwnProperty.call(exports.FileNotFoundHandling, key)) { + if (exports.FileNotFoundHandling[key] === value) { + return true; + } + } + } + return false; +} function FileNotFoundHandlingFromJSON(json) { return FileNotFoundHandlingFromJSONTyped(json, false); } -exports.FileNotFoundHandlingFromJSON = FileNotFoundHandlingFromJSON; function FileNotFoundHandlingFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.FileNotFoundHandlingFromJSONTyped = FileNotFoundHandlingFromJSONTyped; function FileNotFoundHandlingToJSON(value) { return value; } -exports.FileNotFoundHandlingToJSON = FileNotFoundHandlingToJSON; +function FileNotFoundHandlingToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/FormatSpecifics.d.ts b/typescript/dist/models/FormatSpecifics.d.ts index 72050a4f..02aedb0e 100644 --- a/typescript/dist/models/FormatSpecifics.d.ts +++ b/typescript/dist/models/FormatSpecifics.d.ts @@ -9,7 +9,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { FormatSpecificsOneOf } from './FormatSpecificsOneOf'; +import type { FormatSpecificsOneOf } from './FormatSpecificsOneOf'; /** * @type FormatSpecifics * @@ -18,4 +18,5 @@ import { FormatSpecificsOneOf } from './FormatSpecificsOneOf'; export type FormatSpecifics = FormatSpecificsOneOf; export declare function FormatSpecificsFromJSON(json: any): FormatSpecifics; export declare function FormatSpecificsFromJSONTyped(json: any, ignoreDiscriminator: boolean): FormatSpecifics; -export declare function FormatSpecificsToJSON(value?: FormatSpecifics | null): any; +export declare function FormatSpecificsToJSON(json: any): any; +export declare function FormatSpecificsToJSONTyped(value?: FormatSpecifics | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/FormatSpecifics.js b/typescript/dist/models/FormatSpecifics.js index 013aa772..0116d05c 100644 --- a/typescript/dist/models/FormatSpecifics.js +++ b/typescript/dist/models/FormatSpecifics.js @@ -13,29 +13,32 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.FormatSpecificsToJSON = exports.FormatSpecificsFromJSONTyped = exports.FormatSpecificsFromJSON = void 0; +exports.FormatSpecificsFromJSON = FormatSpecificsFromJSON; +exports.FormatSpecificsFromJSONTyped = FormatSpecificsFromJSONTyped; +exports.FormatSpecificsToJSON = FormatSpecificsToJSON; +exports.FormatSpecificsToJSONTyped = FormatSpecificsToJSONTyped; const FormatSpecificsOneOf_1 = require("./FormatSpecificsOneOf"); function FormatSpecificsFromJSON(json) { return FormatSpecificsFromJSONTyped(json, false); } -exports.FormatSpecificsFromJSON = FormatSpecificsFromJSON; function FormatSpecificsFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - return Object.assign({}, (0, FormatSpecificsOneOf_1.FormatSpecificsOneOfFromJSONTyped)(json, true)); -} -exports.FormatSpecificsFromJSONTyped = FormatSpecificsFromJSONTyped; -function FormatSpecificsToJSON(value) { - if (value === undefined) { - return undefined; + if ((0, FormatSpecificsOneOf_1.instanceOfFormatSpecificsOneOf)(json)) { + return (0, FormatSpecificsOneOf_1.FormatSpecificsOneOfFromJSONTyped)(json, true); } - if (value === null) { - return null; + return {}; +} +function FormatSpecificsToJSON(json) { + return FormatSpecificsToJSONTyped(json, false); +} +function FormatSpecificsToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } if ((0, FormatSpecificsOneOf_1.instanceOfFormatSpecificsOneOf)(value)) { return (0, FormatSpecificsOneOf_1.FormatSpecificsOneOfToJSON)(value); } return {}; } -exports.FormatSpecificsToJSON = FormatSpecificsToJSON; diff --git a/typescript/dist/models/FormatSpecificsOneOf.d.ts b/typescript/dist/models/FormatSpecificsOneOf.d.ts index fa56f7a9..3875ba2f 100644 --- a/typescript/dist/models/FormatSpecificsOneOf.d.ts +++ b/typescript/dist/models/FormatSpecificsOneOf.d.ts @@ -26,7 +26,8 @@ export interface FormatSpecificsOneOf { /** * Check if a given object implements the FormatSpecificsOneOf interface. */ -export declare function instanceOfFormatSpecificsOneOf(value: object): boolean; +export declare function instanceOfFormatSpecificsOneOf(value: object): value is FormatSpecificsOneOf; export declare function FormatSpecificsOneOfFromJSON(json: any): FormatSpecificsOneOf; export declare function FormatSpecificsOneOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): FormatSpecificsOneOf; -export declare function FormatSpecificsOneOfToJSON(value?: FormatSpecificsOneOf | null): any; +export declare function FormatSpecificsOneOfToJSON(json: any): FormatSpecificsOneOf; +export declare function FormatSpecificsOneOfToJSONTyped(value?: FormatSpecificsOneOf | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/FormatSpecificsOneOf.js b/typescript/dist/models/FormatSpecificsOneOf.js index ef169685..b22c379a 100644 --- a/typescript/dist/models/FormatSpecificsOneOf.js +++ b/typescript/dist/models/FormatSpecificsOneOf.js @@ -13,39 +13,39 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.FormatSpecificsOneOfToJSON = exports.FormatSpecificsOneOfFromJSONTyped = exports.FormatSpecificsOneOfFromJSON = exports.instanceOfFormatSpecificsOneOf = void 0; +exports.instanceOfFormatSpecificsOneOf = instanceOfFormatSpecificsOneOf; +exports.FormatSpecificsOneOfFromJSON = FormatSpecificsOneOfFromJSON; +exports.FormatSpecificsOneOfFromJSONTyped = FormatSpecificsOneOfFromJSONTyped; +exports.FormatSpecificsOneOfToJSON = FormatSpecificsOneOfToJSON; +exports.FormatSpecificsOneOfToJSONTyped = FormatSpecificsOneOfToJSONTyped; const FormatSpecificsOneOfCsv_1 = require("./FormatSpecificsOneOfCsv"); /** * Check if a given object implements the FormatSpecificsOneOf interface. */ function instanceOfFormatSpecificsOneOf(value) { - let isInstance = true; - isInstance = isInstance && "csv" in value; - return isInstance; + if (!('csv' in value) || value['csv'] === undefined) + return false; + return true; } -exports.instanceOfFormatSpecificsOneOf = instanceOfFormatSpecificsOneOf; function FormatSpecificsOneOfFromJSON(json) { return FormatSpecificsOneOfFromJSONTyped(json, false); } -exports.FormatSpecificsOneOfFromJSON = FormatSpecificsOneOfFromJSON; function FormatSpecificsOneOfFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'csv': (0, FormatSpecificsOneOfCsv_1.FormatSpecificsOneOfCsvFromJSON)(json['csv']), }; } -exports.FormatSpecificsOneOfFromJSONTyped = FormatSpecificsOneOfFromJSONTyped; -function FormatSpecificsOneOfToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function FormatSpecificsOneOfToJSON(json) { + return FormatSpecificsOneOfToJSONTyped(json, false); +} +function FormatSpecificsOneOfToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'csv': (0, FormatSpecificsOneOfCsv_1.FormatSpecificsOneOfCsvToJSON)(value.csv), + 'csv': (0, FormatSpecificsOneOfCsv_1.FormatSpecificsOneOfCsvToJSON)(value['csv']), }; } -exports.FormatSpecificsOneOfToJSON = FormatSpecificsOneOfToJSON; diff --git a/typescript/dist/models/FormatSpecificsOneOfCsv.d.ts b/typescript/dist/models/FormatSpecificsOneOfCsv.d.ts index 7a244c60..b9b304aa 100644 --- a/typescript/dist/models/FormatSpecificsOneOfCsv.d.ts +++ b/typescript/dist/models/FormatSpecificsOneOfCsv.d.ts @@ -26,7 +26,8 @@ export interface FormatSpecificsOneOfCsv { /** * Check if a given object implements the FormatSpecificsOneOfCsv interface. */ -export declare function instanceOfFormatSpecificsOneOfCsv(value: object): boolean; +export declare function instanceOfFormatSpecificsOneOfCsv(value: object): value is FormatSpecificsOneOfCsv; export declare function FormatSpecificsOneOfCsvFromJSON(json: any): FormatSpecificsOneOfCsv; export declare function FormatSpecificsOneOfCsvFromJSONTyped(json: any, ignoreDiscriminator: boolean): FormatSpecificsOneOfCsv; -export declare function FormatSpecificsOneOfCsvToJSON(value?: FormatSpecificsOneOfCsv | null): any; +export declare function FormatSpecificsOneOfCsvToJSON(json: any): FormatSpecificsOneOfCsv; +export declare function FormatSpecificsOneOfCsvToJSONTyped(value?: FormatSpecificsOneOfCsv | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/FormatSpecificsOneOfCsv.js b/typescript/dist/models/FormatSpecificsOneOfCsv.js index 03c96053..8214f57d 100644 --- a/typescript/dist/models/FormatSpecificsOneOfCsv.js +++ b/typescript/dist/models/FormatSpecificsOneOfCsv.js @@ -13,39 +13,39 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.FormatSpecificsOneOfCsvToJSON = exports.FormatSpecificsOneOfCsvFromJSONTyped = exports.FormatSpecificsOneOfCsvFromJSON = exports.instanceOfFormatSpecificsOneOfCsv = void 0; +exports.instanceOfFormatSpecificsOneOfCsv = instanceOfFormatSpecificsOneOfCsv; +exports.FormatSpecificsOneOfCsvFromJSON = FormatSpecificsOneOfCsvFromJSON; +exports.FormatSpecificsOneOfCsvFromJSONTyped = FormatSpecificsOneOfCsvFromJSONTyped; +exports.FormatSpecificsOneOfCsvToJSON = FormatSpecificsOneOfCsvToJSON; +exports.FormatSpecificsOneOfCsvToJSONTyped = FormatSpecificsOneOfCsvToJSONTyped; const CsvHeader_1 = require("./CsvHeader"); /** * Check if a given object implements the FormatSpecificsOneOfCsv interface. */ function instanceOfFormatSpecificsOneOfCsv(value) { - let isInstance = true; - isInstance = isInstance && "header" in value; - return isInstance; + if (!('header' in value) || value['header'] === undefined) + return false; + return true; } -exports.instanceOfFormatSpecificsOneOfCsv = instanceOfFormatSpecificsOneOfCsv; function FormatSpecificsOneOfCsvFromJSON(json) { return FormatSpecificsOneOfCsvFromJSONTyped(json, false); } -exports.FormatSpecificsOneOfCsvFromJSON = FormatSpecificsOneOfCsvFromJSON; function FormatSpecificsOneOfCsvFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'header': (0, CsvHeader_1.CsvHeaderFromJSON)(json['header']), }; } -exports.FormatSpecificsOneOfCsvFromJSONTyped = FormatSpecificsOneOfCsvFromJSONTyped; -function FormatSpecificsOneOfCsvToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function FormatSpecificsOneOfCsvToJSON(json) { + return FormatSpecificsOneOfCsvToJSONTyped(json, false); +} +function FormatSpecificsOneOfCsvToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'header': (0, CsvHeader_1.CsvHeaderToJSON)(value.header), + 'header': (0, CsvHeader_1.CsvHeaderToJSON)(value['header']), }; } -exports.FormatSpecificsOneOfCsvToJSON = FormatSpecificsOneOfCsvToJSON; diff --git a/typescript/dist/models/GdalDatasetGeoTransform.d.ts b/typescript/dist/models/GdalDatasetGeoTransform.d.ts index b549b436..cd084cf3 100644 --- a/typescript/dist/models/GdalDatasetGeoTransform.d.ts +++ b/typescript/dist/models/GdalDatasetGeoTransform.d.ts @@ -38,7 +38,8 @@ export interface GdalDatasetGeoTransform { /** * Check if a given object implements the GdalDatasetGeoTransform interface. */ -export declare function instanceOfGdalDatasetGeoTransform(value: object): boolean; +export declare function instanceOfGdalDatasetGeoTransform(value: object): value is GdalDatasetGeoTransform; export declare function GdalDatasetGeoTransformFromJSON(json: any): GdalDatasetGeoTransform; export declare function GdalDatasetGeoTransformFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalDatasetGeoTransform; -export declare function GdalDatasetGeoTransformToJSON(value?: GdalDatasetGeoTransform | null): any; +export declare function GdalDatasetGeoTransformToJSON(json: any): GdalDatasetGeoTransform; +export declare function GdalDatasetGeoTransformToJSONTyped(value?: GdalDatasetGeoTransform | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/GdalDatasetGeoTransform.js b/typescript/dist/models/GdalDatasetGeoTransform.js index a4108887..ed32f9ee 100644 --- a/typescript/dist/models/GdalDatasetGeoTransform.js +++ b/typescript/dist/models/GdalDatasetGeoTransform.js @@ -13,25 +13,29 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GdalDatasetGeoTransformToJSON = exports.GdalDatasetGeoTransformFromJSONTyped = exports.GdalDatasetGeoTransformFromJSON = exports.instanceOfGdalDatasetGeoTransform = void 0; +exports.instanceOfGdalDatasetGeoTransform = instanceOfGdalDatasetGeoTransform; +exports.GdalDatasetGeoTransformFromJSON = GdalDatasetGeoTransformFromJSON; +exports.GdalDatasetGeoTransformFromJSONTyped = GdalDatasetGeoTransformFromJSONTyped; +exports.GdalDatasetGeoTransformToJSON = GdalDatasetGeoTransformToJSON; +exports.GdalDatasetGeoTransformToJSONTyped = GdalDatasetGeoTransformToJSONTyped; const Coordinate2D_1 = require("./Coordinate2D"); /** * Check if a given object implements the GdalDatasetGeoTransform interface. */ function instanceOfGdalDatasetGeoTransform(value) { - let isInstance = true; - isInstance = isInstance && "originCoordinate" in value; - isInstance = isInstance && "xPixelSize" in value; - isInstance = isInstance && "yPixelSize" in value; - return isInstance; + if (!('originCoordinate' in value) || value['originCoordinate'] === undefined) + return false; + if (!('xPixelSize' in value) || value['xPixelSize'] === undefined) + return false; + if (!('yPixelSize' in value) || value['yPixelSize'] === undefined) + return false; + return true; } -exports.instanceOfGdalDatasetGeoTransform = instanceOfGdalDatasetGeoTransform; function GdalDatasetGeoTransformFromJSON(json) { return GdalDatasetGeoTransformFromJSONTyped(json, false); } -exports.GdalDatasetGeoTransformFromJSON = GdalDatasetGeoTransformFromJSON; function GdalDatasetGeoTransformFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -40,18 +44,16 @@ function GdalDatasetGeoTransformFromJSONTyped(json, ignoreDiscriminator) { 'yPixelSize': json['yPixelSize'], }; } -exports.GdalDatasetGeoTransformFromJSONTyped = GdalDatasetGeoTransformFromJSONTyped; -function GdalDatasetGeoTransformToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function GdalDatasetGeoTransformToJSON(json) { + return GdalDatasetGeoTransformToJSONTyped(json, false); +} +function GdalDatasetGeoTransformToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'originCoordinate': (0, Coordinate2D_1.Coordinate2DToJSON)(value.originCoordinate), - 'xPixelSize': value.xPixelSize, - 'yPixelSize': value.yPixelSize, + 'originCoordinate': (0, Coordinate2D_1.Coordinate2DToJSON)(value['originCoordinate']), + 'xPixelSize': value['xPixelSize'], + 'yPixelSize': value['yPixelSize'], }; } -exports.GdalDatasetGeoTransformToJSON = GdalDatasetGeoTransformToJSON; diff --git a/typescript/dist/models/GdalDatasetParameters.d.ts b/typescript/dist/models/GdalDatasetParameters.d.ts index fa4ce808..32c9a296 100644 --- a/typescript/dist/models/GdalDatasetParameters.d.ts +++ b/typescript/dist/models/GdalDatasetParameters.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { FileNotFoundHandling } from './FileNotFoundHandling'; import type { GdalDatasetGeoTransform } from './GdalDatasetGeoTransform'; import type { GdalMetadataMapping } from './GdalMetadataMapping'; +import type { FileNotFoundHandling } from './FileNotFoundHandling'; /** * Parameters for loading data using Gdal * @export @@ -88,7 +88,8 @@ export interface GdalDatasetParameters { /** * Check if a given object implements the GdalDatasetParameters interface. */ -export declare function instanceOfGdalDatasetParameters(value: object): boolean; +export declare function instanceOfGdalDatasetParameters(value: object): value is GdalDatasetParameters; export declare function GdalDatasetParametersFromJSON(json: any): GdalDatasetParameters; export declare function GdalDatasetParametersFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalDatasetParameters; -export declare function GdalDatasetParametersToJSON(value?: GdalDatasetParameters | null): any; +export declare function GdalDatasetParametersToJSON(json: any): GdalDatasetParameters; +export declare function GdalDatasetParametersToJSONTyped(value?: GdalDatasetParameters | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/GdalDatasetParameters.js b/typescript/dist/models/GdalDatasetParameters.js index 6a7d99fa..629fe03b 100644 --- a/typescript/dist/models/GdalDatasetParameters.js +++ b/typescript/dist/models/GdalDatasetParameters.js @@ -13,67 +13,71 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GdalDatasetParametersToJSON = exports.GdalDatasetParametersFromJSONTyped = exports.GdalDatasetParametersFromJSON = exports.instanceOfGdalDatasetParameters = void 0; -const runtime_1 = require("../runtime"); -const FileNotFoundHandling_1 = require("./FileNotFoundHandling"); +exports.instanceOfGdalDatasetParameters = instanceOfGdalDatasetParameters; +exports.GdalDatasetParametersFromJSON = GdalDatasetParametersFromJSON; +exports.GdalDatasetParametersFromJSONTyped = GdalDatasetParametersFromJSONTyped; +exports.GdalDatasetParametersToJSON = GdalDatasetParametersToJSON; +exports.GdalDatasetParametersToJSONTyped = GdalDatasetParametersToJSONTyped; const GdalDatasetGeoTransform_1 = require("./GdalDatasetGeoTransform"); const GdalMetadataMapping_1 = require("./GdalMetadataMapping"); +const FileNotFoundHandling_1 = require("./FileNotFoundHandling"); /** * Check if a given object implements the GdalDatasetParameters interface. */ function instanceOfGdalDatasetParameters(value) { - let isInstance = true; - isInstance = isInstance && "fileNotFoundHandling" in value; - isInstance = isInstance && "filePath" in value; - isInstance = isInstance && "geoTransform" in value; - isInstance = isInstance && "height" in value; - isInstance = isInstance && "rasterbandChannel" in value; - isInstance = isInstance && "width" in value; - return isInstance; + if (!('fileNotFoundHandling' in value) || value['fileNotFoundHandling'] === undefined) + return false; + if (!('filePath' in value) || value['filePath'] === undefined) + return false; + if (!('geoTransform' in value) || value['geoTransform'] === undefined) + return false; + if (!('height' in value) || value['height'] === undefined) + return false; + if (!('rasterbandChannel' in value) || value['rasterbandChannel'] === undefined) + return false; + if (!('width' in value) || value['width'] === undefined) + return false; + return true; } -exports.instanceOfGdalDatasetParameters = instanceOfGdalDatasetParameters; function GdalDatasetParametersFromJSON(json) { return GdalDatasetParametersFromJSONTyped(json, false); } -exports.GdalDatasetParametersFromJSON = GdalDatasetParametersFromJSON; function GdalDatasetParametersFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'allowAlphabandAsMask': !(0, runtime_1.exists)(json, 'allowAlphabandAsMask') ? undefined : json['allowAlphabandAsMask'], + 'allowAlphabandAsMask': json['allowAlphabandAsMask'] == null ? undefined : json['allowAlphabandAsMask'], 'fileNotFoundHandling': (0, FileNotFoundHandling_1.FileNotFoundHandlingFromJSON)(json['fileNotFoundHandling']), 'filePath': json['filePath'], - 'gdalConfigOptions': !(0, runtime_1.exists)(json, 'gdalConfigOptions') ? undefined : json['gdalConfigOptions'], - 'gdalOpenOptions': !(0, runtime_1.exists)(json, 'gdalOpenOptions') ? undefined : json['gdalOpenOptions'], + 'gdalConfigOptions': json['gdalConfigOptions'] == null ? undefined : json['gdalConfigOptions'], + 'gdalOpenOptions': json['gdalOpenOptions'] == null ? undefined : json['gdalOpenOptions'], 'geoTransform': (0, GdalDatasetGeoTransform_1.GdalDatasetGeoTransformFromJSON)(json['geoTransform']), 'height': json['height'], - 'noDataValue': !(0, runtime_1.exists)(json, 'noDataValue') ? undefined : json['noDataValue'], - 'propertiesMapping': !(0, runtime_1.exists)(json, 'propertiesMapping') ? undefined : (json['propertiesMapping'] === null ? null : json['propertiesMapping'].map(GdalMetadataMapping_1.GdalMetadataMappingFromJSON)), + 'noDataValue': json['noDataValue'] == null ? undefined : json['noDataValue'], + 'propertiesMapping': json['propertiesMapping'] == null ? undefined : (json['propertiesMapping'].map(GdalMetadataMapping_1.GdalMetadataMappingFromJSON)), 'rasterbandChannel': json['rasterbandChannel'], 'width': json['width'], }; } -exports.GdalDatasetParametersFromJSONTyped = GdalDatasetParametersFromJSONTyped; -function GdalDatasetParametersToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function GdalDatasetParametersToJSON(json) { + return GdalDatasetParametersToJSONTyped(json, false); +} +function GdalDatasetParametersToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'allowAlphabandAsMask': value.allowAlphabandAsMask, - 'fileNotFoundHandling': (0, FileNotFoundHandling_1.FileNotFoundHandlingToJSON)(value.fileNotFoundHandling), - 'filePath': value.filePath, - 'gdalConfigOptions': value.gdalConfigOptions, - 'gdalOpenOptions': value.gdalOpenOptions, - 'geoTransform': (0, GdalDatasetGeoTransform_1.GdalDatasetGeoTransformToJSON)(value.geoTransform), - 'height': value.height, - 'noDataValue': value.noDataValue, - 'propertiesMapping': value.propertiesMapping === undefined ? undefined : (value.propertiesMapping === null ? null : value.propertiesMapping.map(GdalMetadataMapping_1.GdalMetadataMappingToJSON)), - 'rasterbandChannel': value.rasterbandChannel, - 'width': value.width, + 'allowAlphabandAsMask': value['allowAlphabandAsMask'], + 'fileNotFoundHandling': (0, FileNotFoundHandling_1.FileNotFoundHandlingToJSON)(value['fileNotFoundHandling']), + 'filePath': value['filePath'], + 'gdalConfigOptions': value['gdalConfigOptions'], + 'gdalOpenOptions': value['gdalOpenOptions'], + 'geoTransform': (0, GdalDatasetGeoTransform_1.GdalDatasetGeoTransformToJSON)(value['geoTransform']), + 'height': value['height'], + 'noDataValue': value['noDataValue'], + 'propertiesMapping': value['propertiesMapping'] == null ? undefined : (value['propertiesMapping'].map(GdalMetadataMapping_1.GdalMetadataMappingToJSON)), + 'rasterbandChannel': value['rasterbandChannel'], + 'width': value['width'], }; } -exports.GdalDatasetParametersToJSON = GdalDatasetParametersToJSON; diff --git a/typescript/dist/models/GdalLoadingInfoTemporalSlice.d.ts b/typescript/dist/models/GdalLoadingInfoTemporalSlice.d.ts index 1d0e7df9..c90109bf 100644 --- a/typescript/dist/models/GdalLoadingInfoTemporalSlice.d.ts +++ b/typescript/dist/models/GdalLoadingInfoTemporalSlice.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { GdalDatasetParameters } from './GdalDatasetParameters'; import type { TimeInterval } from './TimeInterval'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; /** * one temporal slice of the dataset that requires reading from exactly one Gdal dataset * @export @@ -39,7 +39,8 @@ export interface GdalLoadingInfoTemporalSlice { /** * Check if a given object implements the GdalLoadingInfoTemporalSlice interface. */ -export declare function instanceOfGdalLoadingInfoTemporalSlice(value: object): boolean; +export declare function instanceOfGdalLoadingInfoTemporalSlice(value: object): value is GdalLoadingInfoTemporalSlice; export declare function GdalLoadingInfoTemporalSliceFromJSON(json: any): GdalLoadingInfoTemporalSlice; export declare function GdalLoadingInfoTemporalSliceFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalLoadingInfoTemporalSlice; -export declare function GdalLoadingInfoTemporalSliceToJSON(value?: GdalLoadingInfoTemporalSlice | null): any; +export declare function GdalLoadingInfoTemporalSliceToJSON(json: any): GdalLoadingInfoTemporalSlice; +export declare function GdalLoadingInfoTemporalSliceToJSONTyped(value?: GdalLoadingInfoTemporalSlice | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/GdalLoadingInfoTemporalSlice.js b/typescript/dist/models/GdalLoadingInfoTemporalSlice.js index d2404d54..c72a99a7 100644 --- a/typescript/dist/models/GdalLoadingInfoTemporalSlice.js +++ b/typescript/dist/models/GdalLoadingInfoTemporalSlice.js @@ -13,45 +13,44 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GdalLoadingInfoTemporalSliceToJSON = exports.GdalLoadingInfoTemporalSliceFromJSONTyped = exports.GdalLoadingInfoTemporalSliceFromJSON = exports.instanceOfGdalLoadingInfoTemporalSlice = void 0; -const runtime_1 = require("../runtime"); -const GdalDatasetParameters_1 = require("./GdalDatasetParameters"); +exports.instanceOfGdalLoadingInfoTemporalSlice = instanceOfGdalLoadingInfoTemporalSlice; +exports.GdalLoadingInfoTemporalSliceFromJSON = GdalLoadingInfoTemporalSliceFromJSON; +exports.GdalLoadingInfoTemporalSliceFromJSONTyped = GdalLoadingInfoTemporalSliceFromJSONTyped; +exports.GdalLoadingInfoTemporalSliceToJSON = GdalLoadingInfoTemporalSliceToJSON; +exports.GdalLoadingInfoTemporalSliceToJSONTyped = GdalLoadingInfoTemporalSliceToJSONTyped; const TimeInterval_1 = require("./TimeInterval"); +const GdalDatasetParameters_1 = require("./GdalDatasetParameters"); /** * Check if a given object implements the GdalLoadingInfoTemporalSlice interface. */ function instanceOfGdalLoadingInfoTemporalSlice(value) { - let isInstance = true; - isInstance = isInstance && "time" in value; - return isInstance; + if (!('time' in value) || value['time'] === undefined) + return false; + return true; } -exports.instanceOfGdalLoadingInfoTemporalSlice = instanceOfGdalLoadingInfoTemporalSlice; function GdalLoadingInfoTemporalSliceFromJSON(json) { return GdalLoadingInfoTemporalSliceFromJSONTyped(json, false); } -exports.GdalLoadingInfoTemporalSliceFromJSON = GdalLoadingInfoTemporalSliceFromJSON; function GdalLoadingInfoTemporalSliceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'cacheTtl': !(0, runtime_1.exists)(json, 'cacheTtl') ? undefined : json['cacheTtl'], - 'params': !(0, runtime_1.exists)(json, 'params') ? undefined : (0, GdalDatasetParameters_1.GdalDatasetParametersFromJSON)(json['params']), + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], + 'params': json['params'] == null ? undefined : (0, GdalDatasetParameters_1.GdalDatasetParametersFromJSON)(json['params']), 'time': (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), }; } -exports.GdalLoadingInfoTemporalSliceFromJSONTyped = GdalLoadingInfoTemporalSliceFromJSONTyped; -function GdalLoadingInfoTemporalSliceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function GdalLoadingInfoTemporalSliceToJSON(json) { + return GdalLoadingInfoTemporalSliceToJSONTyped(json, false); +} +function GdalLoadingInfoTemporalSliceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'cacheTtl': value.cacheTtl, - 'params': (0, GdalDatasetParameters_1.GdalDatasetParametersToJSON)(value.params), - 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value.time), + 'cacheTtl': value['cacheTtl'], + 'params': (0, GdalDatasetParameters_1.GdalDatasetParametersToJSON)(value['params']), + 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value['time']), }; } -exports.GdalLoadingInfoTemporalSliceToJSON = GdalLoadingInfoTemporalSliceToJSON; diff --git a/typescript/dist/models/GdalMetaDataList.d.ts b/typescript/dist/models/GdalMetaDataList.d.ts index 8f68482c..201f39c3 100644 --- a/typescript/dist/models/GdalMetaDataList.d.ts +++ b/typescript/dist/models/GdalMetaDataList.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { GdalLoadingInfoTemporalSlice } from './GdalLoadingInfoTemporalSlice'; import type { RasterResultDescriptor } from './RasterResultDescriptor'; +import type { GdalLoadingInfoTemporalSlice } from './GdalLoadingInfoTemporalSlice'; /** * * @export @@ -46,7 +46,8 @@ export type GdalMetaDataListTypeEnum = typeof GdalMetaDataListTypeEnum[keyof typ /** * Check if a given object implements the GdalMetaDataList interface. */ -export declare function instanceOfGdalMetaDataList(value: object): boolean; +export declare function instanceOfGdalMetaDataList(value: object): value is GdalMetaDataList; export declare function GdalMetaDataListFromJSON(json: any): GdalMetaDataList; export declare function GdalMetaDataListFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetaDataList; -export declare function GdalMetaDataListToJSON(value?: GdalMetaDataList | null): any; +export declare function GdalMetaDataListToJSON(json: any): GdalMetaDataList; +export declare function GdalMetaDataListToJSONTyped(value?: GdalMetaDataList | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/GdalMetaDataList.js b/typescript/dist/models/GdalMetaDataList.js index cc29d0ed..6f2d6948 100644 --- a/typescript/dist/models/GdalMetaDataList.js +++ b/typescript/dist/models/GdalMetaDataList.js @@ -13,9 +13,14 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GdalMetaDataListToJSON = exports.GdalMetaDataListFromJSONTyped = exports.GdalMetaDataListFromJSON = exports.instanceOfGdalMetaDataList = exports.GdalMetaDataListTypeEnum = void 0; -const GdalLoadingInfoTemporalSlice_1 = require("./GdalLoadingInfoTemporalSlice"); +exports.GdalMetaDataListTypeEnum = void 0; +exports.instanceOfGdalMetaDataList = instanceOfGdalMetaDataList; +exports.GdalMetaDataListFromJSON = GdalMetaDataListFromJSON; +exports.GdalMetaDataListFromJSONTyped = GdalMetaDataListFromJSONTyped; +exports.GdalMetaDataListToJSON = GdalMetaDataListToJSON; +exports.GdalMetaDataListToJSONTyped = GdalMetaDataListToJSONTyped; const RasterResultDescriptor_1 = require("./RasterResultDescriptor"); +const GdalLoadingInfoTemporalSlice_1 = require("./GdalLoadingInfoTemporalSlice"); /** * @export */ @@ -26,19 +31,19 @@ exports.GdalMetaDataListTypeEnum = { * Check if a given object implements the GdalMetaDataList interface. */ function instanceOfGdalMetaDataList(value) { - let isInstance = true; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('params' in value) || value['params'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfGdalMetaDataList = instanceOfGdalMetaDataList; function GdalMetaDataListFromJSON(json) { return GdalMetaDataListFromJSONTyped(json, false); } -exports.GdalMetaDataListFromJSON = GdalMetaDataListFromJSON; function GdalMetaDataListFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -47,18 +52,16 @@ function GdalMetaDataListFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.GdalMetaDataListFromJSONTyped = GdalMetaDataListFromJSONTyped; -function GdalMetaDataListToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function GdalMetaDataListToJSON(json) { + return GdalMetaDataListToJSONTyped(json, false); +} +function GdalMetaDataListToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'params': (value.params.map(GdalLoadingInfoTemporalSlice_1.GdalLoadingInfoTemporalSliceToJSON)), - 'resultDescriptor': (0, RasterResultDescriptor_1.RasterResultDescriptorToJSON)(value.resultDescriptor), - 'type': value.type, + 'params': (value['params'].map(GdalLoadingInfoTemporalSlice_1.GdalLoadingInfoTemporalSliceToJSON)), + 'resultDescriptor': (0, RasterResultDescriptor_1.RasterResultDescriptorToJSON)(value['resultDescriptor']), + 'type': value['type'], }; } -exports.GdalMetaDataListToJSON = GdalMetaDataListToJSON; diff --git a/typescript/dist/models/GdalMetaDataRegular.d.ts b/typescript/dist/models/GdalMetaDataRegular.d.ts index 04e5f784..f91ecd4f 100644 --- a/typescript/dist/models/GdalMetaDataRegular.d.ts +++ b/typescript/dist/models/GdalMetaDataRegular.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { GdalDatasetParameters } from './GdalDatasetParameters'; +import type { TimeStep } from './TimeStep'; +import type { TimeInterval } from './TimeInterval'; import type { GdalSourceTimePlaceholder } from './GdalSourceTimePlaceholder'; import type { RasterResultDescriptor } from './RasterResultDescriptor'; -import type { TimeInterval } from './TimeInterval'; -import type { TimeStep } from './TimeStep'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; /** * * @export @@ -75,7 +75,8 @@ export type GdalMetaDataRegularTypeEnum = typeof GdalMetaDataRegularTypeEnum[key /** * Check if a given object implements the GdalMetaDataRegular interface. */ -export declare function instanceOfGdalMetaDataRegular(value: object): boolean; +export declare function instanceOfGdalMetaDataRegular(value: object): value is GdalMetaDataRegular; export declare function GdalMetaDataRegularFromJSON(json: any): GdalMetaDataRegular; export declare function GdalMetaDataRegularFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetaDataRegular; -export declare function GdalMetaDataRegularToJSON(value?: GdalMetaDataRegular | null): any; +export declare function GdalMetaDataRegularToJSON(json: any): GdalMetaDataRegular; +export declare function GdalMetaDataRegularToJSONTyped(value?: GdalMetaDataRegular | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/GdalMetaDataRegular.js b/typescript/dist/models/GdalMetaDataRegular.js index 60411ef1..5662da8f 100644 --- a/typescript/dist/models/GdalMetaDataRegular.js +++ b/typescript/dist/models/GdalMetaDataRegular.js @@ -13,13 +13,18 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GdalMetaDataRegularToJSON = exports.GdalMetaDataRegularFromJSONTyped = exports.GdalMetaDataRegularFromJSON = exports.instanceOfGdalMetaDataRegular = exports.GdalMetaDataRegularTypeEnum = void 0; +exports.GdalMetaDataRegularTypeEnum = void 0; +exports.instanceOfGdalMetaDataRegular = instanceOfGdalMetaDataRegular; +exports.GdalMetaDataRegularFromJSON = GdalMetaDataRegularFromJSON; +exports.GdalMetaDataRegularFromJSONTyped = GdalMetaDataRegularFromJSONTyped; +exports.GdalMetaDataRegularToJSON = GdalMetaDataRegularToJSON; +exports.GdalMetaDataRegularToJSONTyped = GdalMetaDataRegularToJSONTyped; const runtime_1 = require("../runtime"); -const GdalDatasetParameters_1 = require("./GdalDatasetParameters"); +const TimeStep_1 = require("./TimeStep"); +const TimeInterval_1 = require("./TimeInterval"); const GdalSourceTimePlaceholder_1 = require("./GdalSourceTimePlaceholder"); const RasterResultDescriptor_1 = require("./RasterResultDescriptor"); -const TimeInterval_1 = require("./TimeInterval"); -const TimeStep_1 = require("./TimeStep"); +const GdalDatasetParameters_1 = require("./GdalDatasetParameters"); /** * @export */ @@ -30,26 +35,29 @@ exports.GdalMetaDataRegularTypeEnum = { * Check if a given object implements the GdalMetaDataRegular interface. */ function instanceOfGdalMetaDataRegular(value) { - let isInstance = true; - isInstance = isInstance && "dataTime" in value; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "step" in value; - isInstance = isInstance && "timePlaceholders" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('dataTime' in value) || value['dataTime'] === undefined) + return false; + if (!('params' in value) || value['params'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('step' in value) || value['step'] === undefined) + return false; + if (!('timePlaceholders' in value) || value['timePlaceholders'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfGdalMetaDataRegular = instanceOfGdalMetaDataRegular; function GdalMetaDataRegularFromJSON(json) { return GdalMetaDataRegularFromJSONTyped(json, false); } -exports.GdalMetaDataRegularFromJSON = GdalMetaDataRegularFromJSON; function GdalMetaDataRegularFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'cacheTtl': !(0, runtime_1.exists)(json, 'cacheTtl') ? undefined : json['cacheTtl'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], 'dataTime': (0, TimeInterval_1.TimeIntervalFromJSON)(json['dataTime']), 'params': (0, GdalDatasetParameters_1.GdalDatasetParametersFromJSON)(json['params']), 'resultDescriptor': (0, RasterResultDescriptor_1.RasterResultDescriptorFromJSON)(json['resultDescriptor']), @@ -58,22 +66,20 @@ function GdalMetaDataRegularFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.GdalMetaDataRegularFromJSONTyped = GdalMetaDataRegularFromJSONTyped; -function GdalMetaDataRegularToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function GdalMetaDataRegularToJSON(json) { + return GdalMetaDataRegularToJSONTyped(json, false); +} +function GdalMetaDataRegularToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'cacheTtl': value.cacheTtl, - 'dataTime': (0, TimeInterval_1.TimeIntervalToJSON)(value.dataTime), - 'params': (0, GdalDatasetParameters_1.GdalDatasetParametersToJSON)(value.params), - 'resultDescriptor': (0, RasterResultDescriptor_1.RasterResultDescriptorToJSON)(value.resultDescriptor), - 'step': (0, TimeStep_1.TimeStepToJSON)(value.step), - 'timePlaceholders': ((0, runtime_1.mapValues)(value.timePlaceholders, GdalSourceTimePlaceholder_1.GdalSourceTimePlaceholderToJSON)), - 'type': value.type, + 'cacheTtl': value['cacheTtl'], + 'dataTime': (0, TimeInterval_1.TimeIntervalToJSON)(value['dataTime']), + 'params': (0, GdalDatasetParameters_1.GdalDatasetParametersToJSON)(value['params']), + 'resultDescriptor': (0, RasterResultDescriptor_1.RasterResultDescriptorToJSON)(value['resultDescriptor']), + 'step': (0, TimeStep_1.TimeStepToJSON)(value['step']), + 'timePlaceholders': ((0, runtime_1.mapValues)(value['timePlaceholders'], GdalSourceTimePlaceholder_1.GdalSourceTimePlaceholderToJSON)), + 'type': value['type'], }; } -exports.GdalMetaDataRegularToJSON = GdalMetaDataRegularToJSON; diff --git a/typescript/dist/models/GdalMetaDataStatic.d.ts b/typescript/dist/models/GdalMetaDataStatic.d.ts index d06ae93e..735d01af 100644 --- a/typescript/dist/models/GdalMetaDataStatic.d.ts +++ b/typescript/dist/models/GdalMetaDataStatic.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { GdalDatasetParameters } from './GdalDatasetParameters'; -import type { RasterResultDescriptor } from './RasterResultDescriptor'; import type { TimeInterval } from './TimeInterval'; +import type { RasterResultDescriptor } from './RasterResultDescriptor'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; /** * * @export @@ -59,7 +59,8 @@ export type GdalMetaDataStaticTypeEnum = typeof GdalMetaDataStaticTypeEnum[keyof /** * Check if a given object implements the GdalMetaDataStatic interface. */ -export declare function instanceOfGdalMetaDataStatic(value: object): boolean; +export declare function instanceOfGdalMetaDataStatic(value: object): value is GdalMetaDataStatic; export declare function GdalMetaDataStaticFromJSON(json: any): GdalMetaDataStatic; export declare function GdalMetaDataStaticFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetaDataStatic; -export declare function GdalMetaDataStaticToJSON(value?: GdalMetaDataStatic | null): any; +export declare function GdalMetaDataStaticToJSON(json: any): GdalMetaDataStatic; +export declare function GdalMetaDataStaticToJSONTyped(value?: GdalMetaDataStatic | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/GdalMetaDataStatic.js b/typescript/dist/models/GdalMetaDataStatic.js index 37e89fb8..69900e6a 100644 --- a/typescript/dist/models/GdalMetaDataStatic.js +++ b/typescript/dist/models/GdalMetaDataStatic.js @@ -13,11 +13,15 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GdalMetaDataStaticToJSON = exports.GdalMetaDataStaticFromJSONTyped = exports.GdalMetaDataStaticFromJSON = exports.instanceOfGdalMetaDataStatic = exports.GdalMetaDataStaticTypeEnum = void 0; -const runtime_1 = require("../runtime"); -const GdalDatasetParameters_1 = require("./GdalDatasetParameters"); -const RasterResultDescriptor_1 = require("./RasterResultDescriptor"); +exports.GdalMetaDataStaticTypeEnum = void 0; +exports.instanceOfGdalMetaDataStatic = instanceOfGdalMetaDataStatic; +exports.GdalMetaDataStaticFromJSON = GdalMetaDataStaticFromJSON; +exports.GdalMetaDataStaticFromJSONTyped = GdalMetaDataStaticFromJSONTyped; +exports.GdalMetaDataStaticToJSON = GdalMetaDataStaticToJSON; +exports.GdalMetaDataStaticToJSONTyped = GdalMetaDataStaticToJSONTyped; const TimeInterval_1 = require("./TimeInterval"); +const RasterResultDescriptor_1 = require("./RasterResultDescriptor"); +const GdalDatasetParameters_1 = require("./GdalDatasetParameters"); /** * @export */ @@ -28,43 +32,41 @@ exports.GdalMetaDataStaticTypeEnum = { * Check if a given object implements the GdalMetaDataStatic interface. */ function instanceOfGdalMetaDataStatic(value) { - let isInstance = true; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('params' in value) || value['params'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfGdalMetaDataStatic = instanceOfGdalMetaDataStatic; function GdalMetaDataStaticFromJSON(json) { return GdalMetaDataStaticFromJSONTyped(json, false); } -exports.GdalMetaDataStaticFromJSON = GdalMetaDataStaticFromJSON; function GdalMetaDataStaticFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'cacheTtl': !(0, runtime_1.exists)(json, 'cacheTtl') ? undefined : json['cacheTtl'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], 'params': (0, GdalDatasetParameters_1.GdalDatasetParametersFromJSON)(json['params']), 'resultDescriptor': (0, RasterResultDescriptor_1.RasterResultDescriptorFromJSON)(json['resultDescriptor']), - 'time': !(0, runtime_1.exists)(json, 'time') ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), + 'time': json['time'] == null ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), 'type': json['type'], }; } -exports.GdalMetaDataStaticFromJSONTyped = GdalMetaDataStaticFromJSONTyped; -function GdalMetaDataStaticToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function GdalMetaDataStaticToJSON(json) { + return GdalMetaDataStaticToJSONTyped(json, false); +} +function GdalMetaDataStaticToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'cacheTtl': value.cacheTtl, - 'params': (0, GdalDatasetParameters_1.GdalDatasetParametersToJSON)(value.params), - 'resultDescriptor': (0, RasterResultDescriptor_1.RasterResultDescriptorToJSON)(value.resultDescriptor), - 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value.time), - 'type': value.type, + 'cacheTtl': value['cacheTtl'], + 'params': (0, GdalDatasetParameters_1.GdalDatasetParametersToJSON)(value['params']), + 'resultDescriptor': (0, RasterResultDescriptor_1.RasterResultDescriptorToJSON)(value['resultDescriptor']), + 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value['time']), + 'type': value['type'], }; } -exports.GdalMetaDataStaticToJSON = GdalMetaDataStaticToJSON; diff --git a/typescript/dist/models/GdalMetadataMapping.d.ts b/typescript/dist/models/GdalMetadataMapping.d.ts index 3961e501..657aae9f 100644 --- a/typescript/dist/models/GdalMetadataMapping.d.ts +++ b/typescript/dist/models/GdalMetadataMapping.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { RasterPropertiesEntryType } from './RasterPropertiesEntryType'; import type { RasterPropertiesKey } from './RasterPropertiesKey'; +import type { RasterPropertiesEntryType } from './RasterPropertiesEntryType'; /** * * @export @@ -39,7 +39,8 @@ export interface GdalMetadataMapping { /** * Check if a given object implements the GdalMetadataMapping interface. */ -export declare function instanceOfGdalMetadataMapping(value: object): boolean; +export declare function instanceOfGdalMetadataMapping(value: object): value is GdalMetadataMapping; export declare function GdalMetadataMappingFromJSON(json: any): GdalMetadataMapping; export declare function GdalMetadataMappingFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetadataMapping; -export declare function GdalMetadataMappingToJSON(value?: GdalMetadataMapping | null): any; +export declare function GdalMetadataMappingToJSON(json: any): GdalMetadataMapping; +export declare function GdalMetadataMappingToJSONTyped(value?: GdalMetadataMapping | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/GdalMetadataMapping.js b/typescript/dist/models/GdalMetadataMapping.js index 97ff7d6d..87e94632 100644 --- a/typescript/dist/models/GdalMetadataMapping.js +++ b/typescript/dist/models/GdalMetadataMapping.js @@ -13,26 +13,30 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GdalMetadataMappingToJSON = exports.GdalMetadataMappingFromJSONTyped = exports.GdalMetadataMappingFromJSON = exports.instanceOfGdalMetadataMapping = void 0; -const RasterPropertiesEntryType_1 = require("./RasterPropertiesEntryType"); +exports.instanceOfGdalMetadataMapping = instanceOfGdalMetadataMapping; +exports.GdalMetadataMappingFromJSON = GdalMetadataMappingFromJSON; +exports.GdalMetadataMappingFromJSONTyped = GdalMetadataMappingFromJSONTyped; +exports.GdalMetadataMappingToJSON = GdalMetadataMappingToJSON; +exports.GdalMetadataMappingToJSONTyped = GdalMetadataMappingToJSONTyped; const RasterPropertiesKey_1 = require("./RasterPropertiesKey"); +const RasterPropertiesEntryType_1 = require("./RasterPropertiesEntryType"); /** * Check if a given object implements the GdalMetadataMapping interface. */ function instanceOfGdalMetadataMapping(value) { - let isInstance = true; - isInstance = isInstance && "sourceKey" in value; - isInstance = isInstance && "targetKey" in value; - isInstance = isInstance && "targetType" in value; - return isInstance; + if (!('sourceKey' in value) || value['sourceKey'] === undefined) + return false; + if (!('targetKey' in value) || value['targetKey'] === undefined) + return false; + if (!('targetType' in value) || value['targetType'] === undefined) + return false; + return true; } -exports.instanceOfGdalMetadataMapping = instanceOfGdalMetadataMapping; function GdalMetadataMappingFromJSON(json) { return GdalMetadataMappingFromJSONTyped(json, false); } -exports.GdalMetadataMappingFromJSON = GdalMetadataMappingFromJSON; function GdalMetadataMappingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,18 +45,16 @@ function GdalMetadataMappingFromJSONTyped(json, ignoreDiscriminator) { 'targetType': (0, RasterPropertiesEntryType_1.RasterPropertiesEntryTypeFromJSON)(json['target_type']), }; } -exports.GdalMetadataMappingFromJSONTyped = GdalMetadataMappingFromJSONTyped; -function GdalMetadataMappingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function GdalMetadataMappingToJSON(json) { + return GdalMetadataMappingToJSONTyped(json, false); +} +function GdalMetadataMappingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'source_key': (0, RasterPropertiesKey_1.RasterPropertiesKeyToJSON)(value.sourceKey), - 'target_key': (0, RasterPropertiesKey_1.RasterPropertiesKeyToJSON)(value.targetKey), - 'target_type': (0, RasterPropertiesEntryType_1.RasterPropertiesEntryTypeToJSON)(value.targetType), + 'source_key': (0, RasterPropertiesKey_1.RasterPropertiesKeyToJSON)(value['sourceKey']), + 'target_key': (0, RasterPropertiesKey_1.RasterPropertiesKeyToJSON)(value['targetKey']), + 'target_type': (0, RasterPropertiesEntryType_1.RasterPropertiesEntryTypeToJSON)(value['targetType']), }; } -exports.GdalMetadataMappingToJSON = GdalMetadataMappingToJSON; diff --git a/typescript/dist/models/GdalMetadataNetCdfCf.d.ts b/typescript/dist/models/GdalMetadataNetCdfCf.d.ts index cd177621..2105357e 100644 --- a/typescript/dist/models/GdalMetadataNetCdfCf.d.ts +++ b/typescript/dist/models/GdalMetadataNetCdfCf.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { GdalDatasetParameters } from './GdalDatasetParameters'; -import type { RasterResultDescriptor } from './RasterResultDescriptor'; import type { TimeStep } from './TimeStep'; +import type { RasterResultDescriptor } from './RasterResultDescriptor'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; /** * Meta data for 4D `NetCDF` CF datasets * @export @@ -78,7 +78,8 @@ export type GdalMetadataNetCdfCfTypeEnum = typeof GdalMetadataNetCdfCfTypeEnum[k /** * Check if a given object implements the GdalMetadataNetCdfCf interface. */ -export declare function instanceOfGdalMetadataNetCdfCf(value: object): boolean; +export declare function instanceOfGdalMetadataNetCdfCf(value: object): value is GdalMetadataNetCdfCf; export declare function GdalMetadataNetCdfCfFromJSON(json: any): GdalMetadataNetCdfCf; export declare function GdalMetadataNetCdfCfFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetadataNetCdfCf; -export declare function GdalMetadataNetCdfCfToJSON(value?: GdalMetadataNetCdfCf | null): any; +export declare function GdalMetadataNetCdfCfToJSON(json: any): GdalMetadataNetCdfCf; +export declare function GdalMetadataNetCdfCfToJSONTyped(value?: GdalMetadataNetCdfCf | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/GdalMetadataNetCdfCf.js b/typescript/dist/models/GdalMetadataNetCdfCf.js index 7683e2a0..41727148 100644 --- a/typescript/dist/models/GdalMetadataNetCdfCf.js +++ b/typescript/dist/models/GdalMetadataNetCdfCf.js @@ -13,11 +13,15 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GdalMetadataNetCdfCfToJSON = exports.GdalMetadataNetCdfCfFromJSONTyped = exports.GdalMetadataNetCdfCfFromJSON = exports.instanceOfGdalMetadataNetCdfCf = exports.GdalMetadataNetCdfCfTypeEnum = void 0; -const runtime_1 = require("../runtime"); -const GdalDatasetParameters_1 = require("./GdalDatasetParameters"); -const RasterResultDescriptor_1 = require("./RasterResultDescriptor"); +exports.GdalMetadataNetCdfCfTypeEnum = void 0; +exports.instanceOfGdalMetadataNetCdfCf = instanceOfGdalMetadataNetCdfCf; +exports.GdalMetadataNetCdfCfFromJSON = GdalMetadataNetCdfCfFromJSON; +exports.GdalMetadataNetCdfCfFromJSONTyped = GdalMetadataNetCdfCfFromJSONTyped; +exports.GdalMetadataNetCdfCfToJSON = GdalMetadataNetCdfCfToJSON; +exports.GdalMetadataNetCdfCfToJSONTyped = GdalMetadataNetCdfCfToJSONTyped; const TimeStep_1 = require("./TimeStep"); +const RasterResultDescriptor_1 = require("./RasterResultDescriptor"); +const GdalDatasetParameters_1 = require("./GdalDatasetParameters"); /** * @export */ @@ -28,28 +32,32 @@ exports.GdalMetadataNetCdfCfTypeEnum = { * Check if a given object implements the GdalMetadataNetCdfCf interface. */ function instanceOfGdalMetadataNetCdfCf(value) { - let isInstance = true; - isInstance = isInstance && "bandOffset" in value; - isInstance = isInstance && "end" in value; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "start" in value; - isInstance = isInstance && "step" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('bandOffset' in value) || value['bandOffset'] === undefined) + return false; + if (!('end' in value) || value['end'] === undefined) + return false; + if (!('params' in value) || value['params'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('start' in value) || value['start'] === undefined) + return false; + if (!('step' in value) || value['step'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfGdalMetadataNetCdfCf = instanceOfGdalMetadataNetCdfCf; function GdalMetadataNetCdfCfFromJSON(json) { return GdalMetadataNetCdfCfFromJSONTyped(json, false); } -exports.GdalMetadataNetCdfCfFromJSON = GdalMetadataNetCdfCfFromJSON; function GdalMetadataNetCdfCfFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bandOffset': json['bandOffset'], - 'cacheTtl': !(0, runtime_1.exists)(json, 'cacheTtl') ? undefined : json['cacheTtl'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], 'end': json['end'], 'params': (0, GdalDatasetParameters_1.GdalDatasetParametersFromJSON)(json['params']), 'resultDescriptor': (0, RasterResultDescriptor_1.RasterResultDescriptorFromJSON)(json['resultDescriptor']), @@ -58,23 +66,21 @@ function GdalMetadataNetCdfCfFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.GdalMetadataNetCdfCfFromJSONTyped = GdalMetadataNetCdfCfFromJSONTyped; -function GdalMetadataNetCdfCfToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function GdalMetadataNetCdfCfToJSON(json) { + return GdalMetadataNetCdfCfToJSONTyped(json, false); +} +function GdalMetadataNetCdfCfToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bandOffset': value.bandOffset, - 'cacheTtl': value.cacheTtl, - 'end': value.end, - 'params': (0, GdalDatasetParameters_1.GdalDatasetParametersToJSON)(value.params), - 'resultDescriptor': (0, RasterResultDescriptor_1.RasterResultDescriptorToJSON)(value.resultDescriptor), - 'start': value.start, - 'step': (0, TimeStep_1.TimeStepToJSON)(value.step), - 'type': value.type, + 'bandOffset': value['bandOffset'], + 'cacheTtl': value['cacheTtl'], + 'end': value['end'], + 'params': (0, GdalDatasetParameters_1.GdalDatasetParametersToJSON)(value['params']), + 'resultDescriptor': (0, RasterResultDescriptor_1.RasterResultDescriptorToJSON)(value['resultDescriptor']), + 'start': value['start'], + 'step': (0, TimeStep_1.TimeStepToJSON)(value['step']), + 'type': value['type'], }; } -exports.GdalMetadataNetCdfCfToJSON = GdalMetadataNetCdfCfToJSON; diff --git a/typescript/dist/models/GdalSourceTimePlaceholder.d.ts b/typescript/dist/models/GdalSourceTimePlaceholder.d.ts index 15214023..d8e9be5b 100644 --- a/typescript/dist/models/GdalSourceTimePlaceholder.d.ts +++ b/typescript/dist/models/GdalSourceTimePlaceholder.d.ts @@ -32,7 +32,8 @@ export interface GdalSourceTimePlaceholder { /** * Check if a given object implements the GdalSourceTimePlaceholder interface. */ -export declare function instanceOfGdalSourceTimePlaceholder(value: object): boolean; +export declare function instanceOfGdalSourceTimePlaceholder(value: object): value is GdalSourceTimePlaceholder; export declare function GdalSourceTimePlaceholderFromJSON(json: any): GdalSourceTimePlaceholder; export declare function GdalSourceTimePlaceholderFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalSourceTimePlaceholder; -export declare function GdalSourceTimePlaceholderToJSON(value?: GdalSourceTimePlaceholder | null): any; +export declare function GdalSourceTimePlaceholderToJSON(json: any): GdalSourceTimePlaceholder; +export declare function GdalSourceTimePlaceholderToJSONTyped(value?: GdalSourceTimePlaceholder | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/GdalSourceTimePlaceholder.js b/typescript/dist/models/GdalSourceTimePlaceholder.js index 50ee7f0f..c336e09d 100644 --- a/typescript/dist/models/GdalSourceTimePlaceholder.js +++ b/typescript/dist/models/GdalSourceTimePlaceholder.js @@ -13,24 +13,27 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GdalSourceTimePlaceholderToJSON = exports.GdalSourceTimePlaceholderFromJSONTyped = exports.GdalSourceTimePlaceholderFromJSON = exports.instanceOfGdalSourceTimePlaceholder = void 0; +exports.instanceOfGdalSourceTimePlaceholder = instanceOfGdalSourceTimePlaceholder; +exports.GdalSourceTimePlaceholderFromJSON = GdalSourceTimePlaceholderFromJSON; +exports.GdalSourceTimePlaceholderFromJSONTyped = GdalSourceTimePlaceholderFromJSONTyped; +exports.GdalSourceTimePlaceholderToJSON = GdalSourceTimePlaceholderToJSON; +exports.GdalSourceTimePlaceholderToJSONTyped = GdalSourceTimePlaceholderToJSONTyped; const TimeReference_1 = require("./TimeReference"); /** * Check if a given object implements the GdalSourceTimePlaceholder interface. */ function instanceOfGdalSourceTimePlaceholder(value) { - let isInstance = true; - isInstance = isInstance && "format" in value; - isInstance = isInstance && "reference" in value; - return isInstance; + if (!('format' in value) || value['format'] === undefined) + return false; + if (!('reference' in value) || value['reference'] === undefined) + return false; + return true; } -exports.instanceOfGdalSourceTimePlaceholder = instanceOfGdalSourceTimePlaceholder; function GdalSourceTimePlaceholderFromJSON(json) { return GdalSourceTimePlaceholderFromJSONTyped(json, false); } -exports.GdalSourceTimePlaceholderFromJSON = GdalSourceTimePlaceholderFromJSON; function GdalSourceTimePlaceholderFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,17 +41,15 @@ function GdalSourceTimePlaceholderFromJSONTyped(json, ignoreDiscriminator) { 'reference': (0, TimeReference_1.TimeReferenceFromJSON)(json['reference']), }; } -exports.GdalSourceTimePlaceholderFromJSONTyped = GdalSourceTimePlaceholderFromJSONTyped; -function GdalSourceTimePlaceholderToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function GdalSourceTimePlaceholderToJSON(json) { + return GdalSourceTimePlaceholderToJSONTyped(json, false); +} +function GdalSourceTimePlaceholderToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'format': value.format, - 'reference': (0, TimeReference_1.TimeReferenceToJSON)(value.reference), + 'format': value['format'], + 'reference': (0, TimeReference_1.TimeReferenceToJSON)(value['reference']), }; } -exports.GdalSourceTimePlaceholderToJSON = GdalSourceTimePlaceholderToJSON; diff --git a/typescript/dist/models/GeoJson.d.ts b/typescript/dist/models/GeoJson.d.ts index 004ba2d1..993ad8c6 100644 --- a/typescript/dist/models/GeoJson.d.ts +++ b/typescript/dist/models/GeoJson.d.ts @@ -32,7 +32,8 @@ export interface GeoJson { /** * Check if a given object implements the GeoJson interface. */ -export declare function instanceOfGeoJson(value: object): boolean; +export declare function instanceOfGeoJson(value: object): value is GeoJson; export declare function GeoJsonFromJSON(json: any): GeoJson; export declare function GeoJsonFromJSONTyped(json: any, ignoreDiscriminator: boolean): GeoJson; -export declare function GeoJsonToJSON(value?: GeoJson | null): any; +export declare function GeoJsonToJSON(json: any): GeoJson; +export declare function GeoJsonToJSONTyped(value?: GeoJson | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/GeoJson.js b/typescript/dist/models/GeoJson.js index 4422a361..c9ecfb07 100644 --- a/typescript/dist/models/GeoJson.js +++ b/typescript/dist/models/GeoJson.js @@ -13,24 +13,27 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GeoJsonToJSON = exports.GeoJsonFromJSONTyped = exports.GeoJsonFromJSON = exports.instanceOfGeoJson = void 0; +exports.instanceOfGeoJson = instanceOfGeoJson; +exports.GeoJsonFromJSON = GeoJsonFromJSON; +exports.GeoJsonFromJSONTyped = GeoJsonFromJSONTyped; +exports.GeoJsonToJSON = GeoJsonToJSON; +exports.GeoJsonToJSONTyped = GeoJsonToJSONTyped; const CollectionType_1 = require("./CollectionType"); /** * Check if a given object implements the GeoJson interface. */ function instanceOfGeoJson(value) { - let isInstance = true; - isInstance = isInstance && "features" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('features' in value) || value['features'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfGeoJson = instanceOfGeoJson; function GeoJsonFromJSON(json) { return GeoJsonFromJSONTyped(json, false); } -exports.GeoJsonFromJSON = GeoJsonFromJSON; function GeoJsonFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,17 +41,15 @@ function GeoJsonFromJSONTyped(json, ignoreDiscriminator) { 'type': (0, CollectionType_1.CollectionTypeFromJSON)(json['type']), }; } -exports.GeoJsonFromJSONTyped = GeoJsonFromJSONTyped; -function GeoJsonToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function GeoJsonToJSON(json) { + return GeoJsonToJSONTyped(json, false); +} +function GeoJsonToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'features': value.features, - 'type': (0, CollectionType_1.CollectionTypeToJSON)(value.type), + 'features': value['features'], + 'type': (0, CollectionType_1.CollectionTypeToJSON)(value['type']), }; } -exports.GeoJsonToJSON = GeoJsonToJSON; diff --git a/typescript/dist/models/GetCapabilitiesFormat.d.ts b/typescript/dist/models/GetCapabilitiesFormat.d.ts index 95b0b23f..fd1027eb 100644 --- a/typescript/dist/models/GetCapabilitiesFormat.d.ts +++ b/typescript/dist/models/GetCapabilitiesFormat.d.ts @@ -17,6 +17,8 @@ export declare const GetCapabilitiesFormat: { readonly TextXml: "text/xml"; }; export type GetCapabilitiesFormat = typeof GetCapabilitiesFormat[keyof typeof GetCapabilitiesFormat]; +export declare function instanceOfGetCapabilitiesFormat(value: any): boolean; export declare function GetCapabilitiesFormatFromJSON(json: any): GetCapabilitiesFormat; export declare function GetCapabilitiesFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetCapabilitiesFormat; export declare function GetCapabilitiesFormatToJSON(value?: GetCapabilitiesFormat | null): any; +export declare function GetCapabilitiesFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCapabilitiesFormat; diff --git a/typescript/dist/models/GetCapabilitiesFormat.js b/typescript/dist/models/GetCapabilitiesFormat.js index ac9ba6c9..b16c9bb3 100644 --- a/typescript/dist/models/GetCapabilitiesFormat.js +++ b/typescript/dist/models/GetCapabilitiesFormat.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetCapabilitiesFormatToJSON = exports.GetCapabilitiesFormatFromJSONTyped = exports.GetCapabilitiesFormatFromJSON = exports.GetCapabilitiesFormat = void 0; +exports.GetCapabilitiesFormat = void 0; +exports.instanceOfGetCapabilitiesFormat = instanceOfGetCapabilitiesFormat; +exports.GetCapabilitiesFormatFromJSON = GetCapabilitiesFormatFromJSON; +exports.GetCapabilitiesFormatFromJSONTyped = GetCapabilitiesFormatFromJSONTyped; +exports.GetCapabilitiesFormatToJSON = GetCapabilitiesFormatToJSON; +exports.GetCapabilitiesFormatToJSONTyped = GetCapabilitiesFormatToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.GetCapabilitiesFormatToJSON = exports.GetCapabilitiesFormatFromJSONTyped exports.GetCapabilitiesFormat = { TextXml: 'text/xml' }; +function instanceOfGetCapabilitiesFormat(value) { + for (const key in exports.GetCapabilitiesFormat) { + if (Object.prototype.hasOwnProperty.call(exports.GetCapabilitiesFormat, key)) { + if (exports.GetCapabilitiesFormat[key] === value) { + return true; + } + } + } + return false; +} function GetCapabilitiesFormatFromJSON(json) { return GetCapabilitiesFormatFromJSONTyped(json, false); } -exports.GetCapabilitiesFormatFromJSON = GetCapabilitiesFormatFromJSON; function GetCapabilitiesFormatFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.GetCapabilitiesFormatFromJSONTyped = GetCapabilitiesFormatFromJSONTyped; function GetCapabilitiesFormatToJSON(value) { return value; } -exports.GetCapabilitiesFormatToJSON = GetCapabilitiesFormatToJSON; +function GetCapabilitiesFormatToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/GetCapabilitiesRequest.d.ts b/typescript/dist/models/GetCapabilitiesRequest.d.ts index c7df069d..4c06be57 100644 --- a/typescript/dist/models/GetCapabilitiesRequest.d.ts +++ b/typescript/dist/models/GetCapabilitiesRequest.d.ts @@ -17,6 +17,8 @@ export declare const GetCapabilitiesRequest: { readonly GetCapabilities: "GetCapabilities"; }; export type GetCapabilitiesRequest = typeof GetCapabilitiesRequest[keyof typeof GetCapabilitiesRequest]; +export declare function instanceOfGetCapabilitiesRequest(value: any): boolean; export declare function GetCapabilitiesRequestFromJSON(json: any): GetCapabilitiesRequest; export declare function GetCapabilitiesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetCapabilitiesRequest; export declare function GetCapabilitiesRequestToJSON(value?: GetCapabilitiesRequest | null): any; +export declare function GetCapabilitiesRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCapabilitiesRequest; diff --git a/typescript/dist/models/GetCapabilitiesRequest.js b/typescript/dist/models/GetCapabilitiesRequest.js index 91429981..45b69b98 100644 --- a/typescript/dist/models/GetCapabilitiesRequest.js +++ b/typescript/dist/models/GetCapabilitiesRequest.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetCapabilitiesRequestToJSON = exports.GetCapabilitiesRequestFromJSONTyped = exports.GetCapabilitiesRequestFromJSON = exports.GetCapabilitiesRequest = void 0; +exports.GetCapabilitiesRequest = void 0; +exports.instanceOfGetCapabilitiesRequest = instanceOfGetCapabilitiesRequest; +exports.GetCapabilitiesRequestFromJSON = GetCapabilitiesRequestFromJSON; +exports.GetCapabilitiesRequestFromJSONTyped = GetCapabilitiesRequestFromJSONTyped; +exports.GetCapabilitiesRequestToJSON = GetCapabilitiesRequestToJSON; +exports.GetCapabilitiesRequestToJSONTyped = GetCapabilitiesRequestToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.GetCapabilitiesRequestToJSON = exports.GetCapabilitiesRequestFromJSONTyp exports.GetCapabilitiesRequest = { GetCapabilities: 'GetCapabilities' }; +function instanceOfGetCapabilitiesRequest(value) { + for (const key in exports.GetCapabilitiesRequest) { + if (Object.prototype.hasOwnProperty.call(exports.GetCapabilitiesRequest, key)) { + if (exports.GetCapabilitiesRequest[key] === value) { + return true; + } + } + } + return false; +} function GetCapabilitiesRequestFromJSON(json) { return GetCapabilitiesRequestFromJSONTyped(json, false); } -exports.GetCapabilitiesRequestFromJSON = GetCapabilitiesRequestFromJSON; function GetCapabilitiesRequestFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.GetCapabilitiesRequestFromJSONTyped = GetCapabilitiesRequestFromJSONTyped; function GetCapabilitiesRequestToJSON(value) { return value; } -exports.GetCapabilitiesRequestToJSON = GetCapabilitiesRequestToJSON; +function GetCapabilitiesRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/GetCoverageFormat.d.ts b/typescript/dist/models/GetCoverageFormat.d.ts index dffbb0e8..f4b2f64d 100644 --- a/typescript/dist/models/GetCoverageFormat.d.ts +++ b/typescript/dist/models/GetCoverageFormat.d.ts @@ -17,6 +17,8 @@ export declare const GetCoverageFormat: { readonly ImageTiff: "image/tiff"; }; export type GetCoverageFormat = typeof GetCoverageFormat[keyof typeof GetCoverageFormat]; +export declare function instanceOfGetCoverageFormat(value: any): boolean; export declare function GetCoverageFormatFromJSON(json: any): GetCoverageFormat; export declare function GetCoverageFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetCoverageFormat; export declare function GetCoverageFormatToJSON(value?: GetCoverageFormat | null): any; +export declare function GetCoverageFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCoverageFormat; diff --git a/typescript/dist/models/GetCoverageFormat.js b/typescript/dist/models/GetCoverageFormat.js index 9720b77e..1a45d4f6 100644 --- a/typescript/dist/models/GetCoverageFormat.js +++ b/typescript/dist/models/GetCoverageFormat.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetCoverageFormatToJSON = exports.GetCoverageFormatFromJSONTyped = exports.GetCoverageFormatFromJSON = exports.GetCoverageFormat = void 0; +exports.GetCoverageFormat = void 0; +exports.instanceOfGetCoverageFormat = instanceOfGetCoverageFormat; +exports.GetCoverageFormatFromJSON = GetCoverageFormatFromJSON; +exports.GetCoverageFormatFromJSONTyped = GetCoverageFormatFromJSONTyped; +exports.GetCoverageFormatToJSON = GetCoverageFormatToJSON; +exports.GetCoverageFormatToJSONTyped = GetCoverageFormatToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.GetCoverageFormatToJSON = exports.GetCoverageFormatFromJSONTyped = expor exports.GetCoverageFormat = { ImageTiff: 'image/tiff' }; +function instanceOfGetCoverageFormat(value) { + for (const key in exports.GetCoverageFormat) { + if (Object.prototype.hasOwnProperty.call(exports.GetCoverageFormat, key)) { + if (exports.GetCoverageFormat[key] === value) { + return true; + } + } + } + return false; +} function GetCoverageFormatFromJSON(json) { return GetCoverageFormatFromJSONTyped(json, false); } -exports.GetCoverageFormatFromJSON = GetCoverageFormatFromJSON; function GetCoverageFormatFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.GetCoverageFormatFromJSONTyped = GetCoverageFormatFromJSONTyped; function GetCoverageFormatToJSON(value) { return value; } -exports.GetCoverageFormatToJSON = GetCoverageFormatToJSON; +function GetCoverageFormatToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/GetCoverageRequest.d.ts b/typescript/dist/models/GetCoverageRequest.d.ts index 34801895..14c7eb33 100644 --- a/typescript/dist/models/GetCoverageRequest.d.ts +++ b/typescript/dist/models/GetCoverageRequest.d.ts @@ -17,6 +17,8 @@ export declare const GetCoverageRequest: { readonly GetCoverage: "GetCoverage"; }; export type GetCoverageRequest = typeof GetCoverageRequest[keyof typeof GetCoverageRequest]; +export declare function instanceOfGetCoverageRequest(value: any): boolean; export declare function GetCoverageRequestFromJSON(json: any): GetCoverageRequest; export declare function GetCoverageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetCoverageRequest; export declare function GetCoverageRequestToJSON(value?: GetCoverageRequest | null): any; +export declare function GetCoverageRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCoverageRequest; diff --git a/typescript/dist/models/GetCoverageRequest.js b/typescript/dist/models/GetCoverageRequest.js index 73ab125b..3b434c39 100644 --- a/typescript/dist/models/GetCoverageRequest.js +++ b/typescript/dist/models/GetCoverageRequest.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetCoverageRequestToJSON = exports.GetCoverageRequestFromJSONTyped = exports.GetCoverageRequestFromJSON = exports.GetCoverageRequest = void 0; +exports.GetCoverageRequest = void 0; +exports.instanceOfGetCoverageRequest = instanceOfGetCoverageRequest; +exports.GetCoverageRequestFromJSON = GetCoverageRequestFromJSON; +exports.GetCoverageRequestFromJSONTyped = GetCoverageRequestFromJSONTyped; +exports.GetCoverageRequestToJSON = GetCoverageRequestToJSON; +exports.GetCoverageRequestToJSONTyped = GetCoverageRequestToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.GetCoverageRequestToJSON = exports.GetCoverageRequestFromJSONTyped = exp exports.GetCoverageRequest = { GetCoverage: 'GetCoverage' }; +function instanceOfGetCoverageRequest(value) { + for (const key in exports.GetCoverageRequest) { + if (Object.prototype.hasOwnProperty.call(exports.GetCoverageRequest, key)) { + if (exports.GetCoverageRequest[key] === value) { + return true; + } + } + } + return false; +} function GetCoverageRequestFromJSON(json) { return GetCoverageRequestFromJSONTyped(json, false); } -exports.GetCoverageRequestFromJSON = GetCoverageRequestFromJSON; function GetCoverageRequestFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.GetCoverageRequestFromJSONTyped = GetCoverageRequestFromJSONTyped; function GetCoverageRequestToJSON(value) { return value; } -exports.GetCoverageRequestToJSON = GetCoverageRequestToJSON; +function GetCoverageRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/GetFeatureRequest.d.ts b/typescript/dist/models/GetFeatureRequest.d.ts index 3118dc0d..b3543aba 100644 --- a/typescript/dist/models/GetFeatureRequest.d.ts +++ b/typescript/dist/models/GetFeatureRequest.d.ts @@ -17,6 +17,8 @@ export declare const GetFeatureRequest: { readonly GetFeature: "GetFeature"; }; export type GetFeatureRequest = typeof GetFeatureRequest[keyof typeof GetFeatureRequest]; +export declare function instanceOfGetFeatureRequest(value: any): boolean; export declare function GetFeatureRequestFromJSON(json: any): GetFeatureRequest; export declare function GetFeatureRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetFeatureRequest; export declare function GetFeatureRequestToJSON(value?: GetFeatureRequest | null): any; +export declare function GetFeatureRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetFeatureRequest; diff --git a/typescript/dist/models/GetFeatureRequest.js b/typescript/dist/models/GetFeatureRequest.js index a44fafbd..e6188aa8 100644 --- a/typescript/dist/models/GetFeatureRequest.js +++ b/typescript/dist/models/GetFeatureRequest.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetFeatureRequestToJSON = exports.GetFeatureRequestFromJSONTyped = exports.GetFeatureRequestFromJSON = exports.GetFeatureRequest = void 0; +exports.GetFeatureRequest = void 0; +exports.instanceOfGetFeatureRequest = instanceOfGetFeatureRequest; +exports.GetFeatureRequestFromJSON = GetFeatureRequestFromJSON; +exports.GetFeatureRequestFromJSONTyped = GetFeatureRequestFromJSONTyped; +exports.GetFeatureRequestToJSON = GetFeatureRequestToJSON; +exports.GetFeatureRequestToJSONTyped = GetFeatureRequestToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.GetFeatureRequestToJSON = exports.GetFeatureRequestFromJSONTyped = expor exports.GetFeatureRequest = { GetFeature: 'GetFeature' }; +function instanceOfGetFeatureRequest(value) { + for (const key in exports.GetFeatureRequest) { + if (Object.prototype.hasOwnProperty.call(exports.GetFeatureRequest, key)) { + if (exports.GetFeatureRequest[key] === value) { + return true; + } + } + } + return false; +} function GetFeatureRequestFromJSON(json) { return GetFeatureRequestFromJSONTyped(json, false); } -exports.GetFeatureRequestFromJSON = GetFeatureRequestFromJSON; function GetFeatureRequestFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.GetFeatureRequestFromJSONTyped = GetFeatureRequestFromJSONTyped; function GetFeatureRequestToJSON(value) { return value; } -exports.GetFeatureRequestToJSON = GetFeatureRequestToJSON; +function GetFeatureRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/GetLegendGraphicRequest.d.ts b/typescript/dist/models/GetLegendGraphicRequest.d.ts index ee086d0f..90ff104d 100644 --- a/typescript/dist/models/GetLegendGraphicRequest.d.ts +++ b/typescript/dist/models/GetLegendGraphicRequest.d.ts @@ -17,6 +17,8 @@ export declare const GetLegendGraphicRequest: { readonly GetLegendGraphic: "GetLegendGraphic"; }; export type GetLegendGraphicRequest = typeof GetLegendGraphicRequest[keyof typeof GetLegendGraphicRequest]; +export declare function instanceOfGetLegendGraphicRequest(value: any): boolean; export declare function GetLegendGraphicRequestFromJSON(json: any): GetLegendGraphicRequest; export declare function GetLegendGraphicRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetLegendGraphicRequest; export declare function GetLegendGraphicRequestToJSON(value?: GetLegendGraphicRequest | null): any; +export declare function GetLegendGraphicRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetLegendGraphicRequest; diff --git a/typescript/dist/models/GetLegendGraphicRequest.js b/typescript/dist/models/GetLegendGraphicRequest.js index 1defdcc8..981981d3 100644 --- a/typescript/dist/models/GetLegendGraphicRequest.js +++ b/typescript/dist/models/GetLegendGraphicRequest.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetLegendGraphicRequestToJSON = exports.GetLegendGraphicRequestFromJSONTyped = exports.GetLegendGraphicRequestFromJSON = exports.GetLegendGraphicRequest = void 0; +exports.GetLegendGraphicRequest = void 0; +exports.instanceOfGetLegendGraphicRequest = instanceOfGetLegendGraphicRequest; +exports.GetLegendGraphicRequestFromJSON = GetLegendGraphicRequestFromJSON; +exports.GetLegendGraphicRequestFromJSONTyped = GetLegendGraphicRequestFromJSONTyped; +exports.GetLegendGraphicRequestToJSON = GetLegendGraphicRequestToJSON; +exports.GetLegendGraphicRequestToJSONTyped = GetLegendGraphicRequestToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.GetLegendGraphicRequestToJSON = exports.GetLegendGraphicRequestFromJSONT exports.GetLegendGraphicRequest = { GetLegendGraphic: 'GetLegendGraphic' }; +function instanceOfGetLegendGraphicRequest(value) { + for (const key in exports.GetLegendGraphicRequest) { + if (Object.prototype.hasOwnProperty.call(exports.GetLegendGraphicRequest, key)) { + if (exports.GetLegendGraphicRequest[key] === value) { + return true; + } + } + } + return false; +} function GetLegendGraphicRequestFromJSON(json) { return GetLegendGraphicRequestFromJSONTyped(json, false); } -exports.GetLegendGraphicRequestFromJSON = GetLegendGraphicRequestFromJSON; function GetLegendGraphicRequestFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.GetLegendGraphicRequestFromJSONTyped = GetLegendGraphicRequestFromJSONTyped; function GetLegendGraphicRequestToJSON(value) { return value; } -exports.GetLegendGraphicRequestToJSON = GetLegendGraphicRequestToJSON; +function GetLegendGraphicRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/GetMapExceptionFormat.d.ts b/typescript/dist/models/GetMapExceptionFormat.d.ts index bec87079..c792af4c 100644 --- a/typescript/dist/models/GetMapExceptionFormat.d.ts +++ b/typescript/dist/models/GetMapExceptionFormat.d.ts @@ -18,6 +18,8 @@ export declare const GetMapExceptionFormat: { readonly Json: "JSON"; }; export type GetMapExceptionFormat = typeof GetMapExceptionFormat[keyof typeof GetMapExceptionFormat]; +export declare function instanceOfGetMapExceptionFormat(value: any): boolean; export declare function GetMapExceptionFormatFromJSON(json: any): GetMapExceptionFormat; export declare function GetMapExceptionFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetMapExceptionFormat; export declare function GetMapExceptionFormatToJSON(value?: GetMapExceptionFormat | null): any; +export declare function GetMapExceptionFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetMapExceptionFormat; diff --git a/typescript/dist/models/GetMapExceptionFormat.js b/typescript/dist/models/GetMapExceptionFormat.js index ea1ca60d..aa1acf5f 100644 --- a/typescript/dist/models/GetMapExceptionFormat.js +++ b/typescript/dist/models/GetMapExceptionFormat.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetMapExceptionFormatToJSON = exports.GetMapExceptionFormatFromJSONTyped = exports.GetMapExceptionFormatFromJSON = exports.GetMapExceptionFormat = void 0; +exports.GetMapExceptionFormat = void 0; +exports.instanceOfGetMapExceptionFormat = instanceOfGetMapExceptionFormat; +exports.GetMapExceptionFormatFromJSON = GetMapExceptionFormatFromJSON; +exports.GetMapExceptionFormatFromJSONTyped = GetMapExceptionFormatFromJSONTyped; +exports.GetMapExceptionFormatToJSON = GetMapExceptionFormatToJSON; +exports.GetMapExceptionFormatToJSONTyped = GetMapExceptionFormatToJSONTyped; /** * * @export @@ -22,15 +27,25 @@ exports.GetMapExceptionFormat = { Xml: 'XML', Json: 'JSON' }; +function instanceOfGetMapExceptionFormat(value) { + for (const key in exports.GetMapExceptionFormat) { + if (Object.prototype.hasOwnProperty.call(exports.GetMapExceptionFormat, key)) { + if (exports.GetMapExceptionFormat[key] === value) { + return true; + } + } + } + return false; +} function GetMapExceptionFormatFromJSON(json) { return GetMapExceptionFormatFromJSONTyped(json, false); } -exports.GetMapExceptionFormatFromJSON = GetMapExceptionFormatFromJSON; function GetMapExceptionFormatFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.GetMapExceptionFormatFromJSONTyped = GetMapExceptionFormatFromJSONTyped; function GetMapExceptionFormatToJSON(value) { return value; } -exports.GetMapExceptionFormatToJSON = GetMapExceptionFormatToJSON; +function GetMapExceptionFormatToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/GetMapFormat.d.ts b/typescript/dist/models/GetMapFormat.d.ts index ccbff908..929d5f9a 100644 --- a/typescript/dist/models/GetMapFormat.d.ts +++ b/typescript/dist/models/GetMapFormat.d.ts @@ -17,6 +17,8 @@ export declare const GetMapFormat: { readonly ImagePng: "image/png"; }; export type GetMapFormat = typeof GetMapFormat[keyof typeof GetMapFormat]; +export declare function instanceOfGetMapFormat(value: any): boolean; export declare function GetMapFormatFromJSON(json: any): GetMapFormat; export declare function GetMapFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetMapFormat; export declare function GetMapFormatToJSON(value?: GetMapFormat | null): any; +export declare function GetMapFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetMapFormat; diff --git a/typescript/dist/models/GetMapFormat.js b/typescript/dist/models/GetMapFormat.js index 835ef329..456513c1 100644 --- a/typescript/dist/models/GetMapFormat.js +++ b/typescript/dist/models/GetMapFormat.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetMapFormatToJSON = exports.GetMapFormatFromJSONTyped = exports.GetMapFormatFromJSON = exports.GetMapFormat = void 0; +exports.GetMapFormat = void 0; +exports.instanceOfGetMapFormat = instanceOfGetMapFormat; +exports.GetMapFormatFromJSON = GetMapFormatFromJSON; +exports.GetMapFormatFromJSONTyped = GetMapFormatFromJSONTyped; +exports.GetMapFormatToJSON = GetMapFormatToJSON; +exports.GetMapFormatToJSONTyped = GetMapFormatToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.GetMapFormatToJSON = exports.GetMapFormatFromJSONTyped = exports.GetMapF exports.GetMapFormat = { ImagePng: 'image/png' }; +function instanceOfGetMapFormat(value) { + for (const key in exports.GetMapFormat) { + if (Object.prototype.hasOwnProperty.call(exports.GetMapFormat, key)) { + if (exports.GetMapFormat[key] === value) { + return true; + } + } + } + return false; +} function GetMapFormatFromJSON(json) { return GetMapFormatFromJSONTyped(json, false); } -exports.GetMapFormatFromJSON = GetMapFormatFromJSON; function GetMapFormatFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.GetMapFormatFromJSONTyped = GetMapFormatFromJSONTyped; function GetMapFormatToJSON(value) { return value; } -exports.GetMapFormatToJSON = GetMapFormatToJSON; +function GetMapFormatToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/GetMapRequest.d.ts b/typescript/dist/models/GetMapRequest.d.ts index afd0bf0b..f35fc7ab 100644 --- a/typescript/dist/models/GetMapRequest.d.ts +++ b/typescript/dist/models/GetMapRequest.d.ts @@ -17,6 +17,8 @@ export declare const GetMapRequest: { readonly GetMap: "GetMap"; }; export type GetMapRequest = typeof GetMapRequest[keyof typeof GetMapRequest]; +export declare function instanceOfGetMapRequest(value: any): boolean; export declare function GetMapRequestFromJSON(json: any): GetMapRequest; export declare function GetMapRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetMapRequest; export declare function GetMapRequestToJSON(value?: GetMapRequest | null): any; +export declare function GetMapRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetMapRequest; diff --git a/typescript/dist/models/GetMapRequest.js b/typescript/dist/models/GetMapRequest.js index e3710476..958f953e 100644 --- a/typescript/dist/models/GetMapRequest.js +++ b/typescript/dist/models/GetMapRequest.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetMapRequestToJSON = exports.GetMapRequestFromJSONTyped = exports.GetMapRequestFromJSON = exports.GetMapRequest = void 0; +exports.GetMapRequest = void 0; +exports.instanceOfGetMapRequest = instanceOfGetMapRequest; +exports.GetMapRequestFromJSON = GetMapRequestFromJSON; +exports.GetMapRequestFromJSONTyped = GetMapRequestFromJSONTyped; +exports.GetMapRequestToJSON = GetMapRequestToJSON; +exports.GetMapRequestToJSONTyped = GetMapRequestToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.GetMapRequestToJSON = exports.GetMapRequestFromJSONTyped = exports.GetMa exports.GetMapRequest = { GetMap: 'GetMap' }; +function instanceOfGetMapRequest(value) { + for (const key in exports.GetMapRequest) { + if (Object.prototype.hasOwnProperty.call(exports.GetMapRequest, key)) { + if (exports.GetMapRequest[key] === value) { + return true; + } + } + } + return false; +} function GetMapRequestFromJSON(json) { return GetMapRequestFromJSONTyped(json, false); } -exports.GetMapRequestFromJSON = GetMapRequestFromJSON; function GetMapRequestFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.GetMapRequestFromJSONTyped = GetMapRequestFromJSONTyped; function GetMapRequestToJSON(value) { return value; } -exports.GetMapRequestToJSON = GetMapRequestToJSON; +function GetMapRequestToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/InlineObject.d.ts b/typescript/dist/models/InlineObject.d.ts new file mode 100644 index 00000000..ac0931b0 --- /dev/null +++ b/typescript/dist/models/InlineObject.d.ts @@ -0,0 +1,32 @@ +/** + * Geo Engine API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: dev@geoengine.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/** + * + * @export + * @interface InlineObject + */ +export interface InlineObject { + /** + * + * @type {string} + * @memberof InlineObject + */ + url: string; +} +/** + * Check if a given object implements the InlineObject interface. + */ +export declare function instanceOfInlineObject(value: object): value is InlineObject; +export declare function InlineObjectFromJSON(json: any): InlineObject; +export declare function InlineObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): InlineObject; +export declare function InlineObjectToJSON(json: any): InlineObject; +export declare function InlineObjectToJSONTyped(value?: InlineObject | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/InlineObject.js b/typescript/dist/models/InlineObject.js new file mode 100644 index 00000000..79f6d374 --- /dev/null +++ b/typescript/dist/models/InlineObject.js @@ -0,0 +1,50 @@ +"use strict"; +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: dev@geoengine.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.instanceOfInlineObject = instanceOfInlineObject; +exports.InlineObjectFromJSON = InlineObjectFromJSON; +exports.InlineObjectFromJSONTyped = InlineObjectFromJSONTyped; +exports.InlineObjectToJSON = InlineObjectToJSON; +exports.InlineObjectToJSONTyped = InlineObjectToJSONTyped; +/** + * Check if a given object implements the InlineObject interface. + */ +function instanceOfInlineObject(value) { + if (!('url' in value) || value['url'] === undefined) + return false; + return true; +} +function InlineObjectFromJSON(json) { + return InlineObjectFromJSONTyped(json, false); +} +function InlineObjectFromJSONTyped(json, ignoreDiscriminator) { + if (json == null) { + return json; + } + return { + 'url': json['url'], + }; +} +function InlineObjectToJSON(json) { + return InlineObjectToJSONTyped(json, false); +} +function InlineObjectToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; + } + return { + 'url': value['url'], + }; +} diff --git a/typescript/dist/models/InternalDataId.d.ts b/typescript/dist/models/InternalDataId.d.ts index d2f3c909..fb4a3a83 100644 --- a/typescript/dist/models/InternalDataId.d.ts +++ b/typescript/dist/models/InternalDataId.d.ts @@ -33,13 +33,13 @@ export interface InternalDataId { */ export declare const InternalDataIdTypeEnum: { readonly Internal: "internal"; - readonly External: "external"; }; export type InternalDataIdTypeEnum = typeof InternalDataIdTypeEnum[keyof typeof InternalDataIdTypeEnum]; /** * Check if a given object implements the InternalDataId interface. */ -export declare function instanceOfInternalDataId(value: object): boolean; +export declare function instanceOfInternalDataId(value: object): value is InternalDataId; export declare function InternalDataIdFromJSON(json: any): InternalDataId; export declare function InternalDataIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): InternalDataId; -export declare function InternalDataIdToJSON(value?: InternalDataId | null): any; +export declare function InternalDataIdToJSON(json: any): InternalDataId; +export declare function InternalDataIdToJSONTyped(value?: InternalDataId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/InternalDataId.js b/typescript/dist/models/InternalDataId.js index 12ba0c20..f8d5250b 100644 --- a/typescript/dist/models/InternalDataId.js +++ b/typescript/dist/models/InternalDataId.js @@ -13,30 +13,33 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.InternalDataIdToJSON = exports.InternalDataIdFromJSONTyped = exports.InternalDataIdFromJSON = exports.instanceOfInternalDataId = exports.InternalDataIdTypeEnum = void 0; +exports.InternalDataIdTypeEnum = void 0; +exports.instanceOfInternalDataId = instanceOfInternalDataId; +exports.InternalDataIdFromJSON = InternalDataIdFromJSON; +exports.InternalDataIdFromJSONTyped = InternalDataIdFromJSONTyped; +exports.InternalDataIdToJSON = InternalDataIdToJSON; +exports.InternalDataIdToJSONTyped = InternalDataIdToJSONTyped; /** * @export */ exports.InternalDataIdTypeEnum = { - Internal: 'internal', - External: 'external' + Internal: 'internal' }; /** * Check if a given object implements the InternalDataId interface. */ function instanceOfInternalDataId(value) { - let isInstance = true; - isInstance = isInstance && "datasetId" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('datasetId' in value) || value['datasetId'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfInternalDataId = instanceOfInternalDataId; function InternalDataIdFromJSON(json) { return InternalDataIdFromJSONTyped(json, false); } -exports.InternalDataIdFromJSON = InternalDataIdFromJSON; function InternalDataIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -44,17 +47,15 @@ function InternalDataIdFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.InternalDataIdFromJSONTyped = InternalDataIdFromJSONTyped; -function InternalDataIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function InternalDataIdToJSON(json) { + return InternalDataIdToJSONTyped(json, false); +} +function InternalDataIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'datasetId': value.datasetId, - 'type': value.type, + 'datasetId': value['datasetId'], + 'type': value['type'], }; } -exports.InternalDataIdToJSON = InternalDataIdToJSON; diff --git a/typescript/dist/models/Layer.d.ts b/typescript/dist/models/Layer.d.ts index b7002503..907e6232 100644 --- a/typescript/dist/models/Layer.d.ts +++ b/typescript/dist/models/Layer.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { ProviderLayerId } from './ProviderLayerId'; import type { Symbology } from './Symbology'; +import type { ProviderLayerId } from './ProviderLayerId'; import type { Workflow } from './Workflow'; /** * @@ -66,7 +66,8 @@ export interface Layer { /** * Check if a given object implements the Layer interface. */ -export declare function instanceOfLayer(value: object): boolean; +export declare function instanceOfLayer(value: object): value is Layer; export declare function LayerFromJSON(json: any): Layer; export declare function LayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): Layer; -export declare function LayerToJSON(value?: Layer | null): any; +export declare function LayerToJSON(json: any): Layer; +export declare function LayerToJSONTyped(value?: Layer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Layer.js b/typescript/dist/models/Layer.js index 9103ee9a..eb10145e 100644 --- a/typescript/dist/models/Layer.js +++ b/typescript/dist/models/Layer.js @@ -13,57 +13,59 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.LayerToJSON = exports.LayerFromJSONTyped = exports.LayerFromJSON = exports.instanceOfLayer = void 0; -const runtime_1 = require("../runtime"); -const ProviderLayerId_1 = require("./ProviderLayerId"); +exports.instanceOfLayer = instanceOfLayer; +exports.LayerFromJSON = LayerFromJSON; +exports.LayerFromJSONTyped = LayerFromJSONTyped; +exports.LayerToJSON = LayerToJSON; +exports.LayerToJSONTyped = LayerToJSONTyped; const Symbology_1 = require("./Symbology"); +const ProviderLayerId_1 = require("./ProviderLayerId"); const Workflow_1 = require("./Workflow"); /** * Check if a given object implements the Layer interface. */ function instanceOfLayer(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('workflow' in value) || value['workflow'] === undefined) + return false; + return true; } -exports.instanceOfLayer = instanceOfLayer; function LayerFromJSON(json) { return LayerFromJSONTyped(json, false); } -exports.LayerFromJSON = LayerFromJSON; function LayerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'id': (0, ProviderLayerId_1.ProviderLayerIdFromJSON)(json['id']), - 'metadata': !(0, runtime_1.exists)(json, 'metadata') ? undefined : json['metadata'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], 'name': json['name'], - 'properties': !(0, runtime_1.exists)(json, 'properties') ? undefined : json['properties'], - 'symbology': !(0, runtime_1.exists)(json, 'symbology') ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), + 'properties': json['properties'] == null ? undefined : json['properties'], + 'symbology': json['symbology'] == null ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), 'workflow': (0, Workflow_1.WorkflowFromJSON)(json['workflow']), }; } -exports.LayerFromJSONTyped = LayerFromJSONTyped; -function LayerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function LayerToJSON(json) { + return LayerToJSONTyped(json, false); +} +function LayerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'id': (0, ProviderLayerId_1.ProviderLayerIdToJSON)(value.id), - 'metadata': value.metadata, - 'name': value.name, - 'properties': value.properties, - 'symbology': (0, Symbology_1.SymbologyToJSON)(value.symbology), - 'workflow': (0, Workflow_1.WorkflowToJSON)(value.workflow), + 'description': value['description'], + 'id': (0, ProviderLayerId_1.ProviderLayerIdToJSON)(value['id']), + 'metadata': value['metadata'], + 'name': value['name'], + 'properties': value['properties'], + 'symbology': (0, Symbology_1.SymbologyToJSON)(value['symbology']), + 'workflow': (0, Workflow_1.WorkflowToJSON)(value['workflow']), }; } -exports.LayerToJSON = LayerToJSON; diff --git a/typescript/dist/models/LayerCollection.d.ts b/typescript/dist/models/LayerCollection.d.ts index b9c0e178..194aebf0 100644 --- a/typescript/dist/models/LayerCollection.d.ts +++ b/typescript/dist/models/LayerCollection.d.ts @@ -57,7 +57,8 @@ export interface LayerCollection { /** * Check if a given object implements the LayerCollection interface. */ -export declare function instanceOfLayerCollection(value: object): boolean; +export declare function instanceOfLayerCollection(value: object): value is LayerCollection; export declare function LayerCollectionFromJSON(json: any): LayerCollection; export declare function LayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerCollection; -export declare function LayerCollectionToJSON(value?: LayerCollection | null): any; +export declare function LayerCollectionToJSON(json: any): LayerCollection; +export declare function LayerCollectionToJSONTyped(value?: LayerCollection | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/LayerCollection.js b/typescript/dist/models/LayerCollection.js index 40d471c2..4cfa10b2 100644 --- a/typescript/dist/models/LayerCollection.js +++ b/typescript/dist/models/LayerCollection.js @@ -13,55 +13,58 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.LayerCollectionToJSON = exports.LayerCollectionFromJSONTyped = exports.LayerCollectionFromJSON = exports.instanceOfLayerCollection = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfLayerCollection = instanceOfLayerCollection; +exports.LayerCollectionFromJSON = LayerCollectionFromJSON; +exports.LayerCollectionFromJSONTyped = LayerCollectionFromJSONTyped; +exports.LayerCollectionToJSON = LayerCollectionToJSON; +exports.LayerCollectionToJSONTyped = LayerCollectionToJSONTyped; const CollectionItem_1 = require("./CollectionItem"); const ProviderLayerCollectionId_1 = require("./ProviderLayerCollectionId"); /** * Check if a given object implements the LayerCollection interface. */ function instanceOfLayerCollection(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "items" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "properties" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('items' in value) || value['items'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('properties' in value) || value['properties'] === undefined) + return false; + return true; } -exports.instanceOfLayerCollection = instanceOfLayerCollection; function LayerCollectionFromJSON(json) { return LayerCollectionFromJSONTyped(json, false); } -exports.LayerCollectionFromJSON = LayerCollectionFromJSON; function LayerCollectionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], - 'entryLabel': !(0, runtime_1.exists)(json, 'entryLabel') ? undefined : json['entryLabel'], + 'entryLabel': json['entryLabel'] == null ? undefined : json['entryLabel'], 'id': (0, ProviderLayerCollectionId_1.ProviderLayerCollectionIdFromJSON)(json['id']), 'items': (json['items'].map(CollectionItem_1.CollectionItemFromJSON)), 'name': json['name'], 'properties': json['properties'], }; } -exports.LayerCollectionFromJSONTyped = LayerCollectionFromJSONTyped; -function LayerCollectionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function LayerCollectionToJSON(json) { + return LayerCollectionToJSONTyped(json, false); +} +function LayerCollectionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'entryLabel': value.entryLabel, - 'id': (0, ProviderLayerCollectionId_1.ProviderLayerCollectionIdToJSON)(value.id), - 'items': (value.items.map(CollectionItem_1.CollectionItemToJSON)), - 'name': value.name, - 'properties': value.properties, + 'description': value['description'], + 'entryLabel': value['entryLabel'], + 'id': (0, ProviderLayerCollectionId_1.ProviderLayerCollectionIdToJSON)(value['id']), + 'items': (value['items'].map(CollectionItem_1.CollectionItemToJSON)), + 'name': value['name'], + 'properties': value['properties'], }; } -exports.LayerCollectionToJSON = LayerCollectionToJSON; diff --git a/typescript/dist/models/LayerCollectionListing.d.ts b/typescript/dist/models/LayerCollectionListing.d.ts index e3a05c0e..a83e8c0d 100644 --- a/typescript/dist/models/LayerCollectionListing.d.ts +++ b/typescript/dist/models/LayerCollectionListing.d.ts @@ -52,13 +52,13 @@ export interface LayerCollectionListing { */ export declare const LayerCollectionListingTypeEnum: { readonly Collection: "collection"; - readonly Layer: "layer"; }; export type LayerCollectionListingTypeEnum = typeof LayerCollectionListingTypeEnum[keyof typeof LayerCollectionListingTypeEnum]; /** * Check if a given object implements the LayerCollectionListing interface. */ -export declare function instanceOfLayerCollectionListing(value: object): boolean; +export declare function instanceOfLayerCollectionListing(value: object): value is LayerCollectionListing; export declare function LayerCollectionListingFromJSON(json: any): LayerCollectionListing; export declare function LayerCollectionListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerCollectionListing; -export declare function LayerCollectionListingToJSON(value?: LayerCollectionListing | null): any; +export declare function LayerCollectionListingToJSON(json: any): LayerCollectionListing; +export declare function LayerCollectionListingToJSONTyped(value?: LayerCollectionListing | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/LayerCollectionListing.js b/typescript/dist/models/LayerCollectionListing.js index af970fdc..7da3909d 100644 --- a/typescript/dist/models/LayerCollectionListing.js +++ b/typescript/dist/models/LayerCollectionListing.js @@ -13,58 +13,60 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.LayerCollectionListingToJSON = exports.LayerCollectionListingFromJSONTyped = exports.LayerCollectionListingFromJSON = exports.instanceOfLayerCollectionListing = exports.LayerCollectionListingTypeEnum = void 0; -const runtime_1 = require("../runtime"); +exports.LayerCollectionListingTypeEnum = void 0; +exports.instanceOfLayerCollectionListing = instanceOfLayerCollectionListing; +exports.LayerCollectionListingFromJSON = LayerCollectionListingFromJSON; +exports.LayerCollectionListingFromJSONTyped = LayerCollectionListingFromJSONTyped; +exports.LayerCollectionListingToJSON = LayerCollectionListingToJSON; +exports.LayerCollectionListingToJSONTyped = LayerCollectionListingToJSONTyped; const ProviderLayerCollectionId_1 = require("./ProviderLayerCollectionId"); /** * @export */ exports.LayerCollectionListingTypeEnum = { - Collection: 'collection', - Layer: 'layer' + Collection: 'collection' }; /** * Check if a given object implements the LayerCollectionListing interface. */ function instanceOfLayerCollectionListing(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfLayerCollectionListing = instanceOfLayerCollectionListing; function LayerCollectionListingFromJSON(json) { return LayerCollectionListingFromJSONTyped(json, false); } -exports.LayerCollectionListingFromJSON = LayerCollectionListingFromJSON; function LayerCollectionListingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'id': (0, ProviderLayerCollectionId_1.ProviderLayerCollectionIdFromJSON)(json['id']), 'name': json['name'], - 'properties': !(0, runtime_1.exists)(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], 'type': json['type'], }; } -exports.LayerCollectionListingFromJSONTyped = LayerCollectionListingFromJSONTyped; -function LayerCollectionListingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function LayerCollectionListingToJSON(json) { + return LayerCollectionListingToJSONTyped(json, false); +} +function LayerCollectionListingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'id': (0, ProviderLayerCollectionId_1.ProviderLayerCollectionIdToJSON)(value.id), - 'name': value.name, - 'properties': value.properties, - 'type': value.type, + 'description': value['description'], + 'id': (0, ProviderLayerCollectionId_1.ProviderLayerCollectionIdToJSON)(value['id']), + 'name': value['name'], + 'properties': value['properties'], + 'type': value['type'], }; } -exports.LayerCollectionListingToJSON = LayerCollectionListingToJSON; diff --git a/typescript/dist/models/LayerCollectionResource.d.ts b/typescript/dist/models/LayerCollectionResource.d.ts index 6daab6d0..ec129b62 100644 --- a/typescript/dist/models/LayerCollectionResource.d.ts +++ b/typescript/dist/models/LayerCollectionResource.d.ts @@ -38,7 +38,8 @@ export type LayerCollectionResourceTypeEnum = typeof LayerCollectionResourceType /** * Check if a given object implements the LayerCollectionResource interface. */ -export declare function instanceOfLayerCollectionResource(value: object): boolean; +export declare function instanceOfLayerCollectionResource(value: object): value is LayerCollectionResource; export declare function LayerCollectionResourceFromJSON(json: any): LayerCollectionResource; export declare function LayerCollectionResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerCollectionResource; -export declare function LayerCollectionResourceToJSON(value?: LayerCollectionResource | null): any; +export declare function LayerCollectionResourceToJSON(json: any): LayerCollectionResource; +export declare function LayerCollectionResourceToJSONTyped(value?: LayerCollectionResource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/LayerCollectionResource.js b/typescript/dist/models/LayerCollectionResource.js index 84d0d1dc..68373c5d 100644 --- a/typescript/dist/models/LayerCollectionResource.js +++ b/typescript/dist/models/LayerCollectionResource.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.LayerCollectionResourceToJSON = exports.LayerCollectionResourceFromJSONTyped = exports.LayerCollectionResourceFromJSON = exports.instanceOfLayerCollectionResource = exports.LayerCollectionResourceTypeEnum = void 0; +exports.LayerCollectionResourceTypeEnum = void 0; +exports.instanceOfLayerCollectionResource = instanceOfLayerCollectionResource; +exports.LayerCollectionResourceFromJSON = LayerCollectionResourceFromJSON; +exports.LayerCollectionResourceFromJSONTyped = LayerCollectionResourceFromJSONTyped; +exports.LayerCollectionResourceToJSON = LayerCollectionResourceToJSON; +exports.LayerCollectionResourceToJSONTyped = LayerCollectionResourceToJSONTyped; /** * @export */ @@ -24,18 +29,17 @@ exports.LayerCollectionResourceTypeEnum = { * Check if a given object implements the LayerCollectionResource interface. */ function instanceOfLayerCollectionResource(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfLayerCollectionResource = instanceOfLayerCollectionResource; function LayerCollectionResourceFromJSON(json) { return LayerCollectionResourceFromJSONTyped(json, false); } -exports.LayerCollectionResourceFromJSON = LayerCollectionResourceFromJSON; function LayerCollectionResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +47,15 @@ function LayerCollectionResourceFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.LayerCollectionResourceFromJSONTyped = LayerCollectionResourceFromJSONTyped; -function LayerCollectionResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function LayerCollectionResourceToJSON(json) { + return LayerCollectionResourceToJSONTyped(json, false); +} +function LayerCollectionResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } -exports.LayerCollectionResourceToJSON = LayerCollectionResourceToJSON; diff --git a/typescript/dist/models/LayerListing.d.ts b/typescript/dist/models/LayerListing.d.ts index c8a481ba..b2526193 100644 --- a/typescript/dist/models/LayerListing.d.ts +++ b/typescript/dist/models/LayerListing.d.ts @@ -57,7 +57,8 @@ export type LayerListingTypeEnum = typeof LayerListingTypeEnum[keyof typeof Laye /** * Check if a given object implements the LayerListing interface. */ -export declare function instanceOfLayerListing(value: object): boolean; +export declare function instanceOfLayerListing(value: object): value is LayerListing; export declare function LayerListingFromJSON(json: any): LayerListing; export declare function LayerListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerListing; -export declare function LayerListingToJSON(value?: LayerListing | null): any; +export declare function LayerListingToJSON(json: any): LayerListing; +export declare function LayerListingToJSONTyped(value?: LayerListing | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/LayerListing.js b/typescript/dist/models/LayerListing.js index defdef1a..2b04c394 100644 --- a/typescript/dist/models/LayerListing.js +++ b/typescript/dist/models/LayerListing.js @@ -13,8 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.LayerListingToJSON = exports.LayerListingFromJSONTyped = exports.LayerListingFromJSON = exports.instanceOfLayerListing = exports.LayerListingTypeEnum = void 0; -const runtime_1 = require("../runtime"); +exports.LayerListingTypeEnum = void 0; +exports.instanceOfLayerListing = instanceOfLayerListing; +exports.LayerListingFromJSON = LayerListingFromJSON; +exports.LayerListingFromJSONTyped = LayerListingFromJSONTyped; +exports.LayerListingToJSON = LayerListingToJSON; +exports.LayerListingToJSONTyped = LayerListingToJSONTyped; const ProviderLayerId_1 = require("./ProviderLayerId"); /** * @export @@ -26,44 +30,43 @@ exports.LayerListingTypeEnum = { * Check if a given object implements the LayerListing interface. */ function instanceOfLayerListing(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfLayerListing = instanceOfLayerListing; function LayerListingFromJSON(json) { return LayerListingFromJSONTyped(json, false); } -exports.LayerListingFromJSON = LayerListingFromJSON; function LayerListingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'id': (0, ProviderLayerId_1.ProviderLayerIdFromJSON)(json['id']), 'name': json['name'], - 'properties': !(0, runtime_1.exists)(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], 'type': json['type'], }; } -exports.LayerListingFromJSONTyped = LayerListingFromJSONTyped; -function LayerListingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function LayerListingToJSON(json) { + return LayerListingToJSONTyped(json, false); +} +function LayerListingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'id': (0, ProviderLayerId_1.ProviderLayerIdToJSON)(value.id), - 'name': value.name, - 'properties': value.properties, - 'type': value.type, + 'description': value['description'], + 'id': (0, ProviderLayerId_1.ProviderLayerIdToJSON)(value['id']), + 'name': value['name'], + 'properties': value['properties'], + 'type': value['type'], }; } -exports.LayerListingToJSON = LayerListingToJSON; diff --git a/typescript/dist/models/LayerResource.d.ts b/typescript/dist/models/LayerResource.d.ts index 70455cdd..679ab67d 100644 --- a/typescript/dist/models/LayerResource.d.ts +++ b/typescript/dist/models/LayerResource.d.ts @@ -38,7 +38,8 @@ export type LayerResourceTypeEnum = typeof LayerResourceTypeEnum[keyof typeof La /** * Check if a given object implements the LayerResource interface. */ -export declare function instanceOfLayerResource(value: object): boolean; +export declare function instanceOfLayerResource(value: object): value is LayerResource; export declare function LayerResourceFromJSON(json: any): LayerResource; export declare function LayerResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerResource; -export declare function LayerResourceToJSON(value?: LayerResource | null): any; +export declare function LayerResourceToJSON(json: any): LayerResource; +export declare function LayerResourceToJSONTyped(value?: LayerResource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/LayerResource.js b/typescript/dist/models/LayerResource.js index d2bf4776..1aa40491 100644 --- a/typescript/dist/models/LayerResource.js +++ b/typescript/dist/models/LayerResource.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.LayerResourceToJSON = exports.LayerResourceFromJSONTyped = exports.LayerResourceFromJSON = exports.instanceOfLayerResource = exports.LayerResourceTypeEnum = void 0; +exports.LayerResourceTypeEnum = void 0; +exports.instanceOfLayerResource = instanceOfLayerResource; +exports.LayerResourceFromJSON = LayerResourceFromJSON; +exports.LayerResourceFromJSONTyped = LayerResourceFromJSONTyped; +exports.LayerResourceToJSON = LayerResourceToJSON; +exports.LayerResourceToJSONTyped = LayerResourceToJSONTyped; /** * @export */ @@ -24,18 +29,17 @@ exports.LayerResourceTypeEnum = { * Check if a given object implements the LayerResource interface. */ function instanceOfLayerResource(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfLayerResource = instanceOfLayerResource; function LayerResourceFromJSON(json) { return LayerResourceFromJSONTyped(json, false); } -exports.LayerResourceFromJSON = LayerResourceFromJSON; function LayerResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +47,15 @@ function LayerResourceFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.LayerResourceFromJSONTyped = LayerResourceFromJSONTyped; -function LayerResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function LayerResourceToJSON(json) { + return LayerResourceToJSONTyped(json, false); +} +function LayerResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } -exports.LayerResourceToJSON = LayerResourceToJSON; diff --git a/typescript/dist/models/LayerUpdate.d.ts b/typescript/dist/models/LayerUpdate.d.ts index ac3cfe51..fc0d7a88 100644 --- a/typescript/dist/models/LayerUpdate.d.ts +++ b/typescript/dist/models/LayerUpdate.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ProjectLayer } from './ProjectLayer'; -import { ProjectUpdateToken } from './ProjectUpdateToken'; +import type { ProjectLayer } from './ProjectLayer'; +import type { ProjectUpdateToken } from './ProjectUpdateToken'; /** * @type LayerUpdate * @@ -19,4 +19,5 @@ import { ProjectUpdateToken } from './ProjectUpdateToken'; export type LayerUpdate = ProjectLayer | ProjectUpdateToken; export declare function LayerUpdateFromJSON(json: any): LayerUpdate; export declare function LayerUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerUpdate; -export declare function LayerUpdateToJSON(value?: LayerUpdate | null): any; +export declare function LayerUpdateToJSON(json: any): any; +export declare function LayerUpdateToJSONTyped(value?: LayerUpdate | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/LayerUpdate.js b/typescript/dist/models/LayerUpdate.js index 929c1ccd..12f92738 100644 --- a/typescript/dist/models/LayerUpdate.js +++ b/typescript/dist/models/LayerUpdate.js @@ -13,34 +13,33 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.LayerUpdateToJSON = exports.LayerUpdateFromJSONTyped = exports.LayerUpdateFromJSON = void 0; +exports.LayerUpdateFromJSON = LayerUpdateFromJSON; +exports.LayerUpdateFromJSONTyped = LayerUpdateFromJSONTyped; +exports.LayerUpdateToJSON = LayerUpdateToJSON; +exports.LayerUpdateToJSONTyped = LayerUpdateToJSONTyped; const ProjectLayer_1 = require("./ProjectLayer"); const ProjectUpdateToken_1 = require("./ProjectUpdateToken"); function LayerUpdateFromJSON(json) { return LayerUpdateFromJSONTyped(json, false); } -exports.LayerUpdateFromJSON = LayerUpdateFromJSON; function LayerUpdateFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - if (json === ProjectUpdateToken_1.ProjectUpdateToken.None) { - return ProjectUpdateToken_1.ProjectUpdateToken.None; - } - else if (json === ProjectUpdateToken_1.ProjectUpdateToken.Delete) { - return ProjectUpdateToken_1.ProjectUpdateToken.Delete; + if ((0, ProjectLayer_1.instanceOfProjectLayer)(json)) { + return (0, ProjectLayer_1.ProjectLayerFromJSONTyped)(json, true); } - else { - return Object.assign({}, (0, ProjectLayer_1.ProjectLayerFromJSONTyped)(json, true)); + if ((0, ProjectUpdateToken_1.instanceOfProjectUpdateToken)(json)) { + return (0, ProjectUpdateToken_1.ProjectUpdateTokenFromJSONTyped)(json, true); } + return {}; } -exports.LayerUpdateFromJSONTyped = LayerUpdateFromJSONTyped; -function LayerUpdateToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function LayerUpdateToJSON(json) { + return LayerUpdateToJSONTyped(json, false); +} +function LayerUpdateToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } if (typeof value === 'object' && (0, ProjectLayer_1.instanceOfProjectLayer)(value)) { return (0, ProjectLayer_1.ProjectLayerToJSON)(value); @@ -50,4 +49,3 @@ function LayerUpdateToJSON(value) { } return {}; } -exports.LayerUpdateToJSON = LayerUpdateToJSON; diff --git a/typescript/dist/models/LayerVisibility.d.ts b/typescript/dist/models/LayerVisibility.d.ts index 65dc0aa0..cadd44db 100644 --- a/typescript/dist/models/LayerVisibility.d.ts +++ b/typescript/dist/models/LayerVisibility.d.ts @@ -31,7 +31,8 @@ export interface LayerVisibility { /** * Check if a given object implements the LayerVisibility interface. */ -export declare function instanceOfLayerVisibility(value: object): boolean; +export declare function instanceOfLayerVisibility(value: object): value is LayerVisibility; export declare function LayerVisibilityFromJSON(json: any): LayerVisibility; export declare function LayerVisibilityFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerVisibility; -export declare function LayerVisibilityToJSON(value?: LayerVisibility | null): any; +export declare function LayerVisibilityToJSON(json: any): LayerVisibility; +export declare function LayerVisibilityToJSONTyped(value?: LayerVisibility | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/LayerVisibility.js b/typescript/dist/models/LayerVisibility.js index 1dd5f0ee..104320bb 100644 --- a/typescript/dist/models/LayerVisibility.js +++ b/typescript/dist/models/LayerVisibility.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.LayerVisibilityToJSON = exports.LayerVisibilityFromJSONTyped = exports.LayerVisibilityFromJSON = exports.instanceOfLayerVisibility = void 0; +exports.instanceOfLayerVisibility = instanceOfLayerVisibility; +exports.LayerVisibilityFromJSON = LayerVisibilityFromJSON; +exports.LayerVisibilityFromJSONTyped = LayerVisibilityFromJSONTyped; +exports.LayerVisibilityToJSON = LayerVisibilityToJSON; +exports.LayerVisibilityToJSONTyped = LayerVisibilityToJSONTyped; /** * Check if a given object implements the LayerVisibility interface. */ function instanceOfLayerVisibility(value) { - let isInstance = true; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "legend" in value; - return isInstance; + if (!('data' in value) || value['data'] === undefined) + return false; + if (!('legend' in value) || value['legend'] === undefined) + return false; + return true; } -exports.instanceOfLayerVisibility = instanceOfLayerVisibility; function LayerVisibilityFromJSON(json) { return LayerVisibilityFromJSONTyped(json, false); } -exports.LayerVisibilityFromJSON = LayerVisibilityFromJSON; function LayerVisibilityFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function LayerVisibilityFromJSONTyped(json, ignoreDiscriminator) { 'legend': json['legend'], }; } -exports.LayerVisibilityFromJSONTyped = LayerVisibilityFromJSONTyped; -function LayerVisibilityToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function LayerVisibilityToJSON(json) { + return LayerVisibilityToJSONTyped(json, false); +} +function LayerVisibilityToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'data': value.data, - 'legend': value.legend, + 'data': value['data'], + 'legend': value['legend'], }; } -exports.LayerVisibilityToJSON = LayerVisibilityToJSON; diff --git a/typescript/dist/models/LineSymbology.d.ts b/typescript/dist/models/LineSymbology.d.ts index 7a657fbe..02ba3590 100644 --- a/typescript/dist/models/LineSymbology.d.ts +++ b/typescript/dist/models/LineSymbology.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { StrokeParam } from './StrokeParam'; import type { TextSymbology } from './TextSymbology'; +import type { StrokeParam } from './StrokeParam'; /** * * @export @@ -52,7 +52,8 @@ export type LineSymbologyTypeEnum = typeof LineSymbologyTypeEnum[keyof typeof Li /** * Check if a given object implements the LineSymbology interface. */ -export declare function instanceOfLineSymbology(value: object): boolean; +export declare function instanceOfLineSymbology(value: object): value is LineSymbology; export declare function LineSymbologyFromJSON(json: any): LineSymbology; export declare function LineSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): LineSymbology; -export declare function LineSymbologyToJSON(value?: LineSymbology | null): any; +export declare function LineSymbologyToJSON(json: any): LineSymbology; +export declare function LineSymbologyToJSONTyped(value?: LineSymbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/LineSymbology.js b/typescript/dist/models/LineSymbology.js index f11a4b26..a10622fe 100644 --- a/typescript/dist/models/LineSymbology.js +++ b/typescript/dist/models/LineSymbology.js @@ -13,10 +13,14 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.LineSymbologyToJSON = exports.LineSymbologyFromJSONTyped = exports.LineSymbologyFromJSON = exports.instanceOfLineSymbology = exports.LineSymbologyTypeEnum = void 0; -const runtime_1 = require("../runtime"); -const StrokeParam_1 = require("./StrokeParam"); +exports.LineSymbologyTypeEnum = void 0; +exports.instanceOfLineSymbology = instanceOfLineSymbology; +exports.LineSymbologyFromJSON = LineSymbologyFromJSON; +exports.LineSymbologyFromJSONTyped = LineSymbologyFromJSONTyped; +exports.LineSymbologyToJSON = LineSymbologyToJSON; +exports.LineSymbologyToJSONTyped = LineSymbologyToJSONTyped; const TextSymbology_1 = require("./TextSymbology"); +const StrokeParam_1 = require("./StrokeParam"); /** * @export */ @@ -27,41 +31,39 @@ exports.LineSymbologyTypeEnum = { * Check if a given object implements the LineSymbology interface. */ function instanceOfLineSymbology(value) { - let isInstance = true; - isInstance = isInstance && "autoSimplified" in value; - isInstance = isInstance && "stroke" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('autoSimplified' in value) || value['autoSimplified'] === undefined) + return false; + if (!('stroke' in value) || value['stroke'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfLineSymbology = instanceOfLineSymbology; function LineSymbologyFromJSON(json) { return LineSymbologyFromJSONTyped(json, false); } -exports.LineSymbologyFromJSON = LineSymbologyFromJSON; function LineSymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'autoSimplified': json['autoSimplified'], 'stroke': (0, StrokeParam_1.StrokeParamFromJSON)(json['stroke']), - 'text': !(0, runtime_1.exists)(json, 'text') ? undefined : (0, TextSymbology_1.TextSymbologyFromJSON)(json['text']), + 'text': json['text'] == null ? undefined : (0, TextSymbology_1.TextSymbologyFromJSON)(json['text']), 'type': json['type'], }; } -exports.LineSymbologyFromJSONTyped = LineSymbologyFromJSONTyped; -function LineSymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function LineSymbologyToJSON(json) { + return LineSymbologyToJSONTyped(json, false); +} +function LineSymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'autoSimplified': value.autoSimplified, - 'stroke': (0, StrokeParam_1.StrokeParamToJSON)(value.stroke), - 'text': (0, TextSymbology_1.TextSymbologyToJSON)(value.text), - 'type': value.type, + 'autoSimplified': value['autoSimplified'], + 'stroke': (0, StrokeParam_1.StrokeParamToJSON)(value['stroke']), + 'text': (0, TextSymbology_1.TextSymbologyToJSON)(value['text']), + 'type': value['type'], }; } -exports.LineSymbologyToJSON = LineSymbologyToJSON; diff --git a/typescript/dist/models/LinearGradient.d.ts b/typescript/dist/models/LinearGradient.d.ts index f11f716f..04ab36a1 100644 --- a/typescript/dist/models/LinearGradient.d.ts +++ b/typescript/dist/models/LinearGradient.d.ts @@ -52,14 +52,13 @@ export interface LinearGradient { */ export declare const LinearGradientTypeEnum: { readonly LinearGradient: "linearGradient"; - readonly LogarithmicGradient: "logarithmicGradient"; - readonly Palette: "palette"; }; export type LinearGradientTypeEnum = typeof LinearGradientTypeEnum[keyof typeof LinearGradientTypeEnum]; /** * Check if a given object implements the LinearGradient interface. */ -export declare function instanceOfLinearGradient(value: object): boolean; +export declare function instanceOfLinearGradient(value: object): value is LinearGradient; export declare function LinearGradientFromJSON(json: any): LinearGradient; export declare function LinearGradientFromJSONTyped(json: any, ignoreDiscriminator: boolean): LinearGradient; -export declare function LinearGradientToJSON(value?: LinearGradient | null): any; +export declare function LinearGradientToJSON(json: any): LinearGradient; +export declare function LinearGradientToJSONTyped(value?: LinearGradient | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/LinearGradient.js b/typescript/dist/models/LinearGradient.js index bfcb1839..b07bb559 100644 --- a/typescript/dist/models/LinearGradient.js +++ b/typescript/dist/models/LinearGradient.js @@ -13,35 +13,40 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.LinearGradientToJSON = exports.LinearGradientFromJSONTyped = exports.LinearGradientFromJSON = exports.instanceOfLinearGradient = exports.LinearGradientTypeEnum = void 0; +exports.LinearGradientTypeEnum = void 0; +exports.instanceOfLinearGradient = instanceOfLinearGradient; +exports.LinearGradientFromJSON = LinearGradientFromJSON; +exports.LinearGradientFromJSONTyped = LinearGradientFromJSONTyped; +exports.LinearGradientToJSON = LinearGradientToJSON; +exports.LinearGradientToJSONTyped = LinearGradientToJSONTyped; const Breakpoint_1 = require("./Breakpoint"); /** * @export */ exports.LinearGradientTypeEnum = { - LinearGradient: 'linearGradient', - LogarithmicGradient: 'logarithmicGradient', - Palette: 'palette' + LinearGradient: 'linearGradient' }; /** * Check if a given object implements the LinearGradient interface. */ function instanceOfLinearGradient(value) { - let isInstance = true; - isInstance = isInstance && "breakpoints" in value; - isInstance = isInstance && "noDataColor" in value; - isInstance = isInstance && "overColor" in value; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "underColor" in value; - return isInstance; + if (!('breakpoints' in value) || value['breakpoints'] === undefined) + return false; + if (!('noDataColor' in value) || value['noDataColor'] === undefined) + return false; + if (!('overColor' in value) || value['overColor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + if (!('underColor' in value) || value['underColor'] === undefined) + return false; + return true; } -exports.instanceOfLinearGradient = instanceOfLinearGradient; function LinearGradientFromJSON(json) { return LinearGradientFromJSONTyped(json, false); } -exports.LinearGradientFromJSON = LinearGradientFromJSON; function LinearGradientFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,20 +57,18 @@ function LinearGradientFromJSONTyped(json, ignoreDiscriminator) { 'underColor': json['underColor'], }; } -exports.LinearGradientFromJSONTyped = LinearGradientFromJSONTyped; -function LinearGradientToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function LinearGradientToJSON(json) { + return LinearGradientToJSONTyped(json, false); +} +function LinearGradientToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'breakpoints': (value.breakpoints.map(Breakpoint_1.BreakpointToJSON)), - 'noDataColor': value.noDataColor, - 'overColor': value.overColor, - 'type': value.type, - 'underColor': value.underColor, + 'breakpoints': (value['breakpoints'].map(Breakpoint_1.BreakpointToJSON)), + 'noDataColor': value['noDataColor'], + 'overColor': value['overColor'], + 'type': value['type'], + 'underColor': value['underColor'], }; } -exports.LinearGradientToJSON = LinearGradientToJSON; diff --git a/typescript/dist/models/LogarithmicGradient.d.ts b/typescript/dist/models/LogarithmicGradient.d.ts index 3ca0a5d8..1d89248f 100644 --- a/typescript/dist/models/LogarithmicGradient.d.ts +++ b/typescript/dist/models/LogarithmicGradient.d.ts @@ -57,7 +57,8 @@ export type LogarithmicGradientTypeEnum = typeof LogarithmicGradientTypeEnum[key /** * Check if a given object implements the LogarithmicGradient interface. */ -export declare function instanceOfLogarithmicGradient(value: object): boolean; +export declare function instanceOfLogarithmicGradient(value: object): value is LogarithmicGradient; export declare function LogarithmicGradientFromJSON(json: any): LogarithmicGradient; export declare function LogarithmicGradientFromJSONTyped(json: any, ignoreDiscriminator: boolean): LogarithmicGradient; -export declare function LogarithmicGradientToJSON(value?: LogarithmicGradient | null): any; +export declare function LogarithmicGradientToJSON(json: any): LogarithmicGradient; +export declare function LogarithmicGradientToJSONTyped(value?: LogarithmicGradient | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/LogarithmicGradient.js b/typescript/dist/models/LogarithmicGradient.js index d11e3121..db88084e 100644 --- a/typescript/dist/models/LogarithmicGradient.js +++ b/typescript/dist/models/LogarithmicGradient.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.LogarithmicGradientToJSON = exports.LogarithmicGradientFromJSONTyped = exports.LogarithmicGradientFromJSON = exports.instanceOfLogarithmicGradient = exports.LogarithmicGradientTypeEnum = void 0; +exports.LogarithmicGradientTypeEnum = void 0; +exports.instanceOfLogarithmicGradient = instanceOfLogarithmicGradient; +exports.LogarithmicGradientFromJSON = LogarithmicGradientFromJSON; +exports.LogarithmicGradientFromJSONTyped = LogarithmicGradientFromJSONTyped; +exports.LogarithmicGradientToJSON = LogarithmicGradientToJSON; +exports.LogarithmicGradientToJSONTyped = LogarithmicGradientToJSONTyped; const Breakpoint_1 = require("./Breakpoint"); /** * @export @@ -25,21 +30,23 @@ exports.LogarithmicGradientTypeEnum = { * Check if a given object implements the LogarithmicGradient interface. */ function instanceOfLogarithmicGradient(value) { - let isInstance = true; - isInstance = isInstance && "breakpoints" in value; - isInstance = isInstance && "noDataColor" in value; - isInstance = isInstance && "overColor" in value; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "underColor" in value; - return isInstance; + if (!('breakpoints' in value) || value['breakpoints'] === undefined) + return false; + if (!('noDataColor' in value) || value['noDataColor'] === undefined) + return false; + if (!('overColor' in value) || value['overColor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + if (!('underColor' in value) || value['underColor'] === undefined) + return false; + return true; } -exports.instanceOfLogarithmicGradient = instanceOfLogarithmicGradient; function LogarithmicGradientFromJSON(json) { return LogarithmicGradientFromJSONTyped(json, false); } -exports.LogarithmicGradientFromJSON = LogarithmicGradientFromJSON; function LogarithmicGradientFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -50,20 +57,18 @@ function LogarithmicGradientFromJSONTyped(json, ignoreDiscriminator) { 'underColor': json['underColor'], }; } -exports.LogarithmicGradientFromJSONTyped = LogarithmicGradientFromJSONTyped; -function LogarithmicGradientToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function LogarithmicGradientToJSON(json) { + return LogarithmicGradientToJSONTyped(json, false); +} +function LogarithmicGradientToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'breakpoints': (value.breakpoints.map(Breakpoint_1.BreakpointToJSON)), - 'noDataColor': value.noDataColor, - 'overColor': value.overColor, - 'type': value.type, - 'underColor': value.underColor, + 'breakpoints': (value['breakpoints'].map(Breakpoint_1.BreakpointToJSON)), + 'noDataColor': value['noDataColor'], + 'overColor': value['overColor'], + 'type': value['type'], + 'underColor': value['underColor'], }; } -exports.LogarithmicGradientToJSON = LogarithmicGradientToJSON; diff --git a/typescript/dist/models/Measurement.d.ts b/typescript/dist/models/Measurement.d.ts index 6daef098..4ea22b1a 100644 --- a/typescript/dist/models/Measurement.d.ts +++ b/typescript/dist/models/Measurement.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ClassificationMeasurement } from './ClassificationMeasurement'; -import { ContinuousMeasurement } from './ContinuousMeasurement'; -import { UnitlessMeasurement } from './UnitlessMeasurement'; +import type { ClassificationMeasurement } from './ClassificationMeasurement'; +import type { ContinuousMeasurement } from './ContinuousMeasurement'; +import type { UnitlessMeasurement } from './UnitlessMeasurement'; /** * @type Measurement * @@ -26,4 +26,5 @@ export type Measurement = { } & UnitlessMeasurement; export declare function MeasurementFromJSON(json: any): Measurement; export declare function MeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): Measurement; -export declare function MeasurementToJSON(value?: Measurement | null): any; +export declare function MeasurementToJSON(json: any): any; +export declare function MeasurementToJSONTyped(value?: Measurement | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Measurement.js b/typescript/dist/models/Measurement.js index a19e4922..89d7c4b7 100644 --- a/typescript/dist/models/Measurement.js +++ b/typescript/dist/models/Measurement.js @@ -13,46 +13,46 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MeasurementToJSON = exports.MeasurementFromJSONTyped = exports.MeasurementFromJSON = void 0; +exports.MeasurementFromJSON = MeasurementFromJSON; +exports.MeasurementFromJSONTyped = MeasurementFromJSONTyped; +exports.MeasurementToJSON = MeasurementToJSON; +exports.MeasurementToJSONTyped = MeasurementToJSONTyped; const ClassificationMeasurement_1 = require("./ClassificationMeasurement"); const ContinuousMeasurement_1 = require("./ContinuousMeasurement"); const UnitlessMeasurement_1 = require("./UnitlessMeasurement"); function MeasurementFromJSON(json) { return MeasurementFromJSONTyped(json, false); } -exports.MeasurementFromJSON = MeasurementFromJSON; function MeasurementFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'classification': - return Object.assign(Object.assign({}, (0, ClassificationMeasurement_1.ClassificationMeasurementFromJSONTyped)(json, true)), { type: 'classification' }); + return Object.assign({}, (0, ClassificationMeasurement_1.ClassificationMeasurementFromJSONTyped)(json, true), { type: 'classification' }); case 'continuous': - return Object.assign(Object.assign({}, (0, ContinuousMeasurement_1.ContinuousMeasurementFromJSONTyped)(json, true)), { type: 'continuous' }); + return Object.assign({}, (0, ContinuousMeasurement_1.ContinuousMeasurementFromJSONTyped)(json, true), { type: 'continuous' }); case 'unitless': - return Object.assign(Object.assign({}, (0, UnitlessMeasurement_1.UnitlessMeasurementFromJSONTyped)(json, true)), { type: 'unitless' }); + return Object.assign({}, (0, UnitlessMeasurement_1.UnitlessMeasurementFromJSONTyped)(json, true), { type: 'unitless' }); default: throw new Error(`No variant of Measurement exists with 'type=${json['type']}'`); } } -exports.MeasurementFromJSONTyped = MeasurementFromJSONTyped; -function MeasurementToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MeasurementToJSON(json) { + return MeasurementToJSONTyped(json, false); +} +function MeasurementToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'classification': - return (0, ClassificationMeasurement_1.ClassificationMeasurementToJSON)(value); + return Object.assign({}, (0, ClassificationMeasurement_1.ClassificationMeasurementToJSON)(value), { type: 'classification' }); case 'continuous': - return (0, ContinuousMeasurement_1.ContinuousMeasurementToJSON)(value); + return Object.assign({}, (0, ContinuousMeasurement_1.ContinuousMeasurementToJSON)(value), { type: 'continuous' }); case 'unitless': - return (0, UnitlessMeasurement_1.UnitlessMeasurementToJSON)(value); + return Object.assign({}, (0, UnitlessMeasurement_1.UnitlessMeasurementToJSON)(value), { type: 'unitless' }); default: throw new Error(`No variant of Measurement exists with 'type=${value['type']}'`); } } -exports.MeasurementToJSON = MeasurementToJSON; diff --git a/typescript/dist/models/MetaDataDefinition.d.ts b/typescript/dist/models/MetaDataDefinition.d.ts index 6f92b75b..f1f5da52 100644 --- a/typescript/dist/models/MetaDataDefinition.d.ts +++ b/typescript/dist/models/MetaDataDefinition.d.ts @@ -9,12 +9,12 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { GdalMetaDataList } from './GdalMetaDataList'; -import { GdalMetaDataRegular } from './GdalMetaDataRegular'; -import { GdalMetaDataStatic } from './GdalMetaDataStatic'; -import { GdalMetadataNetCdfCf } from './GdalMetadataNetCdfCf'; -import { MockMetaData } from './MockMetaData'; -import { OgrMetaData } from './OgrMetaData'; +import type { GdalMetaDataList } from './GdalMetaDataList'; +import type { GdalMetaDataRegular } from './GdalMetaDataRegular'; +import type { GdalMetaDataStatic } from './GdalMetaDataStatic'; +import type { GdalMetadataNetCdfCf } from './GdalMetadataNetCdfCf'; +import type { MockMetaData } from './MockMetaData'; +import type { OgrMetaData } from './OgrMetaData'; /** * @type MetaDataDefinition * @@ -35,4 +35,5 @@ export type MetaDataDefinition = { } & OgrMetaData; export declare function MetaDataDefinitionFromJSON(json: any): MetaDataDefinition; export declare function MetaDataDefinitionFromJSONTyped(json: any, ignoreDiscriminator: boolean): MetaDataDefinition; -export declare function MetaDataDefinitionToJSON(value?: MetaDataDefinition | null): any; +export declare function MetaDataDefinitionToJSON(json: any): any; +export declare function MetaDataDefinitionToJSONTyped(value?: MetaDataDefinition | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MetaDataDefinition.js b/typescript/dist/models/MetaDataDefinition.js index 84435969..9cfda354 100644 --- a/typescript/dist/models/MetaDataDefinition.js +++ b/typescript/dist/models/MetaDataDefinition.js @@ -13,7 +13,10 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MetaDataDefinitionToJSON = exports.MetaDataDefinitionFromJSONTyped = exports.MetaDataDefinitionFromJSON = void 0; +exports.MetaDataDefinitionFromJSON = MetaDataDefinitionFromJSON; +exports.MetaDataDefinitionFromJSONTyped = MetaDataDefinitionFromJSONTyped; +exports.MetaDataDefinitionToJSON = MetaDataDefinitionToJSON; +exports.MetaDataDefinitionToJSONTyped = MetaDataDefinitionToJSONTyped; const GdalMetaDataList_1 = require("./GdalMetaDataList"); const GdalMetaDataRegular_1 = require("./GdalMetaDataRegular"); const GdalMetaDataStatic_1 = require("./GdalMetaDataStatic"); @@ -23,51 +26,48 @@ const OgrMetaData_1 = require("./OgrMetaData"); function MetaDataDefinitionFromJSON(json) { return MetaDataDefinitionFromJSONTyped(json, false); } -exports.MetaDataDefinitionFromJSON = MetaDataDefinitionFromJSON; function MetaDataDefinitionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'GdalMetaDataList': - return Object.assign(Object.assign({}, (0, GdalMetaDataList_1.GdalMetaDataListFromJSONTyped)(json, true)), { type: 'GdalMetaDataList' }); + return Object.assign({}, (0, GdalMetaDataList_1.GdalMetaDataListFromJSONTyped)(json, true), { type: 'GdalMetaDataList' }); case 'GdalMetaDataRegular': - return Object.assign(Object.assign({}, (0, GdalMetaDataRegular_1.GdalMetaDataRegularFromJSONTyped)(json, true)), { type: 'GdalMetaDataRegular' }); + return Object.assign({}, (0, GdalMetaDataRegular_1.GdalMetaDataRegularFromJSONTyped)(json, true), { type: 'GdalMetaDataRegular' }); case 'GdalMetadataNetCdfCf': - return Object.assign(Object.assign({}, (0, GdalMetadataNetCdfCf_1.GdalMetadataNetCdfCfFromJSONTyped)(json, true)), { type: 'GdalMetadataNetCdfCf' }); + return Object.assign({}, (0, GdalMetadataNetCdfCf_1.GdalMetadataNetCdfCfFromJSONTyped)(json, true), { type: 'GdalMetadataNetCdfCf' }); case 'GdalStatic': - return Object.assign(Object.assign({}, (0, GdalMetaDataStatic_1.GdalMetaDataStaticFromJSONTyped)(json, true)), { type: 'GdalStatic' }); + return Object.assign({}, (0, GdalMetaDataStatic_1.GdalMetaDataStaticFromJSONTyped)(json, true), { type: 'GdalStatic' }); case 'MockMetaData': - return Object.assign(Object.assign({}, (0, MockMetaData_1.MockMetaDataFromJSONTyped)(json, true)), { type: 'MockMetaData' }); + return Object.assign({}, (0, MockMetaData_1.MockMetaDataFromJSONTyped)(json, true), { type: 'MockMetaData' }); case 'OgrMetaData': - return Object.assign(Object.assign({}, (0, OgrMetaData_1.OgrMetaDataFromJSONTyped)(json, true)), { type: 'OgrMetaData' }); + return Object.assign({}, (0, OgrMetaData_1.OgrMetaDataFromJSONTyped)(json, true), { type: 'OgrMetaData' }); default: throw new Error(`No variant of MetaDataDefinition exists with 'type=${json['type']}'`); } } -exports.MetaDataDefinitionFromJSONTyped = MetaDataDefinitionFromJSONTyped; -function MetaDataDefinitionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MetaDataDefinitionToJSON(json) { + return MetaDataDefinitionToJSONTyped(json, false); +} +function MetaDataDefinitionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'GdalMetaDataList': - return (0, GdalMetaDataList_1.GdalMetaDataListToJSON)(value); + return Object.assign({}, (0, GdalMetaDataList_1.GdalMetaDataListToJSON)(value), { type: 'GdalMetaDataList' }); case 'GdalMetaDataRegular': - return (0, GdalMetaDataRegular_1.GdalMetaDataRegularToJSON)(value); + return Object.assign({}, (0, GdalMetaDataRegular_1.GdalMetaDataRegularToJSON)(value), { type: 'GdalMetaDataRegular' }); case 'GdalMetadataNetCdfCf': - return (0, GdalMetadataNetCdfCf_1.GdalMetadataNetCdfCfToJSON)(value); + return Object.assign({}, (0, GdalMetadataNetCdfCf_1.GdalMetadataNetCdfCfToJSON)(value), { type: 'GdalMetadataNetCdfCf' }); case 'GdalStatic': - return (0, GdalMetaDataStatic_1.GdalMetaDataStaticToJSON)(value); + return Object.assign({}, (0, GdalMetaDataStatic_1.GdalMetaDataStaticToJSON)(value), { type: 'GdalStatic' }); case 'MockMetaData': - return (0, MockMetaData_1.MockMetaDataToJSON)(value); + return Object.assign({}, (0, MockMetaData_1.MockMetaDataToJSON)(value), { type: 'MockMetaData' }); case 'OgrMetaData': - return (0, OgrMetaData_1.OgrMetaDataToJSON)(value); + return Object.assign({}, (0, OgrMetaData_1.OgrMetaDataToJSON)(value), { type: 'OgrMetaData' }); default: throw new Error(`No variant of MetaDataDefinition exists with 'type=${value['type']}'`); } } -exports.MetaDataDefinitionToJSON = MetaDataDefinitionToJSON; diff --git a/typescript/dist/models/MetaDataSuggestion.d.ts b/typescript/dist/models/MetaDataSuggestion.d.ts index 38460fb6..dd1cc615 100644 --- a/typescript/dist/models/MetaDataSuggestion.d.ts +++ b/typescript/dist/models/MetaDataSuggestion.d.ts @@ -38,7 +38,8 @@ export interface MetaDataSuggestion { /** * Check if a given object implements the MetaDataSuggestion interface. */ -export declare function instanceOfMetaDataSuggestion(value: object): boolean; +export declare function instanceOfMetaDataSuggestion(value: object): value is MetaDataSuggestion; export declare function MetaDataSuggestionFromJSON(json: any): MetaDataSuggestion; export declare function MetaDataSuggestionFromJSONTyped(json: any, ignoreDiscriminator: boolean): MetaDataSuggestion; -export declare function MetaDataSuggestionToJSON(value?: MetaDataSuggestion | null): any; +export declare function MetaDataSuggestionToJSON(json: any): MetaDataSuggestion; +export declare function MetaDataSuggestionToJSONTyped(value?: MetaDataSuggestion | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MetaDataSuggestion.js b/typescript/dist/models/MetaDataSuggestion.js index b6078b39..72b60de3 100644 --- a/typescript/dist/models/MetaDataSuggestion.js +++ b/typescript/dist/models/MetaDataSuggestion.js @@ -13,25 +13,29 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MetaDataSuggestionToJSON = exports.MetaDataSuggestionFromJSONTyped = exports.MetaDataSuggestionFromJSON = exports.instanceOfMetaDataSuggestion = void 0; +exports.instanceOfMetaDataSuggestion = instanceOfMetaDataSuggestion; +exports.MetaDataSuggestionFromJSON = MetaDataSuggestionFromJSON; +exports.MetaDataSuggestionFromJSONTyped = MetaDataSuggestionFromJSONTyped; +exports.MetaDataSuggestionToJSON = MetaDataSuggestionToJSON; +exports.MetaDataSuggestionToJSONTyped = MetaDataSuggestionToJSONTyped; const MetaDataDefinition_1 = require("./MetaDataDefinition"); /** * Check if a given object implements the MetaDataSuggestion interface. */ function instanceOfMetaDataSuggestion(value) { - let isInstance = true; - isInstance = isInstance && "layerName" in value; - isInstance = isInstance && "mainFile" in value; - isInstance = isInstance && "metaData" in value; - return isInstance; + if (!('layerName' in value) || value['layerName'] === undefined) + return false; + if (!('mainFile' in value) || value['mainFile'] === undefined) + return false; + if (!('metaData' in value) || value['metaData'] === undefined) + return false; + return true; } -exports.instanceOfMetaDataSuggestion = instanceOfMetaDataSuggestion; function MetaDataSuggestionFromJSON(json) { return MetaDataSuggestionFromJSONTyped(json, false); } -exports.MetaDataSuggestionFromJSON = MetaDataSuggestionFromJSON; function MetaDataSuggestionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -40,18 +44,16 @@ function MetaDataSuggestionFromJSONTyped(json, ignoreDiscriminator) { 'metaData': (0, MetaDataDefinition_1.MetaDataDefinitionFromJSON)(json['metaData']), }; } -exports.MetaDataSuggestionFromJSONTyped = MetaDataSuggestionFromJSONTyped; -function MetaDataSuggestionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MetaDataSuggestionToJSON(json) { + return MetaDataSuggestionToJSONTyped(json, false); +} +function MetaDataSuggestionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'layerName': value.layerName, - 'mainFile': value.mainFile, - 'metaData': (0, MetaDataDefinition_1.MetaDataDefinitionToJSON)(value.metaData), + 'layerName': value['layerName'], + 'mainFile': value['mainFile'], + 'metaData': (0, MetaDataDefinition_1.MetaDataDefinitionToJSON)(value['metaData']), }; } -exports.MetaDataSuggestionToJSON = MetaDataSuggestionToJSON; diff --git a/typescript/dist/models/MlModel.d.ts b/typescript/dist/models/MlModel.d.ts index 73c636bf..865caa00 100644 --- a/typescript/dist/models/MlModel.d.ts +++ b/typescript/dist/models/MlModel.d.ts @@ -50,7 +50,8 @@ export interface MlModel { /** * Check if a given object implements the MlModel interface. */ -export declare function instanceOfMlModel(value: object): boolean; +export declare function instanceOfMlModel(value: object): value is MlModel; export declare function MlModelFromJSON(json: any): MlModel; export declare function MlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModel; -export declare function MlModelToJSON(value?: MlModel | null): any; +export declare function MlModelToJSON(json: any): MlModel; +export declare function MlModelToJSONTyped(value?: MlModel | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MlModel.js b/typescript/dist/models/MlModel.js index 444c91b6..0d32663f 100644 --- a/typescript/dist/models/MlModel.js +++ b/typescript/dist/models/MlModel.js @@ -13,27 +13,33 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MlModelToJSON = exports.MlModelFromJSONTyped = exports.MlModelFromJSON = exports.instanceOfMlModel = void 0; +exports.instanceOfMlModel = instanceOfMlModel; +exports.MlModelFromJSON = MlModelFromJSON; +exports.MlModelFromJSONTyped = MlModelFromJSONTyped; +exports.MlModelToJSON = MlModelToJSON; +exports.MlModelToJSONTyped = MlModelToJSONTyped; const MlModelMetadata_1 = require("./MlModelMetadata"); /** * Check if a given object implements the MlModel interface. */ function instanceOfMlModel(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "metadata" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "upload" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('metadata' in value) || value['metadata'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('upload' in value) || value['upload'] === undefined) + return false; + return true; } -exports.instanceOfMlModel = instanceOfMlModel; function MlModelFromJSON(json) { return MlModelFromJSONTyped(json, false); } -exports.MlModelFromJSON = MlModelFromJSON; function MlModelFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -44,20 +50,18 @@ function MlModelFromJSONTyped(json, ignoreDiscriminator) { 'upload': json['upload'], }; } -exports.MlModelFromJSONTyped = MlModelFromJSONTyped; -function MlModelToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MlModelToJSON(json) { + return MlModelToJSONTyped(json, false); +} +function MlModelToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'displayName': value.displayName, - 'metadata': (0, MlModelMetadata_1.MlModelMetadataToJSON)(value.metadata), - 'name': value.name, - 'upload': value.upload, + 'description': value['description'], + 'displayName': value['displayName'], + 'metadata': (0, MlModelMetadata_1.MlModelMetadataToJSON)(value['metadata']), + 'name': value['name'], + 'upload': value['upload'], }; } -exports.MlModelToJSON = MlModelToJSON; diff --git a/typescript/dist/models/MlModelMetadata.d.ts b/typescript/dist/models/MlModelMetadata.d.ts index 707778e9..7316b1cc 100644 --- a/typescript/dist/models/MlModelMetadata.d.ts +++ b/typescript/dist/models/MlModelMetadata.d.ts @@ -44,7 +44,8 @@ export interface MlModelMetadata { /** * Check if a given object implements the MlModelMetadata interface. */ -export declare function instanceOfMlModelMetadata(value: object): boolean; +export declare function instanceOfMlModelMetadata(value: object): value is MlModelMetadata; export declare function MlModelMetadataFromJSON(json: any): MlModelMetadata; export declare function MlModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelMetadata; -export declare function MlModelMetadataToJSON(value?: MlModelMetadata | null): any; +export declare function MlModelMetadataToJSON(json: any): MlModelMetadata; +export declare function MlModelMetadataToJSONTyped(value?: MlModelMetadata | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MlModelMetadata.js b/typescript/dist/models/MlModelMetadata.js index ff2af007..5038f886 100644 --- a/typescript/dist/models/MlModelMetadata.js +++ b/typescript/dist/models/MlModelMetadata.js @@ -13,26 +13,31 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MlModelMetadataToJSON = exports.MlModelMetadataFromJSONTyped = exports.MlModelMetadataFromJSON = exports.instanceOfMlModelMetadata = void 0; +exports.instanceOfMlModelMetadata = instanceOfMlModelMetadata; +exports.MlModelMetadataFromJSON = MlModelMetadataFromJSON; +exports.MlModelMetadataFromJSONTyped = MlModelMetadataFromJSONTyped; +exports.MlModelMetadataToJSON = MlModelMetadataToJSON; +exports.MlModelMetadataToJSONTyped = MlModelMetadataToJSONTyped; const RasterDataType_1 = require("./RasterDataType"); /** * Check if a given object implements the MlModelMetadata interface. */ function instanceOfMlModelMetadata(value) { - let isInstance = true; - isInstance = isInstance && "fileName" in value; - isInstance = isInstance && "inputType" in value; - isInstance = isInstance && "numInputBands" in value; - isInstance = isInstance && "outputType" in value; - return isInstance; + if (!('fileName' in value) || value['fileName'] === undefined) + return false; + if (!('inputType' in value) || value['inputType'] === undefined) + return false; + if (!('numInputBands' in value) || value['numInputBands'] === undefined) + return false; + if (!('outputType' in value) || value['outputType'] === undefined) + return false; + return true; } -exports.instanceOfMlModelMetadata = instanceOfMlModelMetadata; function MlModelMetadataFromJSON(json) { return MlModelMetadataFromJSONTyped(json, false); } -exports.MlModelMetadataFromJSON = MlModelMetadataFromJSON; function MlModelMetadataFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,19 +47,17 @@ function MlModelMetadataFromJSONTyped(json, ignoreDiscriminator) { 'outputType': (0, RasterDataType_1.RasterDataTypeFromJSON)(json['outputType']), }; } -exports.MlModelMetadataFromJSONTyped = MlModelMetadataFromJSONTyped; -function MlModelMetadataToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MlModelMetadataToJSON(json) { + return MlModelMetadataToJSONTyped(json, false); +} +function MlModelMetadataToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'fileName': value.fileName, - 'inputType': (0, RasterDataType_1.RasterDataTypeToJSON)(value.inputType), - 'numInputBands': value.numInputBands, - 'outputType': (0, RasterDataType_1.RasterDataTypeToJSON)(value.outputType), + 'fileName': value['fileName'], + 'inputType': (0, RasterDataType_1.RasterDataTypeToJSON)(value['inputType']), + 'numInputBands': value['numInputBands'], + 'outputType': (0, RasterDataType_1.RasterDataTypeToJSON)(value['outputType']), }; } -exports.MlModelMetadataToJSON = MlModelMetadataToJSON; diff --git a/typescript/dist/models/MlModelNameResponse.d.ts b/typescript/dist/models/MlModelNameResponse.d.ts index 750bd6e1..9d610baa 100644 --- a/typescript/dist/models/MlModelNameResponse.d.ts +++ b/typescript/dist/models/MlModelNameResponse.d.ts @@ -25,7 +25,8 @@ export interface MlModelNameResponse { /** * Check if a given object implements the MlModelNameResponse interface. */ -export declare function instanceOfMlModelNameResponse(value: object): boolean; +export declare function instanceOfMlModelNameResponse(value: object): value is MlModelNameResponse; export declare function MlModelNameResponseFromJSON(json: any): MlModelNameResponse; export declare function MlModelNameResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelNameResponse; -export declare function MlModelNameResponseToJSON(value?: MlModelNameResponse | null): any; +export declare function MlModelNameResponseToJSON(json: any): MlModelNameResponse; +export declare function MlModelNameResponseToJSONTyped(value?: MlModelNameResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MlModelNameResponse.js b/typescript/dist/models/MlModelNameResponse.js index e139d8e9..6846e723 100644 --- a/typescript/dist/models/MlModelNameResponse.js +++ b/typescript/dist/models/MlModelNameResponse.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MlModelNameResponseToJSON = exports.MlModelNameResponseFromJSONTyped = exports.MlModelNameResponseFromJSON = exports.instanceOfMlModelNameResponse = void 0; +exports.instanceOfMlModelNameResponse = instanceOfMlModelNameResponse; +exports.MlModelNameResponseFromJSON = MlModelNameResponseFromJSON; +exports.MlModelNameResponseFromJSONTyped = MlModelNameResponseFromJSONTyped; +exports.MlModelNameResponseToJSON = MlModelNameResponseToJSON; +exports.MlModelNameResponseToJSONTyped = MlModelNameResponseToJSONTyped; /** * Check if a given object implements the MlModelNameResponse interface. */ function instanceOfMlModelNameResponse(value) { - let isInstance = true; - isInstance = isInstance && "mlModelName" in value; - return isInstance; + if (!('mlModelName' in value) || value['mlModelName'] === undefined) + return false; + return true; } -exports.instanceOfMlModelNameResponse = instanceOfMlModelNameResponse; function MlModelNameResponseFromJSON(json) { return MlModelNameResponseFromJSONTyped(json, false); } -exports.MlModelNameResponseFromJSON = MlModelNameResponseFromJSON; function MlModelNameResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'mlModelName': json['mlModelName'], }; } -exports.MlModelNameResponseFromJSONTyped = MlModelNameResponseFromJSONTyped; -function MlModelNameResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MlModelNameResponseToJSON(json) { + return MlModelNameResponseToJSONTyped(json, false); +} +function MlModelNameResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'mlModelName': value.mlModelName, + 'mlModelName': value['mlModelName'], }; } -exports.MlModelNameResponseToJSON = MlModelNameResponseToJSON; diff --git a/typescript/dist/models/MlModelResource.d.ts b/typescript/dist/models/MlModelResource.d.ts index a72112d5..964b33e5 100644 --- a/typescript/dist/models/MlModelResource.d.ts +++ b/typescript/dist/models/MlModelResource.d.ts @@ -38,7 +38,8 @@ export type MlModelResourceTypeEnum = typeof MlModelResourceTypeEnum[keyof typeo /** * Check if a given object implements the MlModelResource interface. */ -export declare function instanceOfMlModelResource(value: object): boolean; +export declare function instanceOfMlModelResource(value: object): value is MlModelResource; export declare function MlModelResourceFromJSON(json: any): MlModelResource; export declare function MlModelResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelResource; -export declare function MlModelResourceToJSON(value?: MlModelResource | null): any; +export declare function MlModelResourceToJSON(json: any): MlModelResource; +export declare function MlModelResourceToJSONTyped(value?: MlModelResource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MlModelResource.js b/typescript/dist/models/MlModelResource.js index ce9e7045..d708c275 100644 --- a/typescript/dist/models/MlModelResource.js +++ b/typescript/dist/models/MlModelResource.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MlModelResourceToJSON = exports.MlModelResourceFromJSONTyped = exports.MlModelResourceFromJSON = exports.instanceOfMlModelResource = exports.MlModelResourceTypeEnum = void 0; +exports.MlModelResourceTypeEnum = void 0; +exports.instanceOfMlModelResource = instanceOfMlModelResource; +exports.MlModelResourceFromJSON = MlModelResourceFromJSON; +exports.MlModelResourceFromJSONTyped = MlModelResourceFromJSONTyped; +exports.MlModelResourceToJSON = MlModelResourceToJSON; +exports.MlModelResourceToJSONTyped = MlModelResourceToJSONTyped; /** * @export */ @@ -24,18 +29,17 @@ exports.MlModelResourceTypeEnum = { * Check if a given object implements the MlModelResource interface. */ function instanceOfMlModelResource(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfMlModelResource = instanceOfMlModelResource; function MlModelResourceFromJSON(json) { return MlModelResourceFromJSONTyped(json, false); } -exports.MlModelResourceFromJSON = MlModelResourceFromJSON; function MlModelResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +47,15 @@ function MlModelResourceFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.MlModelResourceFromJSONTyped = MlModelResourceFromJSONTyped; -function MlModelResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MlModelResourceToJSON(json) { + return MlModelResourceToJSONTyped(json, false); +} +function MlModelResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } -exports.MlModelResourceToJSON = MlModelResourceToJSON; diff --git a/typescript/dist/models/MockDatasetDataSourceLoadingInfo.d.ts b/typescript/dist/models/MockDatasetDataSourceLoadingInfo.d.ts index 2bf35129..4aaed260 100644 --- a/typescript/dist/models/MockDatasetDataSourceLoadingInfo.d.ts +++ b/typescript/dist/models/MockDatasetDataSourceLoadingInfo.d.ts @@ -26,7 +26,8 @@ export interface MockDatasetDataSourceLoadingInfo { /** * Check if a given object implements the MockDatasetDataSourceLoadingInfo interface. */ -export declare function instanceOfMockDatasetDataSourceLoadingInfo(value: object): boolean; +export declare function instanceOfMockDatasetDataSourceLoadingInfo(value: object): value is MockDatasetDataSourceLoadingInfo; export declare function MockDatasetDataSourceLoadingInfoFromJSON(json: any): MockDatasetDataSourceLoadingInfo; export declare function MockDatasetDataSourceLoadingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): MockDatasetDataSourceLoadingInfo; -export declare function MockDatasetDataSourceLoadingInfoToJSON(value?: MockDatasetDataSourceLoadingInfo | null): any; +export declare function MockDatasetDataSourceLoadingInfoToJSON(json: any): MockDatasetDataSourceLoadingInfo; +export declare function MockDatasetDataSourceLoadingInfoToJSONTyped(value?: MockDatasetDataSourceLoadingInfo | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MockDatasetDataSourceLoadingInfo.js b/typescript/dist/models/MockDatasetDataSourceLoadingInfo.js index b8492737..330cc4ad 100644 --- a/typescript/dist/models/MockDatasetDataSourceLoadingInfo.js +++ b/typescript/dist/models/MockDatasetDataSourceLoadingInfo.js @@ -13,39 +13,39 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MockDatasetDataSourceLoadingInfoToJSON = exports.MockDatasetDataSourceLoadingInfoFromJSONTyped = exports.MockDatasetDataSourceLoadingInfoFromJSON = exports.instanceOfMockDatasetDataSourceLoadingInfo = void 0; +exports.instanceOfMockDatasetDataSourceLoadingInfo = instanceOfMockDatasetDataSourceLoadingInfo; +exports.MockDatasetDataSourceLoadingInfoFromJSON = MockDatasetDataSourceLoadingInfoFromJSON; +exports.MockDatasetDataSourceLoadingInfoFromJSONTyped = MockDatasetDataSourceLoadingInfoFromJSONTyped; +exports.MockDatasetDataSourceLoadingInfoToJSON = MockDatasetDataSourceLoadingInfoToJSON; +exports.MockDatasetDataSourceLoadingInfoToJSONTyped = MockDatasetDataSourceLoadingInfoToJSONTyped; const Coordinate2D_1 = require("./Coordinate2D"); /** * Check if a given object implements the MockDatasetDataSourceLoadingInfo interface. */ function instanceOfMockDatasetDataSourceLoadingInfo(value) { - let isInstance = true; - isInstance = isInstance && "points" in value; - return isInstance; + if (!('points' in value) || value['points'] === undefined) + return false; + return true; } -exports.instanceOfMockDatasetDataSourceLoadingInfo = instanceOfMockDatasetDataSourceLoadingInfo; function MockDatasetDataSourceLoadingInfoFromJSON(json) { return MockDatasetDataSourceLoadingInfoFromJSONTyped(json, false); } -exports.MockDatasetDataSourceLoadingInfoFromJSON = MockDatasetDataSourceLoadingInfoFromJSON; function MockDatasetDataSourceLoadingInfoFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'points': (json['points'].map(Coordinate2D_1.Coordinate2DFromJSON)), }; } -exports.MockDatasetDataSourceLoadingInfoFromJSONTyped = MockDatasetDataSourceLoadingInfoFromJSONTyped; -function MockDatasetDataSourceLoadingInfoToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MockDatasetDataSourceLoadingInfoToJSON(json) { + return MockDatasetDataSourceLoadingInfoToJSONTyped(json, false); +} +function MockDatasetDataSourceLoadingInfoToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'points': (value.points.map(Coordinate2D_1.Coordinate2DToJSON)), + 'points': (value['points'].map(Coordinate2D_1.Coordinate2DToJSON)), }; } -exports.MockDatasetDataSourceLoadingInfoToJSON = MockDatasetDataSourceLoadingInfoToJSON; diff --git a/typescript/dist/models/MockMetaData.d.ts b/typescript/dist/models/MockMetaData.d.ts index e36586fb..06c65faa 100644 --- a/typescript/dist/models/MockMetaData.d.ts +++ b/typescript/dist/models/MockMetaData.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { MockDatasetDataSourceLoadingInfo } from './MockDatasetDataSourceLoadingInfo'; import type { VectorResultDescriptor } from './VectorResultDescriptor'; +import type { MockDatasetDataSourceLoadingInfo } from './MockDatasetDataSourceLoadingInfo'; /** * * @export @@ -41,17 +41,13 @@ export interface MockMetaData { */ export declare const MockMetaDataTypeEnum: { readonly MockMetaData: "MockMetaData"; - readonly OgrMetaData: "OgrMetaData"; - readonly GdalMetaDataRegular: "GdalMetaDataRegular"; - readonly GdalStatic: "GdalStatic"; - readonly GdalMetadataNetCdfCf: "GdalMetadataNetCdfCf"; - readonly GdalMetaDataList: "GdalMetaDataList"; }; export type MockMetaDataTypeEnum = typeof MockMetaDataTypeEnum[keyof typeof MockMetaDataTypeEnum]; /** * Check if a given object implements the MockMetaData interface. */ -export declare function instanceOfMockMetaData(value: object): boolean; +export declare function instanceOfMockMetaData(value: object): value is MockMetaData; export declare function MockMetaDataFromJSON(json: any): MockMetaData; export declare function MockMetaDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): MockMetaData; -export declare function MockMetaDataToJSON(value?: MockMetaData | null): any; +export declare function MockMetaDataToJSON(json: any): MockMetaData; +export declare function MockMetaDataToJSONTyped(value?: MockMetaData | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MockMetaData.js b/typescript/dist/models/MockMetaData.js index d08cde94..858795fc 100644 --- a/typescript/dist/models/MockMetaData.js +++ b/typescript/dist/models/MockMetaData.js @@ -13,37 +13,37 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MockMetaDataToJSON = exports.MockMetaDataFromJSONTyped = exports.MockMetaDataFromJSON = exports.instanceOfMockMetaData = exports.MockMetaDataTypeEnum = void 0; -const MockDatasetDataSourceLoadingInfo_1 = require("./MockDatasetDataSourceLoadingInfo"); +exports.MockMetaDataTypeEnum = void 0; +exports.instanceOfMockMetaData = instanceOfMockMetaData; +exports.MockMetaDataFromJSON = MockMetaDataFromJSON; +exports.MockMetaDataFromJSONTyped = MockMetaDataFromJSONTyped; +exports.MockMetaDataToJSON = MockMetaDataToJSON; +exports.MockMetaDataToJSONTyped = MockMetaDataToJSONTyped; const VectorResultDescriptor_1 = require("./VectorResultDescriptor"); +const MockDatasetDataSourceLoadingInfo_1 = require("./MockDatasetDataSourceLoadingInfo"); /** * @export */ exports.MockMetaDataTypeEnum = { - MockMetaData: 'MockMetaData', - OgrMetaData: 'OgrMetaData', - GdalMetaDataRegular: 'GdalMetaDataRegular', - GdalStatic: 'GdalStatic', - GdalMetadataNetCdfCf: 'GdalMetadataNetCdfCf', - GdalMetaDataList: 'GdalMetaDataList' + MockMetaData: 'MockMetaData' }; /** * Check if a given object implements the MockMetaData interface. */ function instanceOfMockMetaData(value) { - let isInstance = true; - isInstance = isInstance && "loadingInfo" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('loadingInfo' in value) || value['loadingInfo'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfMockMetaData = instanceOfMockMetaData; function MockMetaDataFromJSON(json) { return MockMetaDataFromJSONTyped(json, false); } -exports.MockMetaDataFromJSON = MockMetaDataFromJSON; function MockMetaDataFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,18 +52,16 @@ function MockMetaDataFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.MockMetaDataFromJSONTyped = MockMetaDataFromJSONTyped; -function MockMetaDataToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MockMetaDataToJSON(json) { + return MockMetaDataToJSONTyped(json, false); +} +function MockMetaDataToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'loadingInfo': (0, MockDatasetDataSourceLoadingInfo_1.MockDatasetDataSourceLoadingInfoToJSON)(value.loadingInfo), - 'resultDescriptor': (0, VectorResultDescriptor_1.VectorResultDescriptorToJSON)(value.resultDescriptor), - 'type': value.type, + 'loadingInfo': (0, MockDatasetDataSourceLoadingInfo_1.MockDatasetDataSourceLoadingInfoToJSON)(value['loadingInfo']), + 'resultDescriptor': (0, VectorResultDescriptor_1.VectorResultDescriptorToJSON)(value['resultDescriptor']), + 'type': value['type'], }; } -exports.MockMetaDataToJSON = MockMetaDataToJSON; diff --git a/typescript/dist/models/MultiBandRasterColorizer.d.ts b/typescript/dist/models/MultiBandRasterColorizer.d.ts index c80dbea0..a937f8e1 100644 --- a/typescript/dist/models/MultiBandRasterColorizer.d.ts +++ b/typescript/dist/models/MultiBandRasterColorizer.d.ts @@ -110,7 +110,8 @@ export type MultiBandRasterColorizerTypeEnum = typeof MultiBandRasterColorizerTy /** * Check if a given object implements the MultiBandRasterColorizer interface. */ -export declare function instanceOfMultiBandRasterColorizer(value: object): boolean; +export declare function instanceOfMultiBandRasterColorizer(value: object): value is MultiBandRasterColorizer; export declare function MultiBandRasterColorizerFromJSON(json: any): MultiBandRasterColorizer; export declare function MultiBandRasterColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiBandRasterColorizer; -export declare function MultiBandRasterColorizerToJSON(value?: MultiBandRasterColorizer | null): any; +export declare function MultiBandRasterColorizerToJSON(json: any): MultiBandRasterColorizer; +export declare function MultiBandRasterColorizerToJSONTyped(value?: MultiBandRasterColorizer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MultiBandRasterColorizer.js b/typescript/dist/models/MultiBandRasterColorizer.js index d1e8207b..b3cb65b7 100644 --- a/typescript/dist/models/MultiBandRasterColorizer.js +++ b/typescript/dist/models/MultiBandRasterColorizer.js @@ -13,8 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MultiBandRasterColorizerToJSON = exports.MultiBandRasterColorizerFromJSONTyped = exports.MultiBandRasterColorizerFromJSON = exports.instanceOfMultiBandRasterColorizer = exports.MultiBandRasterColorizerTypeEnum = void 0; -const runtime_1 = require("../runtime"); +exports.MultiBandRasterColorizerTypeEnum = void 0; +exports.instanceOfMultiBandRasterColorizer = instanceOfMultiBandRasterColorizer; +exports.MultiBandRasterColorizerFromJSON = MultiBandRasterColorizerFromJSON; +exports.MultiBandRasterColorizerFromJSONTyped = MultiBandRasterColorizerFromJSONTyped; +exports.MultiBandRasterColorizerToJSON = MultiBandRasterColorizerToJSON; +exports.MultiBandRasterColorizerToJSONTyped = MultiBandRasterColorizerToJSONTyped; /** * @export */ @@ -25,68 +29,73 @@ exports.MultiBandRasterColorizerTypeEnum = { * Check if a given object implements the MultiBandRasterColorizer interface. */ function instanceOfMultiBandRasterColorizer(value) { - let isInstance = true; - isInstance = isInstance && "blueBand" in value; - isInstance = isInstance && "blueMax" in value; - isInstance = isInstance && "blueMin" in value; - isInstance = isInstance && "greenBand" in value; - isInstance = isInstance && "greenMax" in value; - isInstance = isInstance && "greenMin" in value; - isInstance = isInstance && "redBand" in value; - isInstance = isInstance && "redMax" in value; - isInstance = isInstance && "redMin" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('blueBand' in value) || value['blueBand'] === undefined) + return false; + if (!('blueMax' in value) || value['blueMax'] === undefined) + return false; + if (!('blueMin' in value) || value['blueMin'] === undefined) + return false; + if (!('greenBand' in value) || value['greenBand'] === undefined) + return false; + if (!('greenMax' in value) || value['greenMax'] === undefined) + return false; + if (!('greenMin' in value) || value['greenMin'] === undefined) + return false; + if (!('redBand' in value) || value['redBand'] === undefined) + return false; + if (!('redMax' in value) || value['redMax'] === undefined) + return false; + if (!('redMin' in value) || value['redMin'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfMultiBandRasterColorizer = instanceOfMultiBandRasterColorizer; function MultiBandRasterColorizerFromJSON(json) { return MultiBandRasterColorizerFromJSONTyped(json, false); } -exports.MultiBandRasterColorizerFromJSON = MultiBandRasterColorizerFromJSON; function MultiBandRasterColorizerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'blueBand': json['blueBand'], 'blueMax': json['blueMax'], 'blueMin': json['blueMin'], - 'blueScale': !(0, runtime_1.exists)(json, 'blueScale') ? undefined : json['blueScale'], + 'blueScale': json['blueScale'] == null ? undefined : json['blueScale'], 'greenBand': json['greenBand'], 'greenMax': json['greenMax'], 'greenMin': json['greenMin'], - 'greenScale': !(0, runtime_1.exists)(json, 'greenScale') ? undefined : json['greenScale'], - 'noDataColor': !(0, runtime_1.exists)(json, 'noDataColor') ? undefined : json['noDataColor'], + 'greenScale': json['greenScale'] == null ? undefined : json['greenScale'], + 'noDataColor': json['noDataColor'] == null ? undefined : json['noDataColor'], 'redBand': json['redBand'], 'redMax': json['redMax'], 'redMin': json['redMin'], - 'redScale': !(0, runtime_1.exists)(json, 'redScale') ? undefined : json['redScale'], + 'redScale': json['redScale'] == null ? undefined : json['redScale'], 'type': json['type'], }; } -exports.MultiBandRasterColorizerFromJSONTyped = MultiBandRasterColorizerFromJSONTyped; -function MultiBandRasterColorizerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MultiBandRasterColorizerToJSON(json) { + return MultiBandRasterColorizerToJSONTyped(json, false); +} +function MultiBandRasterColorizerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'blueBand': value.blueBand, - 'blueMax': value.blueMax, - 'blueMin': value.blueMin, - 'blueScale': value.blueScale, - 'greenBand': value.greenBand, - 'greenMax': value.greenMax, - 'greenMin': value.greenMin, - 'greenScale': value.greenScale, - 'noDataColor': value.noDataColor, - 'redBand': value.redBand, - 'redMax': value.redMax, - 'redMin': value.redMin, - 'redScale': value.redScale, - 'type': value.type, + 'blueBand': value['blueBand'], + 'blueMax': value['blueMax'], + 'blueMin': value['blueMin'], + 'blueScale': value['blueScale'], + 'greenBand': value['greenBand'], + 'greenMax': value['greenMax'], + 'greenMin': value['greenMin'], + 'greenScale': value['greenScale'], + 'noDataColor': value['noDataColor'], + 'redBand': value['redBand'], + 'redMax': value['redMax'], + 'redMin': value['redMin'], + 'redScale': value['redScale'], + 'type': value['type'], }; } -exports.MultiBandRasterColorizerToJSON = MultiBandRasterColorizerToJSON; diff --git a/typescript/dist/models/MultiLineString.d.ts b/typescript/dist/models/MultiLineString.d.ts index 337af6e5..f9f4be33 100644 --- a/typescript/dist/models/MultiLineString.d.ts +++ b/typescript/dist/models/MultiLineString.d.ts @@ -26,7 +26,8 @@ export interface MultiLineString { /** * Check if a given object implements the MultiLineString interface. */ -export declare function instanceOfMultiLineString(value: object): boolean; +export declare function instanceOfMultiLineString(value: object): value is MultiLineString; export declare function MultiLineStringFromJSON(json: any): MultiLineString; export declare function MultiLineStringFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiLineString; -export declare function MultiLineStringToJSON(value?: MultiLineString | null): any; +export declare function MultiLineStringToJSON(json: any): MultiLineString; +export declare function MultiLineStringToJSONTyped(value?: MultiLineString | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MultiLineString.js b/typescript/dist/models/MultiLineString.js index 502976e8..7ba1f6de 100644 --- a/typescript/dist/models/MultiLineString.js +++ b/typescript/dist/models/MultiLineString.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MultiLineStringToJSON = exports.MultiLineStringFromJSONTyped = exports.MultiLineStringFromJSON = exports.instanceOfMultiLineString = void 0; +exports.instanceOfMultiLineString = instanceOfMultiLineString; +exports.MultiLineStringFromJSON = MultiLineStringFromJSON; +exports.MultiLineStringFromJSONTyped = MultiLineStringFromJSONTyped; +exports.MultiLineStringToJSON = MultiLineStringToJSON; +exports.MultiLineStringToJSONTyped = MultiLineStringToJSONTyped; /** * Check if a given object implements the MultiLineString interface. */ function instanceOfMultiLineString(value) { - let isInstance = true; - isInstance = isInstance && "coordinates" in value; - return isInstance; + if (!('coordinates' in value) || value['coordinates'] === undefined) + return false; + return true; } -exports.instanceOfMultiLineString = instanceOfMultiLineString; function MultiLineStringFromJSON(json) { return MultiLineStringFromJSONTyped(json, false); } -exports.MultiLineStringFromJSON = MultiLineStringFromJSON; function MultiLineStringFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'coordinates': json['coordinates'], }; } -exports.MultiLineStringFromJSONTyped = MultiLineStringFromJSONTyped; -function MultiLineStringToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MultiLineStringToJSON(json) { + return MultiLineStringToJSONTyped(json, false); +} +function MultiLineStringToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'coordinates': value.coordinates, + 'coordinates': value['coordinates'], }; } -exports.MultiLineStringToJSON = MultiLineStringToJSON; diff --git a/typescript/dist/models/MultiPoint.d.ts b/typescript/dist/models/MultiPoint.d.ts index 80e81b17..28b2c040 100644 --- a/typescript/dist/models/MultiPoint.d.ts +++ b/typescript/dist/models/MultiPoint.d.ts @@ -26,7 +26,8 @@ export interface MultiPoint { /** * Check if a given object implements the MultiPoint interface. */ -export declare function instanceOfMultiPoint(value: object): boolean; +export declare function instanceOfMultiPoint(value: object): value is MultiPoint; export declare function MultiPointFromJSON(json: any): MultiPoint; export declare function MultiPointFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiPoint; -export declare function MultiPointToJSON(value?: MultiPoint | null): any; +export declare function MultiPointToJSON(json: any): MultiPoint; +export declare function MultiPointToJSONTyped(value?: MultiPoint | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MultiPoint.js b/typescript/dist/models/MultiPoint.js index dafa0100..ca1f1f37 100644 --- a/typescript/dist/models/MultiPoint.js +++ b/typescript/dist/models/MultiPoint.js @@ -13,39 +13,39 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MultiPointToJSON = exports.MultiPointFromJSONTyped = exports.MultiPointFromJSON = exports.instanceOfMultiPoint = void 0; +exports.instanceOfMultiPoint = instanceOfMultiPoint; +exports.MultiPointFromJSON = MultiPointFromJSON; +exports.MultiPointFromJSONTyped = MultiPointFromJSONTyped; +exports.MultiPointToJSON = MultiPointToJSON; +exports.MultiPointToJSONTyped = MultiPointToJSONTyped; const Coordinate2D_1 = require("./Coordinate2D"); /** * Check if a given object implements the MultiPoint interface. */ function instanceOfMultiPoint(value) { - let isInstance = true; - isInstance = isInstance && "coordinates" in value; - return isInstance; + if (!('coordinates' in value) || value['coordinates'] === undefined) + return false; + return true; } -exports.instanceOfMultiPoint = instanceOfMultiPoint; function MultiPointFromJSON(json) { return MultiPointFromJSONTyped(json, false); } -exports.MultiPointFromJSON = MultiPointFromJSON; function MultiPointFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'coordinates': (json['coordinates'].map(Coordinate2D_1.Coordinate2DFromJSON)), }; } -exports.MultiPointFromJSONTyped = MultiPointFromJSONTyped; -function MultiPointToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MultiPointToJSON(json) { + return MultiPointToJSONTyped(json, false); +} +function MultiPointToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'coordinates': (value.coordinates.map(Coordinate2D_1.Coordinate2DToJSON)), + 'coordinates': (value['coordinates'].map(Coordinate2D_1.Coordinate2DToJSON)), }; } -exports.MultiPointToJSON = MultiPointToJSON; diff --git a/typescript/dist/models/MultiPolygon.d.ts b/typescript/dist/models/MultiPolygon.d.ts index e6dbe06d..1055bc0b 100644 --- a/typescript/dist/models/MultiPolygon.d.ts +++ b/typescript/dist/models/MultiPolygon.d.ts @@ -26,7 +26,8 @@ export interface MultiPolygon { /** * Check if a given object implements the MultiPolygon interface. */ -export declare function instanceOfMultiPolygon(value: object): boolean; +export declare function instanceOfMultiPolygon(value: object): value is MultiPolygon; export declare function MultiPolygonFromJSON(json: any): MultiPolygon; export declare function MultiPolygonFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiPolygon; -export declare function MultiPolygonToJSON(value?: MultiPolygon | null): any; +export declare function MultiPolygonToJSON(json: any): MultiPolygon; +export declare function MultiPolygonToJSONTyped(value?: MultiPolygon | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/MultiPolygon.js b/typescript/dist/models/MultiPolygon.js index d22ac803..cbf9602b 100644 --- a/typescript/dist/models/MultiPolygon.js +++ b/typescript/dist/models/MultiPolygon.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.MultiPolygonToJSON = exports.MultiPolygonFromJSONTyped = exports.MultiPolygonFromJSON = exports.instanceOfMultiPolygon = void 0; +exports.instanceOfMultiPolygon = instanceOfMultiPolygon; +exports.MultiPolygonFromJSON = MultiPolygonFromJSON; +exports.MultiPolygonFromJSONTyped = MultiPolygonFromJSONTyped; +exports.MultiPolygonToJSON = MultiPolygonToJSON; +exports.MultiPolygonToJSONTyped = MultiPolygonToJSONTyped; /** * Check if a given object implements the MultiPolygon interface. */ function instanceOfMultiPolygon(value) { - let isInstance = true; - isInstance = isInstance && "polygons" in value; - return isInstance; + if (!('polygons' in value) || value['polygons'] === undefined) + return false; + return true; } -exports.instanceOfMultiPolygon = instanceOfMultiPolygon; function MultiPolygonFromJSON(json) { return MultiPolygonFromJSONTyped(json, false); } -exports.MultiPolygonFromJSON = MultiPolygonFromJSON; function MultiPolygonFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'polygons': json['polygons'], }; } -exports.MultiPolygonFromJSONTyped = MultiPolygonFromJSONTyped; -function MultiPolygonToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function MultiPolygonToJSON(json) { + return MultiPolygonToJSONTyped(json, false); +} +function MultiPolygonToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'polygons': value.polygons, + 'polygons': value['polygons'], }; } -exports.MultiPolygonToJSON = MultiPolygonToJSON; diff --git a/typescript/dist/models/NumberParam.d.ts b/typescript/dist/models/NumberParam.d.ts index 333d7c0c..b142db7b 100644 --- a/typescript/dist/models/NumberParam.d.ts +++ b/typescript/dist/models/NumberParam.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DerivedNumber } from './DerivedNumber'; -import { StaticNumberParam } from './StaticNumberParam'; +import type { DerivedNumber } from './DerivedNumber'; +import type { StaticNumberParam } from './StaticNumberParam'; /** * @type NumberParam * @@ -23,4 +23,5 @@ export type NumberParam = { } & StaticNumberParam; export declare function NumberParamFromJSON(json: any): NumberParam; export declare function NumberParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): NumberParam; -export declare function NumberParamToJSON(value?: NumberParam | null): any; +export declare function NumberParamToJSON(json: any): any; +export declare function NumberParamToJSONTyped(value?: NumberParam | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/NumberParam.js b/typescript/dist/models/NumberParam.js index 2acc3763..f6d21e90 100644 --- a/typescript/dist/models/NumberParam.js +++ b/typescript/dist/models/NumberParam.js @@ -13,41 +13,41 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.NumberParamToJSON = exports.NumberParamFromJSONTyped = exports.NumberParamFromJSON = void 0; +exports.NumberParamFromJSON = NumberParamFromJSON; +exports.NumberParamFromJSONTyped = NumberParamFromJSONTyped; +exports.NumberParamToJSON = NumberParamToJSON; +exports.NumberParamToJSONTyped = NumberParamToJSONTyped; const DerivedNumber_1 = require("./DerivedNumber"); const StaticNumberParam_1 = require("./StaticNumberParam"); function NumberParamFromJSON(json) { return NumberParamFromJSONTyped(json, false); } -exports.NumberParamFromJSON = NumberParamFromJSON; function NumberParamFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'derived': - return Object.assign(Object.assign({}, (0, DerivedNumber_1.DerivedNumberFromJSONTyped)(json, true)), { type: 'derived' }); + return Object.assign({}, (0, DerivedNumber_1.DerivedNumberFromJSONTyped)(json, true), { type: 'derived' }); case 'static': - return Object.assign(Object.assign({}, (0, StaticNumberParam_1.StaticNumberParamFromJSONTyped)(json, true)), { type: 'static' }); + return Object.assign({}, (0, StaticNumberParam_1.StaticNumberParamFromJSONTyped)(json, true), { type: 'static' }); default: throw new Error(`No variant of NumberParam exists with 'type=${json['type']}'`); } } -exports.NumberParamFromJSONTyped = NumberParamFromJSONTyped; -function NumberParamToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function NumberParamToJSON(json) { + return NumberParamToJSONTyped(json, false); +} +function NumberParamToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'derived': - return (0, DerivedNumber_1.DerivedNumberToJSON)(value); + return Object.assign({}, (0, DerivedNumber_1.DerivedNumberToJSON)(value), { type: 'derived' }); case 'static': - return (0, StaticNumberParam_1.StaticNumberParamToJSON)(value); + return Object.assign({}, (0, StaticNumberParam_1.StaticNumberParamToJSON)(value), { type: 'static' }); default: throw new Error(`No variant of NumberParam exists with 'type=${value['type']}'`); } } -exports.NumberParamToJSON = NumberParamToJSON; diff --git a/typescript/dist/models/OgrMetaData.d.ts b/typescript/dist/models/OgrMetaData.d.ts index c6059211..d1ac707b 100644 --- a/typescript/dist/models/OgrMetaData.d.ts +++ b/typescript/dist/models/OgrMetaData.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { OgrSourceDataset } from './OgrSourceDataset'; import type { VectorResultDescriptor } from './VectorResultDescriptor'; +import type { OgrSourceDataset } from './OgrSourceDataset'; /** * * @export @@ -46,7 +46,8 @@ export type OgrMetaDataTypeEnum = typeof OgrMetaDataTypeEnum[keyof typeof OgrMet /** * Check if a given object implements the OgrMetaData interface. */ -export declare function instanceOfOgrMetaData(value: object): boolean; +export declare function instanceOfOgrMetaData(value: object): value is OgrMetaData; export declare function OgrMetaDataFromJSON(json: any): OgrMetaData; export declare function OgrMetaDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrMetaData; -export declare function OgrMetaDataToJSON(value?: OgrMetaData | null): any; +export declare function OgrMetaDataToJSON(json: any): OgrMetaData; +export declare function OgrMetaDataToJSONTyped(value?: OgrMetaData | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrMetaData.js b/typescript/dist/models/OgrMetaData.js index 34b066d3..dfc9f208 100644 --- a/typescript/dist/models/OgrMetaData.js +++ b/typescript/dist/models/OgrMetaData.js @@ -13,9 +13,14 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrMetaDataToJSON = exports.OgrMetaDataFromJSONTyped = exports.OgrMetaDataFromJSON = exports.instanceOfOgrMetaData = exports.OgrMetaDataTypeEnum = void 0; -const OgrSourceDataset_1 = require("./OgrSourceDataset"); +exports.OgrMetaDataTypeEnum = void 0; +exports.instanceOfOgrMetaData = instanceOfOgrMetaData; +exports.OgrMetaDataFromJSON = OgrMetaDataFromJSON; +exports.OgrMetaDataFromJSONTyped = OgrMetaDataFromJSONTyped; +exports.OgrMetaDataToJSON = OgrMetaDataToJSON; +exports.OgrMetaDataToJSONTyped = OgrMetaDataToJSONTyped; const VectorResultDescriptor_1 = require("./VectorResultDescriptor"); +const OgrSourceDataset_1 = require("./OgrSourceDataset"); /** * @export */ @@ -26,19 +31,19 @@ exports.OgrMetaDataTypeEnum = { * Check if a given object implements the OgrMetaData interface. */ function instanceOfOgrMetaData(value) { - let isInstance = true; - isInstance = isInstance && "loadingInfo" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('loadingInfo' in value) || value['loadingInfo'] === undefined) + return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfOgrMetaData = instanceOfOgrMetaData; function OgrMetaDataFromJSON(json) { return OgrMetaDataFromJSONTyped(json, false); } -exports.OgrMetaDataFromJSON = OgrMetaDataFromJSON; function OgrMetaDataFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -47,18 +52,16 @@ function OgrMetaDataFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.OgrMetaDataFromJSONTyped = OgrMetaDataFromJSONTyped; -function OgrMetaDataToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrMetaDataToJSON(json) { + return OgrMetaDataToJSONTyped(json, false); +} +function OgrMetaDataToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'loadingInfo': (0, OgrSourceDataset_1.OgrSourceDatasetToJSON)(value.loadingInfo), - 'resultDescriptor': (0, VectorResultDescriptor_1.VectorResultDescriptorToJSON)(value.resultDescriptor), - 'type': value.type, + 'loadingInfo': (0, OgrSourceDataset_1.OgrSourceDatasetToJSON)(value['loadingInfo']), + 'resultDescriptor': (0, VectorResultDescriptor_1.VectorResultDescriptorToJSON)(value['resultDescriptor']), + 'type': value['type'], }; } -exports.OgrMetaDataToJSON = OgrMetaDataToJSON; diff --git a/typescript/dist/models/OgrSourceColumnSpec.d.ts b/typescript/dist/models/OgrSourceColumnSpec.d.ts index f7c7d44a..07ea4385 100644 --- a/typescript/dist/models/OgrSourceColumnSpec.d.ts +++ b/typescript/dist/models/OgrSourceColumnSpec.d.ts @@ -76,7 +76,8 @@ export interface OgrSourceColumnSpec { /** * Check if a given object implements the OgrSourceColumnSpec interface. */ -export declare function instanceOfOgrSourceColumnSpec(value: object): boolean; +export declare function instanceOfOgrSourceColumnSpec(value: object): value is OgrSourceColumnSpec; export declare function OgrSourceColumnSpecFromJSON(json: any): OgrSourceColumnSpec; export declare function OgrSourceColumnSpecFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceColumnSpec; -export declare function OgrSourceColumnSpecToJSON(value?: OgrSourceColumnSpec | null): any; +export declare function OgrSourceColumnSpecToJSON(json: any): OgrSourceColumnSpec; +export declare function OgrSourceColumnSpecToJSONTyped(value?: OgrSourceColumnSpec | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceColumnSpec.js b/typescript/dist/models/OgrSourceColumnSpec.js index 4656641b..7af43fa0 100644 --- a/typescript/dist/models/OgrSourceColumnSpec.js +++ b/typescript/dist/models/OgrSourceColumnSpec.js @@ -13,56 +13,55 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceColumnSpecToJSON = exports.OgrSourceColumnSpecFromJSONTyped = exports.OgrSourceColumnSpecFromJSON = exports.instanceOfOgrSourceColumnSpec = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfOgrSourceColumnSpec = instanceOfOgrSourceColumnSpec; +exports.OgrSourceColumnSpecFromJSON = OgrSourceColumnSpecFromJSON; +exports.OgrSourceColumnSpecFromJSONTyped = OgrSourceColumnSpecFromJSONTyped; +exports.OgrSourceColumnSpecToJSON = OgrSourceColumnSpecToJSON; +exports.OgrSourceColumnSpecToJSONTyped = OgrSourceColumnSpecToJSONTyped; const FormatSpecifics_1 = require("./FormatSpecifics"); /** * Check if a given object implements the OgrSourceColumnSpec interface. */ function instanceOfOgrSourceColumnSpec(value) { - let isInstance = true; - isInstance = isInstance && "x" in value; - return isInstance; + if (!('x' in value) || value['x'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceColumnSpec = instanceOfOgrSourceColumnSpec; function OgrSourceColumnSpecFromJSON(json) { return OgrSourceColumnSpecFromJSONTyped(json, false); } -exports.OgrSourceColumnSpecFromJSON = OgrSourceColumnSpecFromJSON; function OgrSourceColumnSpecFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bool': !(0, runtime_1.exists)(json, 'bool') ? undefined : json['bool'], - 'datetime': !(0, runtime_1.exists)(json, 'datetime') ? undefined : json['datetime'], - '_float': !(0, runtime_1.exists)(json, 'float') ? undefined : json['float'], - 'formatSpecifics': !(0, runtime_1.exists)(json, 'formatSpecifics') ? undefined : (0, FormatSpecifics_1.FormatSpecificsFromJSON)(json['formatSpecifics']), - '_int': !(0, runtime_1.exists)(json, 'int') ? undefined : json['int'], - 'rename': !(0, runtime_1.exists)(json, 'rename') ? undefined : json['rename'], - 'text': !(0, runtime_1.exists)(json, 'text') ? undefined : json['text'], + 'bool': json['bool'] == null ? undefined : json['bool'], + 'datetime': json['datetime'] == null ? undefined : json['datetime'], + '_float': json['float'] == null ? undefined : json['float'], + 'formatSpecifics': json['formatSpecifics'] == null ? undefined : (0, FormatSpecifics_1.FormatSpecificsFromJSON)(json['formatSpecifics']), + '_int': json['int'] == null ? undefined : json['int'], + 'rename': json['rename'] == null ? undefined : json['rename'], + 'text': json['text'] == null ? undefined : json['text'], 'x': json['x'], - 'y': !(0, runtime_1.exists)(json, 'y') ? undefined : json['y'], + 'y': json['y'] == null ? undefined : json['y'], }; } -exports.OgrSourceColumnSpecFromJSONTyped = OgrSourceColumnSpecFromJSONTyped; -function OgrSourceColumnSpecToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceColumnSpecToJSON(json) { + return OgrSourceColumnSpecToJSONTyped(json, false); +} +function OgrSourceColumnSpecToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bool': value.bool, - 'datetime': value.datetime, - 'float': value._float, - 'formatSpecifics': (0, FormatSpecifics_1.FormatSpecificsToJSON)(value.formatSpecifics), - 'int': value._int, - 'rename': value.rename, - 'text': value.text, - 'x': value.x, - 'y': value.y, + 'bool': value['bool'], + 'datetime': value['datetime'], + 'float': value['_float'], + 'formatSpecifics': (0, FormatSpecifics_1.FormatSpecificsToJSON)(value['formatSpecifics']), + 'int': value['_int'], + 'rename': value['rename'], + 'text': value['text'], + 'x': value['x'], + 'y': value['y'], }; } -exports.OgrSourceColumnSpecToJSON = OgrSourceColumnSpecToJSON; diff --git a/typescript/dist/models/OgrSourceDataset.d.ts b/typescript/dist/models/OgrSourceDataset.d.ts index 6e5b7de6..3575bd77 100644 --- a/typescript/dist/models/OgrSourceDataset.d.ts +++ b/typescript/dist/models/OgrSourceDataset.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { OgrSourceColumnSpec } from './OgrSourceColumnSpec'; -import type { OgrSourceDatasetTimeType } from './OgrSourceDatasetTimeType'; import type { OgrSourceErrorSpec } from './OgrSourceErrorSpec'; -import type { TypedGeometry } from './TypedGeometry'; import type { VectorDataType } from './VectorDataType'; +import type { TypedGeometry } from './TypedGeometry'; +import type { OgrSourceColumnSpec } from './OgrSourceColumnSpec'; +import type { OgrSourceDatasetTimeType } from './OgrSourceDatasetTimeType'; /** * * @export @@ -96,7 +96,8 @@ export interface OgrSourceDataset { /** * Check if a given object implements the OgrSourceDataset interface. */ -export declare function instanceOfOgrSourceDataset(value: object): boolean; +export declare function instanceOfOgrSourceDataset(value: object): value is OgrSourceDataset; export declare function OgrSourceDatasetFromJSON(json: any): OgrSourceDataset; export declare function OgrSourceDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDataset; -export declare function OgrSourceDatasetToJSON(value?: OgrSourceDataset | null): any; +export declare function OgrSourceDatasetToJSON(json: any): OgrSourceDataset; +export declare function OgrSourceDatasetToJSONTyped(value?: OgrSourceDataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceDataset.js b/typescript/dist/models/OgrSourceDataset.js index 48ce5e9e..8d14b0c1 100644 --- a/typescript/dist/models/OgrSourceDataset.js +++ b/typescript/dist/models/OgrSourceDataset.js @@ -13,68 +13,69 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceDatasetToJSON = exports.OgrSourceDatasetFromJSONTyped = exports.OgrSourceDatasetFromJSON = exports.instanceOfOgrSourceDataset = void 0; -const runtime_1 = require("../runtime"); -const OgrSourceColumnSpec_1 = require("./OgrSourceColumnSpec"); -const OgrSourceDatasetTimeType_1 = require("./OgrSourceDatasetTimeType"); +exports.instanceOfOgrSourceDataset = instanceOfOgrSourceDataset; +exports.OgrSourceDatasetFromJSON = OgrSourceDatasetFromJSON; +exports.OgrSourceDatasetFromJSONTyped = OgrSourceDatasetFromJSONTyped; +exports.OgrSourceDatasetToJSON = OgrSourceDatasetToJSON; +exports.OgrSourceDatasetToJSONTyped = OgrSourceDatasetToJSONTyped; const OgrSourceErrorSpec_1 = require("./OgrSourceErrorSpec"); -const TypedGeometry_1 = require("./TypedGeometry"); const VectorDataType_1 = require("./VectorDataType"); +const TypedGeometry_1 = require("./TypedGeometry"); +const OgrSourceColumnSpec_1 = require("./OgrSourceColumnSpec"); +const OgrSourceDatasetTimeType_1 = require("./OgrSourceDatasetTimeType"); /** * Check if a given object implements the OgrSourceDataset interface. */ function instanceOfOgrSourceDataset(value) { - let isInstance = true; - isInstance = isInstance && "fileName" in value; - isInstance = isInstance && "layerName" in value; - isInstance = isInstance && "onError" in value; - return isInstance; + if (!('fileName' in value) || value['fileName'] === undefined) + return false; + if (!('layerName' in value) || value['layerName'] === undefined) + return false; + if (!('onError' in value) || value['onError'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceDataset = instanceOfOgrSourceDataset; function OgrSourceDatasetFromJSON(json) { return OgrSourceDatasetFromJSONTyped(json, false); } -exports.OgrSourceDatasetFromJSON = OgrSourceDatasetFromJSON; function OgrSourceDatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'attributeQuery': !(0, runtime_1.exists)(json, 'attributeQuery') ? undefined : json['attributeQuery'], - 'cacheTtl': !(0, runtime_1.exists)(json, 'cacheTtl') ? undefined : json['cacheTtl'], - 'columns': !(0, runtime_1.exists)(json, 'columns') ? undefined : (0, OgrSourceColumnSpec_1.OgrSourceColumnSpecFromJSON)(json['columns']), - 'dataType': !(0, runtime_1.exists)(json, 'dataType') ? undefined : (0, VectorDataType_1.VectorDataTypeFromJSON)(json['dataType']), - 'defaultGeometry': !(0, runtime_1.exists)(json, 'defaultGeometry') ? undefined : (0, TypedGeometry_1.TypedGeometryFromJSON)(json['defaultGeometry']), + 'attributeQuery': json['attributeQuery'] == null ? undefined : json['attributeQuery'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], + 'columns': json['columns'] == null ? undefined : (0, OgrSourceColumnSpec_1.OgrSourceColumnSpecFromJSON)(json['columns']), + 'dataType': json['dataType'] == null ? undefined : (0, VectorDataType_1.VectorDataTypeFromJSON)(json['dataType']), + 'defaultGeometry': json['defaultGeometry'] == null ? undefined : (0, TypedGeometry_1.TypedGeometryFromJSON)(json['defaultGeometry']), 'fileName': json['fileName'], - 'forceOgrSpatialFilter': !(0, runtime_1.exists)(json, 'forceOgrSpatialFilter') ? undefined : json['forceOgrSpatialFilter'], - 'forceOgrTimeFilter': !(0, runtime_1.exists)(json, 'forceOgrTimeFilter') ? undefined : json['forceOgrTimeFilter'], + 'forceOgrSpatialFilter': json['forceOgrSpatialFilter'] == null ? undefined : json['forceOgrSpatialFilter'], + 'forceOgrTimeFilter': json['forceOgrTimeFilter'] == null ? undefined : json['forceOgrTimeFilter'], 'layerName': json['layerName'], 'onError': (0, OgrSourceErrorSpec_1.OgrSourceErrorSpecFromJSON)(json['onError']), - 'sqlQuery': !(0, runtime_1.exists)(json, 'sqlQuery') ? undefined : json['sqlQuery'], - 'time': !(0, runtime_1.exists)(json, 'time') ? undefined : (0, OgrSourceDatasetTimeType_1.OgrSourceDatasetTimeTypeFromJSON)(json['time']), + 'sqlQuery': json['sqlQuery'] == null ? undefined : json['sqlQuery'], + 'time': json['time'] == null ? undefined : (0, OgrSourceDatasetTimeType_1.OgrSourceDatasetTimeTypeFromJSON)(json['time']), }; } -exports.OgrSourceDatasetFromJSONTyped = OgrSourceDatasetFromJSONTyped; -function OgrSourceDatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceDatasetToJSON(json) { + return OgrSourceDatasetToJSONTyped(json, false); +} +function OgrSourceDatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'attributeQuery': value.attributeQuery, - 'cacheTtl': value.cacheTtl, - 'columns': (0, OgrSourceColumnSpec_1.OgrSourceColumnSpecToJSON)(value.columns), - 'dataType': (0, VectorDataType_1.VectorDataTypeToJSON)(value.dataType), - 'defaultGeometry': (0, TypedGeometry_1.TypedGeometryToJSON)(value.defaultGeometry), - 'fileName': value.fileName, - 'forceOgrSpatialFilter': value.forceOgrSpatialFilter, - 'forceOgrTimeFilter': value.forceOgrTimeFilter, - 'layerName': value.layerName, - 'onError': (0, OgrSourceErrorSpec_1.OgrSourceErrorSpecToJSON)(value.onError), - 'sqlQuery': value.sqlQuery, - 'time': (0, OgrSourceDatasetTimeType_1.OgrSourceDatasetTimeTypeToJSON)(value.time), + 'attributeQuery': value['attributeQuery'], + 'cacheTtl': value['cacheTtl'], + 'columns': (0, OgrSourceColumnSpec_1.OgrSourceColumnSpecToJSON)(value['columns']), + 'dataType': (0, VectorDataType_1.VectorDataTypeToJSON)(value['dataType']), + 'defaultGeometry': (0, TypedGeometry_1.TypedGeometryToJSON)(value['defaultGeometry']), + 'fileName': value['fileName'], + 'forceOgrSpatialFilter': value['forceOgrSpatialFilter'], + 'forceOgrTimeFilter': value['forceOgrTimeFilter'], + 'layerName': value['layerName'], + 'onError': (0, OgrSourceErrorSpec_1.OgrSourceErrorSpecToJSON)(value['onError']), + 'sqlQuery': value['sqlQuery'], + 'time': (0, OgrSourceDatasetTimeType_1.OgrSourceDatasetTimeTypeToJSON)(value['time']), }; } -exports.OgrSourceDatasetToJSON = OgrSourceDatasetToJSON; diff --git a/typescript/dist/models/OgrSourceDatasetTimeType.d.ts b/typescript/dist/models/OgrSourceDatasetTimeType.d.ts index 51015e5d..38c8ecda 100644 --- a/typescript/dist/models/OgrSourceDatasetTimeType.d.ts +++ b/typescript/dist/models/OgrSourceDatasetTimeType.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { OgrSourceDatasetTimeTypeNone } from './OgrSourceDatasetTimeTypeNone'; -import { OgrSourceDatasetTimeTypeStart } from './OgrSourceDatasetTimeTypeStart'; -import { OgrSourceDatasetTimeTypeStartDuration } from './OgrSourceDatasetTimeTypeStartDuration'; -import { OgrSourceDatasetTimeTypeStartEnd } from './OgrSourceDatasetTimeTypeStartEnd'; +import type { OgrSourceDatasetTimeTypeNone } from './OgrSourceDatasetTimeTypeNone'; +import type { OgrSourceDatasetTimeTypeStart } from './OgrSourceDatasetTimeTypeStart'; +import type { OgrSourceDatasetTimeTypeStartDuration } from './OgrSourceDatasetTimeTypeStartDuration'; +import type { OgrSourceDatasetTimeTypeStartEnd } from './OgrSourceDatasetTimeTypeStartEnd'; /** * @type OgrSourceDatasetTimeType * @@ -29,4 +29,5 @@ export type OgrSourceDatasetTimeType = { } & OgrSourceDatasetTimeTypeStartEnd; export declare function OgrSourceDatasetTimeTypeFromJSON(json: any): OgrSourceDatasetTimeType; export declare function OgrSourceDatasetTimeTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeType; -export declare function OgrSourceDatasetTimeTypeToJSON(value?: OgrSourceDatasetTimeType | null): any; +export declare function OgrSourceDatasetTimeTypeToJSON(json: any): any; +export declare function OgrSourceDatasetTimeTypeToJSONTyped(value?: OgrSourceDatasetTimeType | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceDatasetTimeType.js b/typescript/dist/models/OgrSourceDatasetTimeType.js index 79455e4a..93bfaa76 100644 --- a/typescript/dist/models/OgrSourceDatasetTimeType.js +++ b/typescript/dist/models/OgrSourceDatasetTimeType.js @@ -13,7 +13,10 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceDatasetTimeTypeToJSON = exports.OgrSourceDatasetTimeTypeFromJSONTyped = exports.OgrSourceDatasetTimeTypeFromJSON = void 0; +exports.OgrSourceDatasetTimeTypeFromJSON = OgrSourceDatasetTimeTypeFromJSON; +exports.OgrSourceDatasetTimeTypeFromJSONTyped = OgrSourceDatasetTimeTypeFromJSONTyped; +exports.OgrSourceDatasetTimeTypeToJSON = OgrSourceDatasetTimeTypeToJSON; +exports.OgrSourceDatasetTimeTypeToJSONTyped = OgrSourceDatasetTimeTypeToJSONTyped; const OgrSourceDatasetTimeTypeNone_1 = require("./OgrSourceDatasetTimeTypeNone"); const OgrSourceDatasetTimeTypeStart_1 = require("./OgrSourceDatasetTimeTypeStart"); const OgrSourceDatasetTimeTypeStartDuration_1 = require("./OgrSourceDatasetTimeTypeStartDuration"); @@ -21,43 +24,40 @@ const OgrSourceDatasetTimeTypeStartEnd_1 = require("./OgrSourceDatasetTimeTypeSt function OgrSourceDatasetTimeTypeFromJSON(json) { return OgrSourceDatasetTimeTypeFromJSONTyped(json, false); } -exports.OgrSourceDatasetTimeTypeFromJSON = OgrSourceDatasetTimeTypeFromJSON; function OgrSourceDatasetTimeTypeFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'none': - return Object.assign(Object.assign({}, (0, OgrSourceDatasetTimeTypeNone_1.OgrSourceDatasetTimeTypeNoneFromJSONTyped)(json, true)), { type: 'none' }); + return Object.assign({}, (0, OgrSourceDatasetTimeTypeNone_1.OgrSourceDatasetTimeTypeNoneFromJSONTyped)(json, true), { type: 'none' }); case 'start': - return Object.assign(Object.assign({}, (0, OgrSourceDatasetTimeTypeStart_1.OgrSourceDatasetTimeTypeStartFromJSONTyped)(json, true)), { type: 'start' }); + return Object.assign({}, (0, OgrSourceDatasetTimeTypeStart_1.OgrSourceDatasetTimeTypeStartFromJSONTyped)(json, true), { type: 'start' }); case 'start+duration': - return Object.assign(Object.assign({}, (0, OgrSourceDatasetTimeTypeStartDuration_1.OgrSourceDatasetTimeTypeStartDurationFromJSONTyped)(json, true)), { type: 'start+duration' }); + return Object.assign({}, (0, OgrSourceDatasetTimeTypeStartDuration_1.OgrSourceDatasetTimeTypeStartDurationFromJSONTyped)(json, true), { type: 'start+duration' }); case 'start+end': - return Object.assign(Object.assign({}, (0, OgrSourceDatasetTimeTypeStartEnd_1.OgrSourceDatasetTimeTypeStartEndFromJSONTyped)(json, true)), { type: 'start+end' }); + return Object.assign({}, (0, OgrSourceDatasetTimeTypeStartEnd_1.OgrSourceDatasetTimeTypeStartEndFromJSONTyped)(json, true), { type: 'start+end' }); default: throw new Error(`No variant of OgrSourceDatasetTimeType exists with 'type=${json['type']}'`); } } -exports.OgrSourceDatasetTimeTypeFromJSONTyped = OgrSourceDatasetTimeTypeFromJSONTyped; -function OgrSourceDatasetTimeTypeToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceDatasetTimeTypeToJSON(json) { + return OgrSourceDatasetTimeTypeToJSONTyped(json, false); +} +function OgrSourceDatasetTimeTypeToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'none': - return (0, OgrSourceDatasetTimeTypeNone_1.OgrSourceDatasetTimeTypeNoneToJSON)(value); + return Object.assign({}, (0, OgrSourceDatasetTimeTypeNone_1.OgrSourceDatasetTimeTypeNoneToJSON)(value), { type: 'none' }); case 'start': - return (0, OgrSourceDatasetTimeTypeStart_1.OgrSourceDatasetTimeTypeStartToJSON)(value); + return Object.assign({}, (0, OgrSourceDatasetTimeTypeStart_1.OgrSourceDatasetTimeTypeStartToJSON)(value), { type: 'start' }); case 'start+duration': - return (0, OgrSourceDatasetTimeTypeStartDuration_1.OgrSourceDatasetTimeTypeStartDurationToJSON)(value); + return Object.assign({}, (0, OgrSourceDatasetTimeTypeStartDuration_1.OgrSourceDatasetTimeTypeStartDurationToJSON)(value), { type: 'start+duration' }); case 'start+end': - return (0, OgrSourceDatasetTimeTypeStartEnd_1.OgrSourceDatasetTimeTypeStartEndToJSON)(value); + return Object.assign({}, (0, OgrSourceDatasetTimeTypeStartEnd_1.OgrSourceDatasetTimeTypeStartEndToJSON)(value), { type: 'start+end' }); default: throw new Error(`No variant of OgrSourceDatasetTimeType exists with 'type=${value['type']}'`); } } -exports.OgrSourceDatasetTimeTypeToJSON = OgrSourceDatasetTimeTypeToJSON; diff --git a/typescript/dist/models/OgrSourceDatasetTimeTypeNone.d.ts b/typescript/dist/models/OgrSourceDatasetTimeTypeNone.d.ts index 203a9b35..01edfb5a 100644 --- a/typescript/dist/models/OgrSourceDatasetTimeTypeNone.d.ts +++ b/typescript/dist/models/OgrSourceDatasetTimeTypeNone.d.ts @@ -27,15 +27,13 @@ export interface OgrSourceDatasetTimeTypeNone { */ export declare const OgrSourceDatasetTimeTypeNoneTypeEnum: { readonly None: "none"; - readonly Start: "start"; - readonly Startend: "start+end"; - readonly Startduration: "start+duration"; }; export type OgrSourceDatasetTimeTypeNoneTypeEnum = typeof OgrSourceDatasetTimeTypeNoneTypeEnum[keyof typeof OgrSourceDatasetTimeTypeNoneTypeEnum]; /** * Check if a given object implements the OgrSourceDatasetTimeTypeNone interface. */ -export declare function instanceOfOgrSourceDatasetTimeTypeNone(value: object): boolean; +export declare function instanceOfOgrSourceDatasetTimeTypeNone(value: object): value is OgrSourceDatasetTimeTypeNone; export declare function OgrSourceDatasetTimeTypeNoneFromJSON(json: any): OgrSourceDatasetTimeTypeNone; export declare function OgrSourceDatasetTimeTypeNoneFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeNone; -export declare function OgrSourceDatasetTimeTypeNoneToJSON(value?: OgrSourceDatasetTimeTypeNone | null): any; +export declare function OgrSourceDatasetTimeTypeNoneToJSON(json: any): OgrSourceDatasetTimeTypeNone; +export declare function OgrSourceDatasetTimeTypeNoneToJSONTyped(value?: OgrSourceDatasetTimeTypeNone | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceDatasetTimeTypeNone.js b/typescript/dist/models/OgrSourceDatasetTimeTypeNone.js index bb6a67aa..80589668 100644 --- a/typescript/dist/models/OgrSourceDatasetTimeTypeNone.js +++ b/typescript/dist/models/OgrSourceDatasetTimeTypeNone.js @@ -13,47 +13,45 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceDatasetTimeTypeNoneToJSON = exports.OgrSourceDatasetTimeTypeNoneFromJSONTyped = exports.OgrSourceDatasetTimeTypeNoneFromJSON = exports.instanceOfOgrSourceDatasetTimeTypeNone = exports.OgrSourceDatasetTimeTypeNoneTypeEnum = void 0; +exports.OgrSourceDatasetTimeTypeNoneTypeEnum = void 0; +exports.instanceOfOgrSourceDatasetTimeTypeNone = instanceOfOgrSourceDatasetTimeTypeNone; +exports.OgrSourceDatasetTimeTypeNoneFromJSON = OgrSourceDatasetTimeTypeNoneFromJSON; +exports.OgrSourceDatasetTimeTypeNoneFromJSONTyped = OgrSourceDatasetTimeTypeNoneFromJSONTyped; +exports.OgrSourceDatasetTimeTypeNoneToJSON = OgrSourceDatasetTimeTypeNoneToJSON; +exports.OgrSourceDatasetTimeTypeNoneToJSONTyped = OgrSourceDatasetTimeTypeNoneToJSONTyped; /** * @export */ exports.OgrSourceDatasetTimeTypeNoneTypeEnum = { - None: 'none', - Start: 'start', - Startend: 'start+end', - Startduration: 'start+duration' + None: 'none' }; /** * Check if a given object implements the OgrSourceDatasetTimeTypeNone interface. */ function instanceOfOgrSourceDatasetTimeTypeNone(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceDatasetTimeTypeNone = instanceOfOgrSourceDatasetTimeTypeNone; function OgrSourceDatasetTimeTypeNoneFromJSON(json) { return OgrSourceDatasetTimeTypeNoneFromJSONTyped(json, false); } -exports.OgrSourceDatasetTimeTypeNoneFromJSON = OgrSourceDatasetTimeTypeNoneFromJSON; function OgrSourceDatasetTimeTypeNoneFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'type': json['type'], }; } -exports.OgrSourceDatasetTimeTypeNoneFromJSONTyped = OgrSourceDatasetTimeTypeNoneFromJSONTyped; -function OgrSourceDatasetTimeTypeNoneToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceDatasetTimeTypeNoneToJSON(json) { + return OgrSourceDatasetTimeTypeNoneToJSONTyped(json, false); +} +function OgrSourceDatasetTimeTypeNoneToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'type': value.type, + 'type': value['type'], }; } -exports.OgrSourceDatasetTimeTypeNoneToJSON = OgrSourceDatasetTimeTypeNoneToJSON; diff --git a/typescript/dist/models/OgrSourceDatasetTimeTypeStart.d.ts b/typescript/dist/models/OgrSourceDatasetTimeTypeStart.d.ts index 531be6c5..c8129475 100644 --- a/typescript/dist/models/OgrSourceDatasetTimeTypeStart.d.ts +++ b/typescript/dist/models/OgrSourceDatasetTimeTypeStart.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { OgrSourceDurationSpec } from './OgrSourceDurationSpec'; import type { OgrSourceTimeFormat } from './OgrSourceTimeFormat'; +import type { OgrSourceDurationSpec } from './OgrSourceDurationSpec'; /** * * @export @@ -52,7 +52,8 @@ export type OgrSourceDatasetTimeTypeStartTypeEnum = typeof OgrSourceDatasetTimeT /** * Check if a given object implements the OgrSourceDatasetTimeTypeStart interface. */ -export declare function instanceOfOgrSourceDatasetTimeTypeStart(value: object): boolean; +export declare function instanceOfOgrSourceDatasetTimeTypeStart(value: object): value is OgrSourceDatasetTimeTypeStart; export declare function OgrSourceDatasetTimeTypeStartFromJSON(json: any): OgrSourceDatasetTimeTypeStart; export declare function OgrSourceDatasetTimeTypeStartFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeStart; -export declare function OgrSourceDatasetTimeTypeStartToJSON(value?: OgrSourceDatasetTimeTypeStart | null): any; +export declare function OgrSourceDatasetTimeTypeStartToJSON(json: any): OgrSourceDatasetTimeTypeStart; +export declare function OgrSourceDatasetTimeTypeStartToJSONTyped(value?: OgrSourceDatasetTimeTypeStart | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceDatasetTimeTypeStart.js b/typescript/dist/models/OgrSourceDatasetTimeTypeStart.js index 5c4f6c99..23a35bf2 100644 --- a/typescript/dist/models/OgrSourceDatasetTimeTypeStart.js +++ b/typescript/dist/models/OgrSourceDatasetTimeTypeStart.js @@ -13,9 +13,14 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceDatasetTimeTypeStartToJSON = exports.OgrSourceDatasetTimeTypeStartFromJSONTyped = exports.OgrSourceDatasetTimeTypeStartFromJSON = exports.instanceOfOgrSourceDatasetTimeTypeStart = exports.OgrSourceDatasetTimeTypeStartTypeEnum = void 0; -const OgrSourceDurationSpec_1 = require("./OgrSourceDurationSpec"); +exports.OgrSourceDatasetTimeTypeStartTypeEnum = void 0; +exports.instanceOfOgrSourceDatasetTimeTypeStart = instanceOfOgrSourceDatasetTimeTypeStart; +exports.OgrSourceDatasetTimeTypeStartFromJSON = OgrSourceDatasetTimeTypeStartFromJSON; +exports.OgrSourceDatasetTimeTypeStartFromJSONTyped = OgrSourceDatasetTimeTypeStartFromJSONTyped; +exports.OgrSourceDatasetTimeTypeStartToJSON = OgrSourceDatasetTimeTypeStartToJSON; +exports.OgrSourceDatasetTimeTypeStartToJSONTyped = OgrSourceDatasetTimeTypeStartToJSONTyped; const OgrSourceTimeFormat_1 = require("./OgrSourceTimeFormat"); +const OgrSourceDurationSpec_1 = require("./OgrSourceDurationSpec"); /** * @export */ @@ -26,20 +31,21 @@ exports.OgrSourceDatasetTimeTypeStartTypeEnum = { * Check if a given object implements the OgrSourceDatasetTimeTypeStart interface. */ function instanceOfOgrSourceDatasetTimeTypeStart(value) { - let isInstance = true; - isInstance = isInstance && "duration" in value; - isInstance = isInstance && "startField" in value; - isInstance = isInstance && "startFormat" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('duration' in value) || value['duration'] === undefined) + return false; + if (!('startField' in value) || value['startField'] === undefined) + return false; + if (!('startFormat' in value) || value['startFormat'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceDatasetTimeTypeStart = instanceOfOgrSourceDatasetTimeTypeStart; function OgrSourceDatasetTimeTypeStartFromJSON(json) { return OgrSourceDatasetTimeTypeStartFromJSONTyped(json, false); } -exports.OgrSourceDatasetTimeTypeStartFromJSON = OgrSourceDatasetTimeTypeStartFromJSON; function OgrSourceDatasetTimeTypeStartFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -49,19 +55,17 @@ function OgrSourceDatasetTimeTypeStartFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.OgrSourceDatasetTimeTypeStartFromJSONTyped = OgrSourceDatasetTimeTypeStartFromJSONTyped; -function OgrSourceDatasetTimeTypeStartToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceDatasetTimeTypeStartToJSON(json) { + return OgrSourceDatasetTimeTypeStartToJSONTyped(json, false); +} +function OgrSourceDatasetTimeTypeStartToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'duration': (0, OgrSourceDurationSpec_1.OgrSourceDurationSpecToJSON)(value.duration), - 'startField': value.startField, - 'startFormat': (0, OgrSourceTimeFormat_1.OgrSourceTimeFormatToJSON)(value.startFormat), - 'type': value.type, + 'duration': (0, OgrSourceDurationSpec_1.OgrSourceDurationSpecToJSON)(value['duration']), + 'startField': value['startField'], + 'startFormat': (0, OgrSourceTimeFormat_1.OgrSourceTimeFormatToJSON)(value['startFormat']), + 'type': value['type'], }; } -exports.OgrSourceDatasetTimeTypeStartToJSON = OgrSourceDatasetTimeTypeStartToJSON; diff --git a/typescript/dist/models/OgrSourceDatasetTimeTypeStartDuration.d.ts b/typescript/dist/models/OgrSourceDatasetTimeTypeStartDuration.d.ts index 82606c14..dbf2d217 100644 --- a/typescript/dist/models/OgrSourceDatasetTimeTypeStartDuration.d.ts +++ b/typescript/dist/models/OgrSourceDatasetTimeTypeStartDuration.d.ts @@ -51,7 +51,8 @@ export type OgrSourceDatasetTimeTypeStartDurationTypeEnum = typeof OgrSourceData /** * Check if a given object implements the OgrSourceDatasetTimeTypeStartDuration interface. */ -export declare function instanceOfOgrSourceDatasetTimeTypeStartDuration(value: object): boolean; +export declare function instanceOfOgrSourceDatasetTimeTypeStartDuration(value: object): value is OgrSourceDatasetTimeTypeStartDuration; export declare function OgrSourceDatasetTimeTypeStartDurationFromJSON(json: any): OgrSourceDatasetTimeTypeStartDuration; export declare function OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeStartDuration; -export declare function OgrSourceDatasetTimeTypeStartDurationToJSON(value?: OgrSourceDatasetTimeTypeStartDuration | null): any; +export declare function OgrSourceDatasetTimeTypeStartDurationToJSON(json: any): OgrSourceDatasetTimeTypeStartDuration; +export declare function OgrSourceDatasetTimeTypeStartDurationToJSONTyped(value?: OgrSourceDatasetTimeTypeStartDuration | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceDatasetTimeTypeStartDuration.js b/typescript/dist/models/OgrSourceDatasetTimeTypeStartDuration.js index 11e7eacf..fd101c9e 100644 --- a/typescript/dist/models/OgrSourceDatasetTimeTypeStartDuration.js +++ b/typescript/dist/models/OgrSourceDatasetTimeTypeStartDuration.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceDatasetTimeTypeStartDurationToJSON = exports.OgrSourceDatasetTimeTypeStartDurationFromJSONTyped = exports.OgrSourceDatasetTimeTypeStartDurationFromJSON = exports.instanceOfOgrSourceDatasetTimeTypeStartDuration = exports.OgrSourceDatasetTimeTypeStartDurationTypeEnum = void 0; +exports.OgrSourceDatasetTimeTypeStartDurationTypeEnum = void 0; +exports.instanceOfOgrSourceDatasetTimeTypeStartDuration = instanceOfOgrSourceDatasetTimeTypeStartDuration; +exports.OgrSourceDatasetTimeTypeStartDurationFromJSON = OgrSourceDatasetTimeTypeStartDurationFromJSON; +exports.OgrSourceDatasetTimeTypeStartDurationFromJSONTyped = OgrSourceDatasetTimeTypeStartDurationFromJSONTyped; +exports.OgrSourceDatasetTimeTypeStartDurationToJSON = OgrSourceDatasetTimeTypeStartDurationToJSON; +exports.OgrSourceDatasetTimeTypeStartDurationToJSONTyped = OgrSourceDatasetTimeTypeStartDurationToJSONTyped; const OgrSourceTimeFormat_1 = require("./OgrSourceTimeFormat"); /** * @export @@ -25,20 +30,21 @@ exports.OgrSourceDatasetTimeTypeStartDurationTypeEnum = { * Check if a given object implements the OgrSourceDatasetTimeTypeStartDuration interface. */ function instanceOfOgrSourceDatasetTimeTypeStartDuration(value) { - let isInstance = true; - isInstance = isInstance && "durationField" in value; - isInstance = isInstance && "startField" in value; - isInstance = isInstance && "startFormat" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('durationField' in value) || value['durationField'] === undefined) + return false; + if (!('startField' in value) || value['startField'] === undefined) + return false; + if (!('startFormat' in value) || value['startFormat'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceDatasetTimeTypeStartDuration = instanceOfOgrSourceDatasetTimeTypeStartDuration; function OgrSourceDatasetTimeTypeStartDurationFromJSON(json) { return OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json, false); } -exports.OgrSourceDatasetTimeTypeStartDurationFromJSON = OgrSourceDatasetTimeTypeStartDurationFromJSON; function OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -48,19 +54,17 @@ function OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json, ignoreDiscrimi 'type': json['type'], }; } -exports.OgrSourceDatasetTimeTypeStartDurationFromJSONTyped = OgrSourceDatasetTimeTypeStartDurationFromJSONTyped; -function OgrSourceDatasetTimeTypeStartDurationToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceDatasetTimeTypeStartDurationToJSON(json) { + return OgrSourceDatasetTimeTypeStartDurationToJSONTyped(json, false); +} +function OgrSourceDatasetTimeTypeStartDurationToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'durationField': value.durationField, - 'startField': value.startField, - 'startFormat': (0, OgrSourceTimeFormat_1.OgrSourceTimeFormatToJSON)(value.startFormat), - 'type': value.type, + 'durationField': value['durationField'], + 'startField': value['startField'], + 'startFormat': (0, OgrSourceTimeFormat_1.OgrSourceTimeFormatToJSON)(value['startFormat']), + 'type': value['type'], }; } -exports.OgrSourceDatasetTimeTypeStartDurationToJSON = OgrSourceDatasetTimeTypeStartDurationToJSON; diff --git a/typescript/dist/models/OgrSourceDatasetTimeTypeStartEnd.d.ts b/typescript/dist/models/OgrSourceDatasetTimeTypeStartEnd.d.ts index 8b43d91e..df756dfe 100644 --- a/typescript/dist/models/OgrSourceDatasetTimeTypeStartEnd.d.ts +++ b/typescript/dist/models/OgrSourceDatasetTimeTypeStartEnd.d.ts @@ -57,7 +57,8 @@ export type OgrSourceDatasetTimeTypeStartEndTypeEnum = typeof OgrSourceDatasetTi /** * Check if a given object implements the OgrSourceDatasetTimeTypeStartEnd interface. */ -export declare function instanceOfOgrSourceDatasetTimeTypeStartEnd(value: object): boolean; +export declare function instanceOfOgrSourceDatasetTimeTypeStartEnd(value: object): value is OgrSourceDatasetTimeTypeStartEnd; export declare function OgrSourceDatasetTimeTypeStartEndFromJSON(json: any): OgrSourceDatasetTimeTypeStartEnd; export declare function OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeStartEnd; -export declare function OgrSourceDatasetTimeTypeStartEndToJSON(value?: OgrSourceDatasetTimeTypeStartEnd | null): any; +export declare function OgrSourceDatasetTimeTypeStartEndToJSON(json: any): OgrSourceDatasetTimeTypeStartEnd; +export declare function OgrSourceDatasetTimeTypeStartEndToJSONTyped(value?: OgrSourceDatasetTimeTypeStartEnd | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceDatasetTimeTypeStartEnd.js b/typescript/dist/models/OgrSourceDatasetTimeTypeStartEnd.js index c8f8d64e..d507e910 100644 --- a/typescript/dist/models/OgrSourceDatasetTimeTypeStartEnd.js +++ b/typescript/dist/models/OgrSourceDatasetTimeTypeStartEnd.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceDatasetTimeTypeStartEndToJSON = exports.OgrSourceDatasetTimeTypeStartEndFromJSONTyped = exports.OgrSourceDatasetTimeTypeStartEndFromJSON = exports.instanceOfOgrSourceDatasetTimeTypeStartEnd = exports.OgrSourceDatasetTimeTypeStartEndTypeEnum = void 0; +exports.OgrSourceDatasetTimeTypeStartEndTypeEnum = void 0; +exports.instanceOfOgrSourceDatasetTimeTypeStartEnd = instanceOfOgrSourceDatasetTimeTypeStartEnd; +exports.OgrSourceDatasetTimeTypeStartEndFromJSON = OgrSourceDatasetTimeTypeStartEndFromJSON; +exports.OgrSourceDatasetTimeTypeStartEndFromJSONTyped = OgrSourceDatasetTimeTypeStartEndFromJSONTyped; +exports.OgrSourceDatasetTimeTypeStartEndToJSON = OgrSourceDatasetTimeTypeStartEndToJSON; +exports.OgrSourceDatasetTimeTypeStartEndToJSONTyped = OgrSourceDatasetTimeTypeStartEndToJSONTyped; const OgrSourceTimeFormat_1 = require("./OgrSourceTimeFormat"); /** * @export @@ -25,21 +30,23 @@ exports.OgrSourceDatasetTimeTypeStartEndTypeEnum = { * Check if a given object implements the OgrSourceDatasetTimeTypeStartEnd interface. */ function instanceOfOgrSourceDatasetTimeTypeStartEnd(value) { - let isInstance = true; - isInstance = isInstance && "endField" in value; - isInstance = isInstance && "endFormat" in value; - isInstance = isInstance && "startField" in value; - isInstance = isInstance && "startFormat" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('endField' in value) || value['endField'] === undefined) + return false; + if (!('endFormat' in value) || value['endFormat'] === undefined) + return false; + if (!('startField' in value) || value['startField'] === undefined) + return false; + if (!('startFormat' in value) || value['startFormat'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceDatasetTimeTypeStartEnd = instanceOfOgrSourceDatasetTimeTypeStartEnd; function OgrSourceDatasetTimeTypeStartEndFromJSON(json) { return OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json, false); } -exports.OgrSourceDatasetTimeTypeStartEndFromJSON = OgrSourceDatasetTimeTypeStartEndFromJSON; function OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -50,20 +57,18 @@ function OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json, ignoreDiscriminator 'type': json['type'], }; } -exports.OgrSourceDatasetTimeTypeStartEndFromJSONTyped = OgrSourceDatasetTimeTypeStartEndFromJSONTyped; -function OgrSourceDatasetTimeTypeStartEndToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceDatasetTimeTypeStartEndToJSON(json) { + return OgrSourceDatasetTimeTypeStartEndToJSONTyped(json, false); +} +function OgrSourceDatasetTimeTypeStartEndToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'endField': value.endField, - 'endFormat': (0, OgrSourceTimeFormat_1.OgrSourceTimeFormatToJSON)(value.endFormat), - 'startField': value.startField, - 'startFormat': (0, OgrSourceTimeFormat_1.OgrSourceTimeFormatToJSON)(value.startFormat), - 'type': value.type, + 'endField': value['endField'], + 'endFormat': (0, OgrSourceTimeFormat_1.OgrSourceTimeFormatToJSON)(value['endFormat']), + 'startField': value['startField'], + 'startFormat': (0, OgrSourceTimeFormat_1.OgrSourceTimeFormatToJSON)(value['startFormat']), + 'type': value['type'], }; } -exports.OgrSourceDatasetTimeTypeStartEndToJSON = OgrSourceDatasetTimeTypeStartEndToJSON; diff --git a/typescript/dist/models/OgrSourceDurationSpec.d.ts b/typescript/dist/models/OgrSourceDurationSpec.d.ts index b1f02113..94797f25 100644 --- a/typescript/dist/models/OgrSourceDurationSpec.d.ts +++ b/typescript/dist/models/OgrSourceDurationSpec.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { OgrSourceDurationSpecInfinite } from './OgrSourceDurationSpecInfinite'; -import { OgrSourceDurationSpecValue } from './OgrSourceDurationSpecValue'; -import { OgrSourceDurationSpecZero } from './OgrSourceDurationSpecZero'; +import type { OgrSourceDurationSpecInfinite } from './OgrSourceDurationSpecInfinite'; +import type { OgrSourceDurationSpecValue } from './OgrSourceDurationSpecValue'; +import type { OgrSourceDurationSpecZero } from './OgrSourceDurationSpecZero'; /** * @type OgrSourceDurationSpec * @@ -26,4 +26,5 @@ export type OgrSourceDurationSpec = { } & OgrSourceDurationSpecZero; export declare function OgrSourceDurationSpecFromJSON(json: any): OgrSourceDurationSpec; export declare function OgrSourceDurationSpecFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpec; -export declare function OgrSourceDurationSpecToJSON(value?: OgrSourceDurationSpec | null): any; +export declare function OgrSourceDurationSpecToJSON(json: any): any; +export declare function OgrSourceDurationSpecToJSONTyped(value?: OgrSourceDurationSpec | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceDurationSpec.js b/typescript/dist/models/OgrSourceDurationSpec.js index 2453ac6d..f71b682d 100644 --- a/typescript/dist/models/OgrSourceDurationSpec.js +++ b/typescript/dist/models/OgrSourceDurationSpec.js @@ -13,46 +13,46 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceDurationSpecToJSON = exports.OgrSourceDurationSpecFromJSONTyped = exports.OgrSourceDurationSpecFromJSON = void 0; +exports.OgrSourceDurationSpecFromJSON = OgrSourceDurationSpecFromJSON; +exports.OgrSourceDurationSpecFromJSONTyped = OgrSourceDurationSpecFromJSONTyped; +exports.OgrSourceDurationSpecToJSON = OgrSourceDurationSpecToJSON; +exports.OgrSourceDurationSpecToJSONTyped = OgrSourceDurationSpecToJSONTyped; const OgrSourceDurationSpecInfinite_1 = require("./OgrSourceDurationSpecInfinite"); const OgrSourceDurationSpecValue_1 = require("./OgrSourceDurationSpecValue"); const OgrSourceDurationSpecZero_1 = require("./OgrSourceDurationSpecZero"); function OgrSourceDurationSpecFromJSON(json) { return OgrSourceDurationSpecFromJSONTyped(json, false); } -exports.OgrSourceDurationSpecFromJSON = OgrSourceDurationSpecFromJSON; function OgrSourceDurationSpecFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'infinite': - return Object.assign(Object.assign({}, (0, OgrSourceDurationSpecInfinite_1.OgrSourceDurationSpecInfiniteFromJSONTyped)(json, true)), { type: 'infinite' }); + return Object.assign({}, (0, OgrSourceDurationSpecInfinite_1.OgrSourceDurationSpecInfiniteFromJSONTyped)(json, true), { type: 'infinite' }); case 'value': - return Object.assign(Object.assign({}, (0, OgrSourceDurationSpecValue_1.OgrSourceDurationSpecValueFromJSONTyped)(json, true)), { type: 'value' }); + return Object.assign({}, (0, OgrSourceDurationSpecValue_1.OgrSourceDurationSpecValueFromJSONTyped)(json, true), { type: 'value' }); case 'zero': - return Object.assign(Object.assign({}, (0, OgrSourceDurationSpecZero_1.OgrSourceDurationSpecZeroFromJSONTyped)(json, true)), { type: 'zero' }); + return Object.assign({}, (0, OgrSourceDurationSpecZero_1.OgrSourceDurationSpecZeroFromJSONTyped)(json, true), { type: 'zero' }); default: throw new Error(`No variant of OgrSourceDurationSpec exists with 'type=${json['type']}'`); } } -exports.OgrSourceDurationSpecFromJSONTyped = OgrSourceDurationSpecFromJSONTyped; -function OgrSourceDurationSpecToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceDurationSpecToJSON(json) { + return OgrSourceDurationSpecToJSONTyped(json, false); +} +function OgrSourceDurationSpecToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'infinite': - return (0, OgrSourceDurationSpecInfinite_1.OgrSourceDurationSpecInfiniteToJSON)(value); + return Object.assign({}, (0, OgrSourceDurationSpecInfinite_1.OgrSourceDurationSpecInfiniteToJSON)(value), { type: 'infinite' }); case 'value': - return (0, OgrSourceDurationSpecValue_1.OgrSourceDurationSpecValueToJSON)(value); + return Object.assign({}, (0, OgrSourceDurationSpecValue_1.OgrSourceDurationSpecValueToJSON)(value), { type: 'value' }); case 'zero': - return (0, OgrSourceDurationSpecZero_1.OgrSourceDurationSpecZeroToJSON)(value); + return Object.assign({}, (0, OgrSourceDurationSpecZero_1.OgrSourceDurationSpecZeroToJSON)(value), { type: 'zero' }); default: throw new Error(`No variant of OgrSourceDurationSpec exists with 'type=${value['type']}'`); } } -exports.OgrSourceDurationSpecToJSON = OgrSourceDurationSpecToJSON; diff --git a/typescript/dist/models/OgrSourceDurationSpecInfinite.d.ts b/typescript/dist/models/OgrSourceDurationSpecInfinite.d.ts index 016d6fdf..52c6c84a 100644 --- a/typescript/dist/models/OgrSourceDurationSpecInfinite.d.ts +++ b/typescript/dist/models/OgrSourceDurationSpecInfinite.d.ts @@ -27,14 +27,13 @@ export interface OgrSourceDurationSpecInfinite { */ export declare const OgrSourceDurationSpecInfiniteTypeEnum: { readonly Infinite: "infinite"; - readonly Zero: "zero"; - readonly Value: "value"; }; export type OgrSourceDurationSpecInfiniteTypeEnum = typeof OgrSourceDurationSpecInfiniteTypeEnum[keyof typeof OgrSourceDurationSpecInfiniteTypeEnum]; /** * Check if a given object implements the OgrSourceDurationSpecInfinite interface. */ -export declare function instanceOfOgrSourceDurationSpecInfinite(value: object): boolean; +export declare function instanceOfOgrSourceDurationSpecInfinite(value: object): value is OgrSourceDurationSpecInfinite; export declare function OgrSourceDurationSpecInfiniteFromJSON(json: any): OgrSourceDurationSpecInfinite; export declare function OgrSourceDurationSpecInfiniteFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpecInfinite; -export declare function OgrSourceDurationSpecInfiniteToJSON(value?: OgrSourceDurationSpecInfinite | null): any; +export declare function OgrSourceDurationSpecInfiniteToJSON(json: any): OgrSourceDurationSpecInfinite; +export declare function OgrSourceDurationSpecInfiniteToJSONTyped(value?: OgrSourceDurationSpecInfinite | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceDurationSpecInfinite.js b/typescript/dist/models/OgrSourceDurationSpecInfinite.js index 399d924c..bc2625c0 100644 --- a/typescript/dist/models/OgrSourceDurationSpecInfinite.js +++ b/typescript/dist/models/OgrSourceDurationSpecInfinite.js @@ -13,46 +13,45 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceDurationSpecInfiniteToJSON = exports.OgrSourceDurationSpecInfiniteFromJSONTyped = exports.OgrSourceDurationSpecInfiniteFromJSON = exports.instanceOfOgrSourceDurationSpecInfinite = exports.OgrSourceDurationSpecInfiniteTypeEnum = void 0; +exports.OgrSourceDurationSpecInfiniteTypeEnum = void 0; +exports.instanceOfOgrSourceDurationSpecInfinite = instanceOfOgrSourceDurationSpecInfinite; +exports.OgrSourceDurationSpecInfiniteFromJSON = OgrSourceDurationSpecInfiniteFromJSON; +exports.OgrSourceDurationSpecInfiniteFromJSONTyped = OgrSourceDurationSpecInfiniteFromJSONTyped; +exports.OgrSourceDurationSpecInfiniteToJSON = OgrSourceDurationSpecInfiniteToJSON; +exports.OgrSourceDurationSpecInfiniteToJSONTyped = OgrSourceDurationSpecInfiniteToJSONTyped; /** * @export */ exports.OgrSourceDurationSpecInfiniteTypeEnum = { - Infinite: 'infinite', - Zero: 'zero', - Value: 'value' + Infinite: 'infinite' }; /** * Check if a given object implements the OgrSourceDurationSpecInfinite interface. */ function instanceOfOgrSourceDurationSpecInfinite(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceDurationSpecInfinite = instanceOfOgrSourceDurationSpecInfinite; function OgrSourceDurationSpecInfiniteFromJSON(json) { return OgrSourceDurationSpecInfiniteFromJSONTyped(json, false); } -exports.OgrSourceDurationSpecInfiniteFromJSON = OgrSourceDurationSpecInfiniteFromJSON; function OgrSourceDurationSpecInfiniteFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'type': json['type'], }; } -exports.OgrSourceDurationSpecInfiniteFromJSONTyped = OgrSourceDurationSpecInfiniteFromJSONTyped; -function OgrSourceDurationSpecInfiniteToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceDurationSpecInfiniteToJSON(json) { + return OgrSourceDurationSpecInfiniteToJSONTyped(json, false); +} +function OgrSourceDurationSpecInfiniteToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'type': value.type, + 'type': value['type'], }; } -exports.OgrSourceDurationSpecInfiniteToJSON = OgrSourceDurationSpecInfiniteToJSON; diff --git a/typescript/dist/models/OgrSourceDurationSpecValue.d.ts b/typescript/dist/models/OgrSourceDurationSpecValue.d.ts index f3d08292..1eb1a2f0 100644 --- a/typescript/dist/models/OgrSourceDurationSpecValue.d.ts +++ b/typescript/dist/models/OgrSourceDurationSpecValue.d.ts @@ -45,7 +45,8 @@ export type OgrSourceDurationSpecValueTypeEnum = typeof OgrSourceDurationSpecVal /** * Check if a given object implements the OgrSourceDurationSpecValue interface. */ -export declare function instanceOfOgrSourceDurationSpecValue(value: object): boolean; +export declare function instanceOfOgrSourceDurationSpecValue(value: object): value is OgrSourceDurationSpecValue; export declare function OgrSourceDurationSpecValueFromJSON(json: any): OgrSourceDurationSpecValue; export declare function OgrSourceDurationSpecValueFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpecValue; -export declare function OgrSourceDurationSpecValueToJSON(value?: OgrSourceDurationSpecValue | null): any; +export declare function OgrSourceDurationSpecValueToJSON(json: any): OgrSourceDurationSpecValue; +export declare function OgrSourceDurationSpecValueToJSONTyped(value?: OgrSourceDurationSpecValue | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceDurationSpecValue.js b/typescript/dist/models/OgrSourceDurationSpecValue.js index 1236b788..251ce651 100644 --- a/typescript/dist/models/OgrSourceDurationSpecValue.js +++ b/typescript/dist/models/OgrSourceDurationSpecValue.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceDurationSpecValueToJSON = exports.OgrSourceDurationSpecValueFromJSONTyped = exports.OgrSourceDurationSpecValueFromJSON = exports.instanceOfOgrSourceDurationSpecValue = exports.OgrSourceDurationSpecValueTypeEnum = void 0; +exports.OgrSourceDurationSpecValueTypeEnum = void 0; +exports.instanceOfOgrSourceDurationSpecValue = instanceOfOgrSourceDurationSpecValue; +exports.OgrSourceDurationSpecValueFromJSON = OgrSourceDurationSpecValueFromJSON; +exports.OgrSourceDurationSpecValueFromJSONTyped = OgrSourceDurationSpecValueFromJSONTyped; +exports.OgrSourceDurationSpecValueToJSON = OgrSourceDurationSpecValueToJSON; +exports.OgrSourceDurationSpecValueToJSONTyped = OgrSourceDurationSpecValueToJSONTyped; const TimeGranularity_1 = require("./TimeGranularity"); /** * @export @@ -25,19 +30,19 @@ exports.OgrSourceDurationSpecValueTypeEnum = { * Check if a given object implements the OgrSourceDurationSpecValue interface. */ function instanceOfOgrSourceDurationSpecValue(value) { - let isInstance = true; - isInstance = isInstance && "granularity" in value; - isInstance = isInstance && "step" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('granularity' in value) || value['granularity'] === undefined) + return false; + if (!('step' in value) || value['step'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceDurationSpecValue = instanceOfOgrSourceDurationSpecValue; function OgrSourceDurationSpecValueFromJSON(json) { return OgrSourceDurationSpecValueFromJSONTyped(json, false); } -exports.OgrSourceDurationSpecValueFromJSON = OgrSourceDurationSpecValueFromJSON; function OgrSourceDurationSpecValueFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -46,18 +51,16 @@ function OgrSourceDurationSpecValueFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.OgrSourceDurationSpecValueFromJSONTyped = OgrSourceDurationSpecValueFromJSONTyped; -function OgrSourceDurationSpecValueToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceDurationSpecValueToJSON(json) { + return OgrSourceDurationSpecValueToJSONTyped(json, false); +} +function OgrSourceDurationSpecValueToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'granularity': (0, TimeGranularity_1.TimeGranularityToJSON)(value.granularity), - 'step': value.step, - 'type': value.type, + 'granularity': (0, TimeGranularity_1.TimeGranularityToJSON)(value['granularity']), + 'step': value['step'], + 'type': value['type'], }; } -exports.OgrSourceDurationSpecValueToJSON = OgrSourceDurationSpecValueToJSON; diff --git a/typescript/dist/models/OgrSourceDurationSpecZero.d.ts b/typescript/dist/models/OgrSourceDurationSpecZero.d.ts index 8ac91d5d..c528ed41 100644 --- a/typescript/dist/models/OgrSourceDurationSpecZero.d.ts +++ b/typescript/dist/models/OgrSourceDurationSpecZero.d.ts @@ -32,7 +32,8 @@ export type OgrSourceDurationSpecZeroTypeEnum = typeof OgrSourceDurationSpecZero /** * Check if a given object implements the OgrSourceDurationSpecZero interface. */ -export declare function instanceOfOgrSourceDurationSpecZero(value: object): boolean; +export declare function instanceOfOgrSourceDurationSpecZero(value: object): value is OgrSourceDurationSpecZero; export declare function OgrSourceDurationSpecZeroFromJSON(json: any): OgrSourceDurationSpecZero; export declare function OgrSourceDurationSpecZeroFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpecZero; -export declare function OgrSourceDurationSpecZeroToJSON(value?: OgrSourceDurationSpecZero | null): any; +export declare function OgrSourceDurationSpecZeroToJSON(json: any): OgrSourceDurationSpecZero; +export declare function OgrSourceDurationSpecZeroToJSONTyped(value?: OgrSourceDurationSpecZero | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceDurationSpecZero.js b/typescript/dist/models/OgrSourceDurationSpecZero.js index 5cda40fc..6b7f3473 100644 --- a/typescript/dist/models/OgrSourceDurationSpecZero.js +++ b/typescript/dist/models/OgrSourceDurationSpecZero.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceDurationSpecZeroToJSON = exports.OgrSourceDurationSpecZeroFromJSONTyped = exports.OgrSourceDurationSpecZeroFromJSON = exports.instanceOfOgrSourceDurationSpecZero = exports.OgrSourceDurationSpecZeroTypeEnum = void 0; +exports.OgrSourceDurationSpecZeroTypeEnum = void 0; +exports.instanceOfOgrSourceDurationSpecZero = instanceOfOgrSourceDurationSpecZero; +exports.OgrSourceDurationSpecZeroFromJSON = OgrSourceDurationSpecZeroFromJSON; +exports.OgrSourceDurationSpecZeroFromJSONTyped = OgrSourceDurationSpecZeroFromJSONTyped; +exports.OgrSourceDurationSpecZeroToJSON = OgrSourceDurationSpecZeroToJSON; +exports.OgrSourceDurationSpecZeroToJSONTyped = OgrSourceDurationSpecZeroToJSONTyped; /** * @export */ @@ -24,33 +29,29 @@ exports.OgrSourceDurationSpecZeroTypeEnum = { * Check if a given object implements the OgrSourceDurationSpecZero interface. */ function instanceOfOgrSourceDurationSpecZero(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceDurationSpecZero = instanceOfOgrSourceDurationSpecZero; function OgrSourceDurationSpecZeroFromJSON(json) { return OgrSourceDurationSpecZeroFromJSONTyped(json, false); } -exports.OgrSourceDurationSpecZeroFromJSON = OgrSourceDurationSpecZeroFromJSON; function OgrSourceDurationSpecZeroFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'type': json['type'], }; } -exports.OgrSourceDurationSpecZeroFromJSONTyped = OgrSourceDurationSpecZeroFromJSONTyped; -function OgrSourceDurationSpecZeroToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceDurationSpecZeroToJSON(json) { + return OgrSourceDurationSpecZeroToJSONTyped(json, false); +} +function OgrSourceDurationSpecZeroToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'type': value.type, + 'type': value['type'], }; } -exports.OgrSourceDurationSpecZeroToJSON = OgrSourceDurationSpecZeroToJSON; diff --git a/typescript/dist/models/OgrSourceErrorSpec.d.ts b/typescript/dist/models/OgrSourceErrorSpec.d.ts index 95c78fbc..29385775 100644 --- a/typescript/dist/models/OgrSourceErrorSpec.d.ts +++ b/typescript/dist/models/OgrSourceErrorSpec.d.ts @@ -18,6 +18,8 @@ export declare const OgrSourceErrorSpec: { readonly Abort: "abort"; }; export type OgrSourceErrorSpec = typeof OgrSourceErrorSpec[keyof typeof OgrSourceErrorSpec]; +export declare function instanceOfOgrSourceErrorSpec(value: any): boolean; export declare function OgrSourceErrorSpecFromJSON(json: any): OgrSourceErrorSpec; export declare function OgrSourceErrorSpecFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceErrorSpec; export declare function OgrSourceErrorSpecToJSON(value?: OgrSourceErrorSpec | null): any; +export declare function OgrSourceErrorSpecToJSONTyped(value: any, ignoreDiscriminator: boolean): OgrSourceErrorSpec; diff --git a/typescript/dist/models/OgrSourceErrorSpec.js b/typescript/dist/models/OgrSourceErrorSpec.js index 5ffdfcba..dad2c862 100644 --- a/typescript/dist/models/OgrSourceErrorSpec.js +++ b/typescript/dist/models/OgrSourceErrorSpec.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceErrorSpecToJSON = exports.OgrSourceErrorSpecFromJSONTyped = exports.OgrSourceErrorSpecFromJSON = exports.OgrSourceErrorSpec = void 0; +exports.OgrSourceErrorSpec = void 0; +exports.instanceOfOgrSourceErrorSpec = instanceOfOgrSourceErrorSpec; +exports.OgrSourceErrorSpecFromJSON = OgrSourceErrorSpecFromJSON; +exports.OgrSourceErrorSpecFromJSONTyped = OgrSourceErrorSpecFromJSONTyped; +exports.OgrSourceErrorSpecToJSON = OgrSourceErrorSpecToJSON; +exports.OgrSourceErrorSpecToJSONTyped = OgrSourceErrorSpecToJSONTyped; /** * * @export @@ -22,15 +27,25 @@ exports.OgrSourceErrorSpec = { Ignore: 'ignore', Abort: 'abort' }; +function instanceOfOgrSourceErrorSpec(value) { + for (const key in exports.OgrSourceErrorSpec) { + if (Object.prototype.hasOwnProperty.call(exports.OgrSourceErrorSpec, key)) { + if (exports.OgrSourceErrorSpec[key] === value) { + return true; + } + } + } + return false; +} function OgrSourceErrorSpecFromJSON(json) { return OgrSourceErrorSpecFromJSONTyped(json, false); } -exports.OgrSourceErrorSpecFromJSON = OgrSourceErrorSpecFromJSON; function OgrSourceErrorSpecFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.OgrSourceErrorSpecFromJSONTyped = OgrSourceErrorSpecFromJSONTyped; function OgrSourceErrorSpecToJSON(value) { return value; } -exports.OgrSourceErrorSpecToJSON = OgrSourceErrorSpecToJSON; +function OgrSourceErrorSpecToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/OgrSourceTimeFormat.d.ts b/typescript/dist/models/OgrSourceTimeFormat.d.ts index b56aa051..8f523183 100644 --- a/typescript/dist/models/OgrSourceTimeFormat.d.ts +++ b/typescript/dist/models/OgrSourceTimeFormat.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { OgrSourceTimeFormatAuto } from './OgrSourceTimeFormatAuto'; -import { OgrSourceTimeFormatCustom } from './OgrSourceTimeFormatCustom'; -import { OgrSourceTimeFormatUnixTimeStamp } from './OgrSourceTimeFormatUnixTimeStamp'; +import type { OgrSourceTimeFormatAuto } from './OgrSourceTimeFormatAuto'; +import type { OgrSourceTimeFormatCustom } from './OgrSourceTimeFormatCustom'; +import type { OgrSourceTimeFormatUnixTimeStamp } from './OgrSourceTimeFormatUnixTimeStamp'; /** * @type OgrSourceTimeFormat * @@ -26,4 +26,5 @@ export type OgrSourceTimeFormat = { } & OgrSourceTimeFormatUnixTimeStamp; export declare function OgrSourceTimeFormatFromJSON(json: any): OgrSourceTimeFormat; export declare function OgrSourceTimeFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormat; -export declare function OgrSourceTimeFormatToJSON(value?: OgrSourceTimeFormat | null): any; +export declare function OgrSourceTimeFormatToJSON(json: any): any; +export declare function OgrSourceTimeFormatToJSONTyped(value?: OgrSourceTimeFormat | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceTimeFormat.js b/typescript/dist/models/OgrSourceTimeFormat.js index c55a2baf..44600548 100644 --- a/typescript/dist/models/OgrSourceTimeFormat.js +++ b/typescript/dist/models/OgrSourceTimeFormat.js @@ -13,46 +13,46 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceTimeFormatToJSON = exports.OgrSourceTimeFormatFromJSONTyped = exports.OgrSourceTimeFormatFromJSON = void 0; +exports.OgrSourceTimeFormatFromJSON = OgrSourceTimeFormatFromJSON; +exports.OgrSourceTimeFormatFromJSONTyped = OgrSourceTimeFormatFromJSONTyped; +exports.OgrSourceTimeFormatToJSON = OgrSourceTimeFormatToJSON; +exports.OgrSourceTimeFormatToJSONTyped = OgrSourceTimeFormatToJSONTyped; const OgrSourceTimeFormatAuto_1 = require("./OgrSourceTimeFormatAuto"); const OgrSourceTimeFormatCustom_1 = require("./OgrSourceTimeFormatCustom"); const OgrSourceTimeFormatUnixTimeStamp_1 = require("./OgrSourceTimeFormatUnixTimeStamp"); function OgrSourceTimeFormatFromJSON(json) { return OgrSourceTimeFormatFromJSONTyped(json, false); } -exports.OgrSourceTimeFormatFromJSON = OgrSourceTimeFormatFromJSON; function OgrSourceTimeFormatFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['format']) { case 'auto': - return Object.assign(Object.assign({}, (0, OgrSourceTimeFormatAuto_1.OgrSourceTimeFormatAutoFromJSONTyped)(json, true)), { format: 'auto' }); + return Object.assign({}, (0, OgrSourceTimeFormatAuto_1.OgrSourceTimeFormatAutoFromJSONTyped)(json, true), { format: 'auto' }); case 'custom': - return Object.assign(Object.assign({}, (0, OgrSourceTimeFormatCustom_1.OgrSourceTimeFormatCustomFromJSONTyped)(json, true)), { format: 'custom' }); + return Object.assign({}, (0, OgrSourceTimeFormatCustom_1.OgrSourceTimeFormatCustomFromJSONTyped)(json, true), { format: 'custom' }); case 'unixTimeStamp': - return Object.assign(Object.assign({}, (0, OgrSourceTimeFormatUnixTimeStamp_1.OgrSourceTimeFormatUnixTimeStampFromJSONTyped)(json, true)), { format: 'unixTimeStamp' }); + return Object.assign({}, (0, OgrSourceTimeFormatUnixTimeStamp_1.OgrSourceTimeFormatUnixTimeStampFromJSONTyped)(json, true), { format: 'unixTimeStamp' }); default: throw new Error(`No variant of OgrSourceTimeFormat exists with 'format=${json['format']}'`); } } -exports.OgrSourceTimeFormatFromJSONTyped = OgrSourceTimeFormatFromJSONTyped; -function OgrSourceTimeFormatToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceTimeFormatToJSON(json) { + return OgrSourceTimeFormatToJSONTyped(json, false); +} +function OgrSourceTimeFormatToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['format']) { case 'auto': - return (0, OgrSourceTimeFormatAuto_1.OgrSourceTimeFormatAutoToJSON)(value); + return Object.assign({}, (0, OgrSourceTimeFormatAuto_1.OgrSourceTimeFormatAutoToJSON)(value), { format: 'auto' }); case 'custom': - return (0, OgrSourceTimeFormatCustom_1.OgrSourceTimeFormatCustomToJSON)(value); + return Object.assign({}, (0, OgrSourceTimeFormatCustom_1.OgrSourceTimeFormatCustomToJSON)(value), { format: 'custom' }); case 'unixTimeStamp': - return (0, OgrSourceTimeFormatUnixTimeStamp_1.OgrSourceTimeFormatUnixTimeStampToJSON)(value); + return Object.assign({}, (0, OgrSourceTimeFormatUnixTimeStamp_1.OgrSourceTimeFormatUnixTimeStampToJSON)(value), { format: 'unixTimeStamp' }); default: throw new Error(`No variant of OgrSourceTimeFormat exists with 'format=${value['format']}'`); } } -exports.OgrSourceTimeFormatToJSON = OgrSourceTimeFormatToJSON; diff --git a/typescript/dist/models/OgrSourceTimeFormatAuto.d.ts b/typescript/dist/models/OgrSourceTimeFormatAuto.d.ts index d2fd2ec4..960fb42b 100644 --- a/typescript/dist/models/OgrSourceTimeFormatAuto.d.ts +++ b/typescript/dist/models/OgrSourceTimeFormatAuto.d.ts @@ -32,7 +32,8 @@ export type OgrSourceTimeFormatAutoFormatEnum = typeof OgrSourceTimeFormatAutoFo /** * Check if a given object implements the OgrSourceTimeFormatAuto interface. */ -export declare function instanceOfOgrSourceTimeFormatAuto(value: object): boolean; +export declare function instanceOfOgrSourceTimeFormatAuto(value: object): value is OgrSourceTimeFormatAuto; export declare function OgrSourceTimeFormatAutoFromJSON(json: any): OgrSourceTimeFormatAuto; export declare function OgrSourceTimeFormatAutoFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormatAuto; -export declare function OgrSourceTimeFormatAutoToJSON(value?: OgrSourceTimeFormatAuto | null): any; +export declare function OgrSourceTimeFormatAutoToJSON(json: any): OgrSourceTimeFormatAuto; +export declare function OgrSourceTimeFormatAutoToJSONTyped(value?: OgrSourceTimeFormatAuto | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceTimeFormatAuto.js b/typescript/dist/models/OgrSourceTimeFormatAuto.js index baa8c3b7..ad16fe89 100644 --- a/typescript/dist/models/OgrSourceTimeFormatAuto.js +++ b/typescript/dist/models/OgrSourceTimeFormatAuto.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceTimeFormatAutoToJSON = exports.OgrSourceTimeFormatAutoFromJSONTyped = exports.OgrSourceTimeFormatAutoFromJSON = exports.instanceOfOgrSourceTimeFormatAuto = exports.OgrSourceTimeFormatAutoFormatEnum = void 0; +exports.OgrSourceTimeFormatAutoFormatEnum = void 0; +exports.instanceOfOgrSourceTimeFormatAuto = instanceOfOgrSourceTimeFormatAuto; +exports.OgrSourceTimeFormatAutoFromJSON = OgrSourceTimeFormatAutoFromJSON; +exports.OgrSourceTimeFormatAutoFromJSONTyped = OgrSourceTimeFormatAutoFromJSONTyped; +exports.OgrSourceTimeFormatAutoToJSON = OgrSourceTimeFormatAutoToJSON; +exports.OgrSourceTimeFormatAutoToJSONTyped = OgrSourceTimeFormatAutoToJSONTyped; /** * @export */ @@ -24,33 +29,29 @@ exports.OgrSourceTimeFormatAutoFormatEnum = { * Check if a given object implements the OgrSourceTimeFormatAuto interface. */ function instanceOfOgrSourceTimeFormatAuto(value) { - let isInstance = true; - isInstance = isInstance && "format" in value; - return isInstance; + if (!('format' in value) || value['format'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceTimeFormatAuto = instanceOfOgrSourceTimeFormatAuto; function OgrSourceTimeFormatAutoFromJSON(json) { return OgrSourceTimeFormatAutoFromJSONTyped(json, false); } -exports.OgrSourceTimeFormatAutoFromJSON = OgrSourceTimeFormatAutoFromJSON; function OgrSourceTimeFormatAutoFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'format': json['format'], }; } -exports.OgrSourceTimeFormatAutoFromJSONTyped = OgrSourceTimeFormatAutoFromJSONTyped; -function OgrSourceTimeFormatAutoToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceTimeFormatAutoToJSON(json) { + return OgrSourceTimeFormatAutoToJSONTyped(json, false); +} +function OgrSourceTimeFormatAutoToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'format': value.format, + 'format': value['format'], }; } -exports.OgrSourceTimeFormatAutoToJSON = OgrSourceTimeFormatAutoToJSON; diff --git a/typescript/dist/models/OgrSourceTimeFormatCustom.d.ts b/typescript/dist/models/OgrSourceTimeFormatCustom.d.ts index b71778da..7a998eae 100644 --- a/typescript/dist/models/OgrSourceTimeFormatCustom.d.ts +++ b/typescript/dist/models/OgrSourceTimeFormatCustom.d.ts @@ -38,7 +38,8 @@ export type OgrSourceTimeFormatCustomFormatEnum = typeof OgrSourceTimeFormatCust /** * Check if a given object implements the OgrSourceTimeFormatCustom interface. */ -export declare function instanceOfOgrSourceTimeFormatCustom(value: object): boolean; +export declare function instanceOfOgrSourceTimeFormatCustom(value: object): value is OgrSourceTimeFormatCustom; export declare function OgrSourceTimeFormatCustomFromJSON(json: any): OgrSourceTimeFormatCustom; export declare function OgrSourceTimeFormatCustomFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormatCustom; -export declare function OgrSourceTimeFormatCustomToJSON(value?: OgrSourceTimeFormatCustom | null): any; +export declare function OgrSourceTimeFormatCustomToJSON(json: any): OgrSourceTimeFormatCustom; +export declare function OgrSourceTimeFormatCustomToJSONTyped(value?: OgrSourceTimeFormatCustom | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceTimeFormatCustom.js b/typescript/dist/models/OgrSourceTimeFormatCustom.js index e31a22b3..4cc83247 100644 --- a/typescript/dist/models/OgrSourceTimeFormatCustom.js +++ b/typescript/dist/models/OgrSourceTimeFormatCustom.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceTimeFormatCustomToJSON = exports.OgrSourceTimeFormatCustomFromJSONTyped = exports.OgrSourceTimeFormatCustomFromJSON = exports.instanceOfOgrSourceTimeFormatCustom = exports.OgrSourceTimeFormatCustomFormatEnum = void 0; +exports.OgrSourceTimeFormatCustomFormatEnum = void 0; +exports.instanceOfOgrSourceTimeFormatCustom = instanceOfOgrSourceTimeFormatCustom; +exports.OgrSourceTimeFormatCustomFromJSON = OgrSourceTimeFormatCustomFromJSON; +exports.OgrSourceTimeFormatCustomFromJSONTyped = OgrSourceTimeFormatCustomFromJSONTyped; +exports.OgrSourceTimeFormatCustomToJSON = OgrSourceTimeFormatCustomToJSON; +exports.OgrSourceTimeFormatCustomToJSONTyped = OgrSourceTimeFormatCustomToJSONTyped; /** * @export */ @@ -24,18 +29,17 @@ exports.OgrSourceTimeFormatCustomFormatEnum = { * Check if a given object implements the OgrSourceTimeFormatCustom interface. */ function instanceOfOgrSourceTimeFormatCustom(value) { - let isInstance = true; - isInstance = isInstance && "customFormat" in value; - isInstance = isInstance && "format" in value; - return isInstance; + if (!('customFormat' in value) || value['customFormat'] === undefined) + return false; + if (!('format' in value) || value['format'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceTimeFormatCustom = instanceOfOgrSourceTimeFormatCustom; function OgrSourceTimeFormatCustomFromJSON(json) { return OgrSourceTimeFormatCustomFromJSONTyped(json, false); } -exports.OgrSourceTimeFormatCustomFromJSON = OgrSourceTimeFormatCustomFromJSON; function OgrSourceTimeFormatCustomFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +47,15 @@ function OgrSourceTimeFormatCustomFromJSONTyped(json, ignoreDiscriminator) { 'format': json['format'], }; } -exports.OgrSourceTimeFormatCustomFromJSONTyped = OgrSourceTimeFormatCustomFromJSONTyped; -function OgrSourceTimeFormatCustomToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceTimeFormatCustomToJSON(json) { + return OgrSourceTimeFormatCustomToJSONTyped(json, false); +} +function OgrSourceTimeFormatCustomToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'customFormat': value.customFormat, - 'format': value.format, + 'customFormat': value['customFormat'], + 'format': value['format'], }; } -exports.OgrSourceTimeFormatCustomToJSON = OgrSourceTimeFormatCustomToJSON; diff --git a/typescript/dist/models/OgrSourceTimeFormatUnixTimeStamp.d.ts b/typescript/dist/models/OgrSourceTimeFormatUnixTimeStamp.d.ts index 74dea859..a59381be 100644 --- a/typescript/dist/models/OgrSourceTimeFormatUnixTimeStamp.d.ts +++ b/typescript/dist/models/OgrSourceTimeFormatUnixTimeStamp.d.ts @@ -39,7 +39,8 @@ export type OgrSourceTimeFormatUnixTimeStampFormatEnum = typeof OgrSourceTimeFor /** * Check if a given object implements the OgrSourceTimeFormatUnixTimeStamp interface. */ -export declare function instanceOfOgrSourceTimeFormatUnixTimeStamp(value: object): boolean; +export declare function instanceOfOgrSourceTimeFormatUnixTimeStamp(value: object): value is OgrSourceTimeFormatUnixTimeStamp; export declare function OgrSourceTimeFormatUnixTimeStampFromJSON(json: any): OgrSourceTimeFormatUnixTimeStamp; export declare function OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormatUnixTimeStamp; -export declare function OgrSourceTimeFormatUnixTimeStampToJSON(value?: OgrSourceTimeFormatUnixTimeStamp | null): any; +export declare function OgrSourceTimeFormatUnixTimeStampToJSON(json: any): OgrSourceTimeFormatUnixTimeStamp; +export declare function OgrSourceTimeFormatUnixTimeStampToJSONTyped(value?: OgrSourceTimeFormatUnixTimeStamp | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OgrSourceTimeFormatUnixTimeStamp.js b/typescript/dist/models/OgrSourceTimeFormatUnixTimeStamp.js index 2b7e4a75..dbc3d0d0 100644 --- a/typescript/dist/models/OgrSourceTimeFormatUnixTimeStamp.js +++ b/typescript/dist/models/OgrSourceTimeFormatUnixTimeStamp.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OgrSourceTimeFormatUnixTimeStampToJSON = exports.OgrSourceTimeFormatUnixTimeStampFromJSONTyped = exports.OgrSourceTimeFormatUnixTimeStampFromJSON = exports.instanceOfOgrSourceTimeFormatUnixTimeStamp = exports.OgrSourceTimeFormatUnixTimeStampFormatEnum = void 0; +exports.OgrSourceTimeFormatUnixTimeStampFormatEnum = void 0; +exports.instanceOfOgrSourceTimeFormatUnixTimeStamp = instanceOfOgrSourceTimeFormatUnixTimeStamp; +exports.OgrSourceTimeFormatUnixTimeStampFromJSON = OgrSourceTimeFormatUnixTimeStampFromJSON; +exports.OgrSourceTimeFormatUnixTimeStampFromJSONTyped = OgrSourceTimeFormatUnixTimeStampFromJSONTyped; +exports.OgrSourceTimeFormatUnixTimeStampToJSON = OgrSourceTimeFormatUnixTimeStampToJSON; +exports.OgrSourceTimeFormatUnixTimeStampToJSONTyped = OgrSourceTimeFormatUnixTimeStampToJSONTyped; const UnixTimeStampType_1 = require("./UnixTimeStampType"); /** * @export @@ -25,18 +30,17 @@ exports.OgrSourceTimeFormatUnixTimeStampFormatEnum = { * Check if a given object implements the OgrSourceTimeFormatUnixTimeStamp interface. */ function instanceOfOgrSourceTimeFormatUnixTimeStamp(value) { - let isInstance = true; - isInstance = isInstance && "format" in value; - isInstance = isInstance && "timestampType" in value; - return isInstance; + if (!('format' in value) || value['format'] === undefined) + return false; + if (!('timestampType' in value) || value['timestampType'] === undefined) + return false; + return true; } -exports.instanceOfOgrSourceTimeFormatUnixTimeStamp = instanceOfOgrSourceTimeFormatUnixTimeStamp; function OgrSourceTimeFormatUnixTimeStampFromJSON(json) { return OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json, false); } -exports.OgrSourceTimeFormatUnixTimeStampFromJSON = OgrSourceTimeFormatUnixTimeStampFromJSON; function OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -44,17 +48,15 @@ function OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json, ignoreDiscriminator 'timestampType': (0, UnixTimeStampType_1.UnixTimeStampTypeFromJSON)(json['timestampType']), }; } -exports.OgrSourceTimeFormatUnixTimeStampFromJSONTyped = OgrSourceTimeFormatUnixTimeStampFromJSONTyped; -function OgrSourceTimeFormatUnixTimeStampToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OgrSourceTimeFormatUnixTimeStampToJSON(json) { + return OgrSourceTimeFormatUnixTimeStampToJSONTyped(json, false); +} +function OgrSourceTimeFormatUnixTimeStampToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'format': value.format, - 'timestampType': (0, UnixTimeStampType_1.UnixTimeStampTypeToJSON)(value.timestampType), + 'format': value['format'], + 'timestampType': (0, UnixTimeStampType_1.UnixTimeStampTypeToJSON)(value['timestampType']), }; } -exports.OgrSourceTimeFormatUnixTimeStampToJSON = OgrSourceTimeFormatUnixTimeStampToJSON; diff --git a/typescript/dist/models/OperatorQuota.d.ts b/typescript/dist/models/OperatorQuota.d.ts index d49b4a83..6a0db713 100644 --- a/typescript/dist/models/OperatorQuota.d.ts +++ b/typescript/dist/models/OperatorQuota.d.ts @@ -37,7 +37,8 @@ export interface OperatorQuota { /** * Check if a given object implements the OperatorQuota interface. */ -export declare function instanceOfOperatorQuota(value: object): boolean; +export declare function instanceOfOperatorQuota(value: object): value is OperatorQuota; export declare function OperatorQuotaFromJSON(json: any): OperatorQuota; export declare function OperatorQuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): OperatorQuota; -export declare function OperatorQuotaToJSON(value?: OperatorQuota | null): any; +export declare function OperatorQuotaToJSON(json: any): OperatorQuota; +export declare function OperatorQuotaToJSONTyped(value?: OperatorQuota | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/OperatorQuota.js b/typescript/dist/models/OperatorQuota.js index db2f7c9c..4176e2cf 100644 --- a/typescript/dist/models/OperatorQuota.js +++ b/typescript/dist/models/OperatorQuota.js @@ -13,24 +13,28 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OperatorQuotaToJSON = exports.OperatorQuotaFromJSONTyped = exports.OperatorQuotaFromJSON = exports.instanceOfOperatorQuota = void 0; +exports.instanceOfOperatorQuota = instanceOfOperatorQuota; +exports.OperatorQuotaFromJSON = OperatorQuotaFromJSON; +exports.OperatorQuotaFromJSONTyped = OperatorQuotaFromJSONTyped; +exports.OperatorQuotaToJSON = OperatorQuotaToJSON; +exports.OperatorQuotaToJSONTyped = OperatorQuotaToJSONTyped; /** * Check if a given object implements the OperatorQuota interface. */ function instanceOfOperatorQuota(value) { - let isInstance = true; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "operatorName" in value; - isInstance = isInstance && "operatorPath" in value; - return isInstance; + if (!('count' in value) || value['count'] === undefined) + return false; + if (!('operatorName' in value) || value['operatorName'] === undefined) + return false; + if (!('operatorPath' in value) || value['operatorPath'] === undefined) + return false; + return true; } -exports.instanceOfOperatorQuota = instanceOfOperatorQuota; function OperatorQuotaFromJSON(json) { return OperatorQuotaFromJSONTyped(json, false); } -exports.OperatorQuotaFromJSON = OperatorQuotaFromJSON; function OperatorQuotaFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,18 +43,16 @@ function OperatorQuotaFromJSONTyped(json, ignoreDiscriminator) { 'operatorPath': json['operatorPath'], }; } -exports.OperatorQuotaFromJSONTyped = OperatorQuotaFromJSONTyped; -function OperatorQuotaToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function OperatorQuotaToJSON(json) { + return OperatorQuotaToJSONTyped(json, false); +} +function OperatorQuotaToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'count': value.count, - 'operatorName': value.operatorName, - 'operatorPath': value.operatorPath, + 'count': value['count'], + 'operatorName': value['operatorName'], + 'operatorPath': value['operatorPath'], }; } -exports.OperatorQuotaToJSON = OperatorQuotaToJSON; diff --git a/typescript/dist/models/OrderBy.d.ts b/typescript/dist/models/OrderBy.d.ts index a7c3f0d8..f3f96c16 100644 --- a/typescript/dist/models/OrderBy.d.ts +++ b/typescript/dist/models/OrderBy.d.ts @@ -18,6 +18,8 @@ export declare const OrderBy: { readonly NameDesc: "NameDesc"; }; export type OrderBy = typeof OrderBy[keyof typeof OrderBy]; +export declare function instanceOfOrderBy(value: any): boolean; export declare function OrderByFromJSON(json: any): OrderBy; export declare function OrderByFromJSONTyped(json: any, ignoreDiscriminator: boolean): OrderBy; export declare function OrderByToJSON(value?: OrderBy | null): any; +export declare function OrderByToJSONTyped(value: any, ignoreDiscriminator: boolean): OrderBy; diff --git a/typescript/dist/models/OrderBy.js b/typescript/dist/models/OrderBy.js index df1c08d9..f9021352 100644 --- a/typescript/dist/models/OrderBy.js +++ b/typescript/dist/models/OrderBy.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.OrderByToJSON = exports.OrderByFromJSONTyped = exports.OrderByFromJSON = exports.OrderBy = void 0; +exports.OrderBy = void 0; +exports.instanceOfOrderBy = instanceOfOrderBy; +exports.OrderByFromJSON = OrderByFromJSON; +exports.OrderByFromJSONTyped = OrderByFromJSONTyped; +exports.OrderByToJSON = OrderByToJSON; +exports.OrderByToJSONTyped = OrderByToJSONTyped; /** * * @export @@ -22,15 +27,25 @@ exports.OrderBy = { NameAsc: 'NameAsc', NameDesc: 'NameDesc' }; +function instanceOfOrderBy(value) { + for (const key in exports.OrderBy) { + if (Object.prototype.hasOwnProperty.call(exports.OrderBy, key)) { + if (exports.OrderBy[key] === value) { + return true; + } + } + } + return false; +} function OrderByFromJSON(json) { return OrderByFromJSONTyped(json, false); } -exports.OrderByFromJSON = OrderByFromJSON; function OrderByFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.OrderByFromJSONTyped = OrderByFromJSONTyped; function OrderByToJSON(value) { return value; } -exports.OrderByToJSON = OrderByToJSON; +function OrderByToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/PaletteColorizer.d.ts b/typescript/dist/models/PaletteColorizer.d.ts index 5bb17d4f..97b0aa94 100644 --- a/typescript/dist/models/PaletteColorizer.d.ts +++ b/typescript/dist/models/PaletteColorizer.d.ts @@ -54,7 +54,8 @@ export type PaletteColorizerTypeEnum = typeof PaletteColorizerTypeEnum[keyof typ /** * Check if a given object implements the PaletteColorizer interface. */ -export declare function instanceOfPaletteColorizer(value: object): boolean; +export declare function instanceOfPaletteColorizer(value: object): value is PaletteColorizer; export declare function PaletteColorizerFromJSON(json: any): PaletteColorizer; export declare function PaletteColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaletteColorizer; -export declare function PaletteColorizerToJSON(value?: PaletteColorizer | null): any; +export declare function PaletteColorizerToJSON(json: any): PaletteColorizer; +export declare function PaletteColorizerToJSONTyped(value?: PaletteColorizer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/PaletteColorizer.js b/typescript/dist/models/PaletteColorizer.js index cb86c03b..d3f6db94 100644 --- a/typescript/dist/models/PaletteColorizer.js +++ b/typescript/dist/models/PaletteColorizer.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PaletteColorizerToJSON = exports.PaletteColorizerFromJSONTyped = exports.PaletteColorizerFromJSON = exports.instanceOfPaletteColorizer = exports.PaletteColorizerTypeEnum = void 0; +exports.PaletteColorizerTypeEnum = void 0; +exports.instanceOfPaletteColorizer = instanceOfPaletteColorizer; +exports.PaletteColorizerFromJSON = PaletteColorizerFromJSON; +exports.PaletteColorizerFromJSONTyped = PaletteColorizerFromJSONTyped; +exports.PaletteColorizerToJSON = PaletteColorizerToJSON; +exports.PaletteColorizerToJSONTyped = PaletteColorizerToJSONTyped; /** * @export */ @@ -24,20 +29,21 @@ exports.PaletteColorizerTypeEnum = { * Check if a given object implements the PaletteColorizer interface. */ function instanceOfPaletteColorizer(value) { - let isInstance = true; - isInstance = isInstance && "colors" in value; - isInstance = isInstance && "defaultColor" in value; - isInstance = isInstance && "noDataColor" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('colors' in value) || value['colors'] === undefined) + return false; + if (!('defaultColor' in value) || value['defaultColor'] === undefined) + return false; + if (!('noDataColor' in value) || value['noDataColor'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfPaletteColorizer = instanceOfPaletteColorizer; function PaletteColorizerFromJSON(json) { return PaletteColorizerFromJSONTyped(json, false); } -exports.PaletteColorizerFromJSON = PaletteColorizerFromJSON; function PaletteColorizerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -47,19 +53,17 @@ function PaletteColorizerFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.PaletteColorizerFromJSONTyped = PaletteColorizerFromJSONTyped; -function PaletteColorizerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function PaletteColorizerToJSON(json) { + return PaletteColorizerToJSONTyped(json, false); +} +function PaletteColorizerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'colors': value.colors, - 'defaultColor': value.defaultColor, - 'noDataColor': value.noDataColor, - 'type': value.type, + 'colors': value['colors'], + 'defaultColor': value['defaultColor'], + 'noDataColor': value['noDataColor'], + 'type': value['type'], }; } -exports.PaletteColorizerToJSON = PaletteColorizerToJSON; diff --git a/typescript/dist/models/Permission.d.ts b/typescript/dist/models/Permission.d.ts index 536e9c9b..8340d063 100644 --- a/typescript/dist/models/Permission.d.ts +++ b/typescript/dist/models/Permission.d.ts @@ -18,6 +18,8 @@ export declare const Permission: { readonly Owner: "Owner"; }; export type Permission = typeof Permission[keyof typeof Permission]; +export declare function instanceOfPermission(value: any): boolean; export declare function PermissionFromJSON(json: any): Permission; export declare function PermissionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Permission; export declare function PermissionToJSON(value?: Permission | null): any; +export declare function PermissionToJSONTyped(value: any, ignoreDiscriminator: boolean): Permission; diff --git a/typescript/dist/models/Permission.js b/typescript/dist/models/Permission.js index 02e0fdfc..4f13404f 100644 --- a/typescript/dist/models/Permission.js +++ b/typescript/dist/models/Permission.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PermissionToJSON = exports.PermissionFromJSONTyped = exports.PermissionFromJSON = exports.Permission = void 0; +exports.Permission = void 0; +exports.instanceOfPermission = instanceOfPermission; +exports.PermissionFromJSON = PermissionFromJSON; +exports.PermissionFromJSONTyped = PermissionFromJSONTyped; +exports.PermissionToJSON = PermissionToJSON; +exports.PermissionToJSONTyped = PermissionToJSONTyped; /** * * @export @@ -22,15 +27,25 @@ exports.Permission = { Read: 'Read', Owner: 'Owner' }; +function instanceOfPermission(value) { + for (const key in exports.Permission) { + if (Object.prototype.hasOwnProperty.call(exports.Permission, key)) { + if (exports.Permission[key] === value) { + return true; + } + } + } + return false; +} function PermissionFromJSON(json) { return PermissionFromJSONTyped(json, false); } -exports.PermissionFromJSON = PermissionFromJSON; function PermissionFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.PermissionFromJSONTyped = PermissionFromJSONTyped; function PermissionToJSON(value) { return value; } -exports.PermissionToJSON = PermissionToJSON; +function PermissionToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/PermissionListOptions.d.ts b/typescript/dist/models/PermissionListOptions.d.ts index 8421c48c..e71ecf61 100644 --- a/typescript/dist/models/PermissionListOptions.d.ts +++ b/typescript/dist/models/PermissionListOptions.d.ts @@ -31,7 +31,8 @@ export interface PermissionListOptions { /** * Check if a given object implements the PermissionListOptions interface. */ -export declare function instanceOfPermissionListOptions(value: object): boolean; +export declare function instanceOfPermissionListOptions(value: object): value is PermissionListOptions; export declare function PermissionListOptionsFromJSON(json: any): PermissionListOptions; export declare function PermissionListOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PermissionListOptions; -export declare function PermissionListOptionsToJSON(value?: PermissionListOptions | null): any; +export declare function PermissionListOptionsToJSON(json: any): PermissionListOptions; +export declare function PermissionListOptionsToJSONTyped(value?: PermissionListOptions | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/PermissionListOptions.js b/typescript/dist/models/PermissionListOptions.js index 80e2329e..4d45d117 100644 --- a/typescript/dist/models/PermissionListOptions.js +++ b/typescript/dist/models/PermissionListOptions.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PermissionListOptionsToJSON = exports.PermissionListOptionsFromJSONTyped = exports.PermissionListOptionsFromJSON = exports.instanceOfPermissionListOptions = void 0; +exports.instanceOfPermissionListOptions = instanceOfPermissionListOptions; +exports.PermissionListOptionsFromJSON = PermissionListOptionsFromJSON; +exports.PermissionListOptionsFromJSONTyped = PermissionListOptionsFromJSONTyped; +exports.PermissionListOptionsToJSON = PermissionListOptionsToJSON; +exports.PermissionListOptionsToJSONTyped = PermissionListOptionsToJSONTyped; /** * Check if a given object implements the PermissionListOptions interface. */ function instanceOfPermissionListOptions(value) { - let isInstance = true; - isInstance = isInstance && "limit" in value; - isInstance = isInstance && "offset" in value; - return isInstance; + if (!('limit' in value) || value['limit'] === undefined) + return false; + if (!('offset' in value) || value['offset'] === undefined) + return false; + return true; } -exports.instanceOfPermissionListOptions = instanceOfPermissionListOptions; function PermissionListOptionsFromJSON(json) { return PermissionListOptionsFromJSONTyped(json, false); } -exports.PermissionListOptionsFromJSON = PermissionListOptionsFromJSON; function PermissionListOptionsFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function PermissionListOptionsFromJSONTyped(json, ignoreDiscriminator) { 'offset': json['offset'], }; } -exports.PermissionListOptionsFromJSONTyped = PermissionListOptionsFromJSONTyped; -function PermissionListOptionsToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function PermissionListOptionsToJSON(json) { + return PermissionListOptionsToJSONTyped(json, false); +} +function PermissionListOptionsToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'limit': value.limit, - 'offset': value.offset, + 'limit': value['limit'], + 'offset': value['offset'], }; } -exports.PermissionListOptionsToJSON = PermissionListOptionsToJSON; diff --git a/typescript/dist/models/PermissionListing.d.ts b/typescript/dist/models/PermissionListing.d.ts index 13d526d2..12b1e759 100644 --- a/typescript/dist/models/PermissionListing.d.ts +++ b/typescript/dist/models/PermissionListing.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import type { Role } from './Role'; import type { Permission } from './Permission'; import type { Resource } from './Resource'; -import type { Role } from './Role'; /** * * @export @@ -40,7 +40,8 @@ export interface PermissionListing { /** * Check if a given object implements the PermissionListing interface. */ -export declare function instanceOfPermissionListing(value: object): boolean; +export declare function instanceOfPermissionListing(value: object): value is PermissionListing; export declare function PermissionListingFromJSON(json: any): PermissionListing; export declare function PermissionListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): PermissionListing; -export declare function PermissionListingToJSON(value?: PermissionListing | null): any; +export declare function PermissionListingToJSON(json: any): PermissionListing; +export declare function PermissionListingToJSONTyped(value?: PermissionListing | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/PermissionListing.js b/typescript/dist/models/PermissionListing.js index 3ce178ab..ee25e23f 100644 --- a/typescript/dist/models/PermissionListing.js +++ b/typescript/dist/models/PermissionListing.js @@ -13,27 +13,31 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PermissionListingToJSON = exports.PermissionListingFromJSONTyped = exports.PermissionListingFromJSON = exports.instanceOfPermissionListing = void 0; +exports.instanceOfPermissionListing = instanceOfPermissionListing; +exports.PermissionListingFromJSON = PermissionListingFromJSON; +exports.PermissionListingFromJSONTyped = PermissionListingFromJSONTyped; +exports.PermissionListingToJSON = PermissionListingToJSON; +exports.PermissionListingToJSONTyped = PermissionListingToJSONTyped; +const Role_1 = require("./Role"); const Permission_1 = require("./Permission"); const Resource_1 = require("./Resource"); -const Role_1 = require("./Role"); /** * Check if a given object implements the PermissionListing interface. */ function instanceOfPermissionListing(value) { - let isInstance = true; - isInstance = isInstance && "permission" in value; - isInstance = isInstance && "resource" in value; - isInstance = isInstance && "role" in value; - return isInstance; + if (!('permission' in value) || value['permission'] === undefined) + return false; + if (!('resource' in value) || value['resource'] === undefined) + return false; + if (!('role' in value) || value['role'] === undefined) + return false; + return true; } -exports.instanceOfPermissionListing = instanceOfPermissionListing; function PermissionListingFromJSON(json) { return PermissionListingFromJSONTyped(json, false); } -exports.PermissionListingFromJSON = PermissionListingFromJSON; function PermissionListingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,18 +46,16 @@ function PermissionListingFromJSONTyped(json, ignoreDiscriminator) { 'role': (0, Role_1.RoleFromJSON)(json['role']), }; } -exports.PermissionListingFromJSONTyped = PermissionListingFromJSONTyped; -function PermissionListingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function PermissionListingToJSON(json) { + return PermissionListingToJSONTyped(json, false); +} +function PermissionListingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'permission': (0, Permission_1.PermissionToJSON)(value.permission), - 'resource': (0, Resource_1.ResourceToJSON)(value.resource), - 'role': (0, Role_1.RoleToJSON)(value.role), + 'permission': (0, Permission_1.PermissionToJSON)(value['permission']), + 'resource': (0, Resource_1.ResourceToJSON)(value['resource']), + 'role': (0, Role_1.RoleToJSON)(value['role']), }; } -exports.PermissionListingToJSON = PermissionListingToJSON; diff --git a/typescript/dist/models/PermissionRequest.d.ts b/typescript/dist/models/PermissionRequest.d.ts index b7d92f5e..d2d019e2 100644 --- a/typescript/dist/models/PermissionRequest.d.ts +++ b/typescript/dist/models/PermissionRequest.d.ts @@ -39,7 +39,8 @@ export interface PermissionRequest { /** * Check if a given object implements the PermissionRequest interface. */ -export declare function instanceOfPermissionRequest(value: object): boolean; +export declare function instanceOfPermissionRequest(value: object): value is PermissionRequest; export declare function PermissionRequestFromJSON(json: any): PermissionRequest; export declare function PermissionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PermissionRequest; -export declare function PermissionRequestToJSON(value?: PermissionRequest | null): any; +export declare function PermissionRequestToJSON(json: any): PermissionRequest; +export declare function PermissionRequestToJSONTyped(value?: PermissionRequest | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/PermissionRequest.js b/typescript/dist/models/PermissionRequest.js index 88d9d855..495a5a12 100644 --- a/typescript/dist/models/PermissionRequest.js +++ b/typescript/dist/models/PermissionRequest.js @@ -13,26 +13,30 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PermissionRequestToJSON = exports.PermissionRequestFromJSONTyped = exports.PermissionRequestFromJSON = exports.instanceOfPermissionRequest = void 0; +exports.instanceOfPermissionRequest = instanceOfPermissionRequest; +exports.PermissionRequestFromJSON = PermissionRequestFromJSON; +exports.PermissionRequestFromJSONTyped = PermissionRequestFromJSONTyped; +exports.PermissionRequestToJSON = PermissionRequestToJSON; +exports.PermissionRequestToJSONTyped = PermissionRequestToJSONTyped; const Permission_1 = require("./Permission"); const Resource_1 = require("./Resource"); /** * Check if a given object implements the PermissionRequest interface. */ function instanceOfPermissionRequest(value) { - let isInstance = true; - isInstance = isInstance && "permission" in value; - isInstance = isInstance && "resource" in value; - isInstance = isInstance && "roleId" in value; - return isInstance; + if (!('permission' in value) || value['permission'] === undefined) + return false; + if (!('resource' in value) || value['resource'] === undefined) + return false; + if (!('roleId' in value) || value['roleId'] === undefined) + return false; + return true; } -exports.instanceOfPermissionRequest = instanceOfPermissionRequest; function PermissionRequestFromJSON(json) { return PermissionRequestFromJSONTyped(json, false); } -exports.PermissionRequestFromJSON = PermissionRequestFromJSON; function PermissionRequestFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,18 +45,16 @@ function PermissionRequestFromJSONTyped(json, ignoreDiscriminator) { 'roleId': json['roleId'], }; } -exports.PermissionRequestFromJSONTyped = PermissionRequestFromJSONTyped; -function PermissionRequestToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function PermissionRequestToJSON(json) { + return PermissionRequestToJSONTyped(json, false); +} +function PermissionRequestToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'permission': (0, Permission_1.PermissionToJSON)(value.permission), - 'resource': (0, Resource_1.ResourceToJSON)(value.resource), - 'roleId': value.roleId, + 'permission': (0, Permission_1.PermissionToJSON)(value['permission']), + 'resource': (0, Resource_1.ResourceToJSON)(value['resource']), + 'roleId': value['roleId'], }; } -exports.PermissionRequestToJSON = PermissionRequestToJSON; diff --git a/typescript/dist/models/Plot.d.ts b/typescript/dist/models/Plot.d.ts index 6d14ad5b..f9a70f0f 100644 --- a/typescript/dist/models/Plot.d.ts +++ b/typescript/dist/models/Plot.d.ts @@ -31,7 +31,8 @@ export interface Plot { /** * Check if a given object implements the Plot interface. */ -export declare function instanceOfPlot(value: object): boolean; +export declare function instanceOfPlot(value: object): value is Plot; export declare function PlotFromJSON(json: any): Plot; export declare function PlotFromJSONTyped(json: any, ignoreDiscriminator: boolean): Plot; -export declare function PlotToJSON(value?: Plot | null): any; +export declare function PlotToJSON(json: any): Plot; +export declare function PlotToJSONTyped(value?: Plot | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Plot.js b/typescript/dist/models/Plot.js index 9f84da9a..df4b4418 100644 --- a/typescript/dist/models/Plot.js +++ b/typescript/dist/models/Plot.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PlotToJSON = exports.PlotFromJSONTyped = exports.PlotFromJSON = exports.instanceOfPlot = void 0; +exports.instanceOfPlot = instanceOfPlot; +exports.PlotFromJSON = PlotFromJSON; +exports.PlotFromJSONTyped = PlotFromJSONTyped; +exports.PlotToJSON = PlotToJSON; +exports.PlotToJSONTyped = PlotToJSONTyped; /** * Check if a given object implements the Plot interface. */ function instanceOfPlot(value) { - let isInstance = true; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - return isInstance; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('workflow' in value) || value['workflow'] === undefined) + return false; + return true; } -exports.instanceOfPlot = instanceOfPlot; function PlotFromJSON(json) { return PlotFromJSONTyped(json, false); } -exports.PlotFromJSON = PlotFromJSON; function PlotFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function PlotFromJSONTyped(json, ignoreDiscriminator) { 'workflow': json['workflow'], }; } -exports.PlotFromJSONTyped = PlotFromJSONTyped; -function PlotToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function PlotToJSON(json) { + return PlotToJSONTyped(json, false); +} +function PlotToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'name': value.name, - 'workflow': value.workflow, + 'name': value['name'], + 'workflow': value['workflow'], }; } -exports.PlotToJSON = PlotToJSON; diff --git a/typescript/dist/models/PlotOutputFormat.d.ts b/typescript/dist/models/PlotOutputFormat.d.ts index ab9a0b29..580c698b 100644 --- a/typescript/dist/models/PlotOutputFormat.d.ts +++ b/typescript/dist/models/PlotOutputFormat.d.ts @@ -19,6 +19,8 @@ export declare const PlotOutputFormat: { readonly ImagePng: "ImagePng"; }; export type PlotOutputFormat = typeof PlotOutputFormat[keyof typeof PlotOutputFormat]; +export declare function instanceOfPlotOutputFormat(value: any): boolean; export declare function PlotOutputFormatFromJSON(json: any): PlotOutputFormat; export declare function PlotOutputFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlotOutputFormat; export declare function PlotOutputFormatToJSON(value?: PlotOutputFormat | null): any; +export declare function PlotOutputFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): PlotOutputFormat; diff --git a/typescript/dist/models/PlotOutputFormat.js b/typescript/dist/models/PlotOutputFormat.js index 8d50e4c3..49dad073 100644 --- a/typescript/dist/models/PlotOutputFormat.js +++ b/typescript/dist/models/PlotOutputFormat.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PlotOutputFormatToJSON = exports.PlotOutputFormatFromJSONTyped = exports.PlotOutputFormatFromJSON = exports.PlotOutputFormat = void 0; +exports.PlotOutputFormat = void 0; +exports.instanceOfPlotOutputFormat = instanceOfPlotOutputFormat; +exports.PlotOutputFormatFromJSON = PlotOutputFormatFromJSON; +exports.PlotOutputFormatFromJSONTyped = PlotOutputFormatFromJSONTyped; +exports.PlotOutputFormatToJSON = PlotOutputFormatToJSON; +exports.PlotOutputFormatToJSONTyped = PlotOutputFormatToJSONTyped; /** * * @export @@ -23,15 +28,25 @@ exports.PlotOutputFormat = { JsonVega: 'JsonVega', ImagePng: 'ImagePng' }; +function instanceOfPlotOutputFormat(value) { + for (const key in exports.PlotOutputFormat) { + if (Object.prototype.hasOwnProperty.call(exports.PlotOutputFormat, key)) { + if (exports.PlotOutputFormat[key] === value) { + return true; + } + } + } + return false; +} function PlotOutputFormatFromJSON(json) { return PlotOutputFormatFromJSONTyped(json, false); } -exports.PlotOutputFormatFromJSON = PlotOutputFormatFromJSON; function PlotOutputFormatFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.PlotOutputFormatFromJSONTyped = PlotOutputFormatFromJSONTyped; function PlotOutputFormatToJSON(value) { return value; } -exports.PlotOutputFormatToJSON = PlotOutputFormatToJSON; +function PlotOutputFormatToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/PlotQueryRectangle.d.ts b/typescript/dist/models/PlotQueryRectangle.d.ts index 1262e22d..a704eb37 100644 --- a/typescript/dist/models/PlotQueryRectangle.d.ts +++ b/typescript/dist/models/PlotQueryRectangle.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; import type { SpatialResolution } from './SpatialResolution'; import type { TimeInterval } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * A spatio-temporal rectangle with a specified resolution * @export @@ -40,7 +40,8 @@ export interface PlotQueryRectangle { /** * Check if a given object implements the PlotQueryRectangle interface. */ -export declare function instanceOfPlotQueryRectangle(value: object): boolean; +export declare function instanceOfPlotQueryRectangle(value: object): value is PlotQueryRectangle; export declare function PlotQueryRectangleFromJSON(json: any): PlotQueryRectangle; export declare function PlotQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlotQueryRectangle; -export declare function PlotQueryRectangleToJSON(value?: PlotQueryRectangle | null): any; +export declare function PlotQueryRectangleToJSON(json: any): PlotQueryRectangle; +export declare function PlotQueryRectangleToJSONTyped(value?: PlotQueryRectangle | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/PlotQueryRectangle.js b/typescript/dist/models/PlotQueryRectangle.js index 56f80e43..d8b1cc40 100644 --- a/typescript/dist/models/PlotQueryRectangle.js +++ b/typescript/dist/models/PlotQueryRectangle.js @@ -13,27 +13,31 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PlotQueryRectangleToJSON = exports.PlotQueryRectangleFromJSONTyped = exports.PlotQueryRectangleFromJSON = exports.instanceOfPlotQueryRectangle = void 0; -const BoundingBox2D_1 = require("./BoundingBox2D"); +exports.instanceOfPlotQueryRectangle = instanceOfPlotQueryRectangle; +exports.PlotQueryRectangleFromJSON = PlotQueryRectangleFromJSON; +exports.PlotQueryRectangleFromJSONTyped = PlotQueryRectangleFromJSONTyped; +exports.PlotQueryRectangleToJSON = PlotQueryRectangleToJSON; +exports.PlotQueryRectangleToJSONTyped = PlotQueryRectangleToJSONTyped; const SpatialResolution_1 = require("./SpatialResolution"); const TimeInterval_1 = require("./TimeInterval"); +const BoundingBox2D_1 = require("./BoundingBox2D"); /** * Check if a given object implements the PlotQueryRectangle interface. */ function instanceOfPlotQueryRectangle(value) { - let isInstance = true; - isInstance = isInstance && "spatialBounds" in value; - isInstance = isInstance && "spatialResolution" in value; - isInstance = isInstance && "timeInterval" in value; - return isInstance; + if (!('spatialBounds' in value) || value['spatialBounds'] === undefined) + return false; + if (!('spatialResolution' in value) || value['spatialResolution'] === undefined) + return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) + return false; + return true; } -exports.instanceOfPlotQueryRectangle = instanceOfPlotQueryRectangle; function PlotQueryRectangleFromJSON(json) { return PlotQueryRectangleFromJSONTyped(json, false); } -exports.PlotQueryRectangleFromJSON = PlotQueryRectangleFromJSON; function PlotQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,18 +46,16 @@ function PlotQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { 'timeInterval': (0, TimeInterval_1.TimeIntervalFromJSON)(json['timeInterval']), }; } -exports.PlotQueryRectangleFromJSONTyped = PlotQueryRectangleFromJSONTyped; -function PlotQueryRectangleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function PlotQueryRectangleToJSON(json) { + return PlotQueryRectangleToJSONTyped(json, false); +} +function PlotQueryRectangleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'spatialBounds': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value.spatialBounds), - 'spatialResolution': (0, SpatialResolution_1.SpatialResolutionToJSON)(value.spatialResolution), - 'timeInterval': (0, TimeInterval_1.TimeIntervalToJSON)(value.timeInterval), + 'spatialBounds': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value['spatialBounds']), + 'spatialResolution': (0, SpatialResolution_1.SpatialResolutionToJSON)(value['spatialResolution']), + 'timeInterval': (0, TimeInterval_1.TimeIntervalToJSON)(value['timeInterval']), }; } -exports.PlotQueryRectangleToJSON = PlotQueryRectangleToJSON; diff --git a/typescript/dist/models/PlotResultDescriptor.d.ts b/typescript/dist/models/PlotResultDescriptor.d.ts index 159861ce..e66ac542 100644 --- a/typescript/dist/models/PlotResultDescriptor.d.ts +++ b/typescript/dist/models/PlotResultDescriptor.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; import type { TimeInterval } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * A `ResultDescriptor` for plot queries * @export @@ -39,7 +39,8 @@ export interface PlotResultDescriptor { /** * Check if a given object implements the PlotResultDescriptor interface. */ -export declare function instanceOfPlotResultDescriptor(value: object): boolean; +export declare function instanceOfPlotResultDescriptor(value: object): value is PlotResultDescriptor; export declare function PlotResultDescriptorFromJSON(json: any): PlotResultDescriptor; export declare function PlotResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlotResultDescriptor; -export declare function PlotResultDescriptorToJSON(value?: PlotResultDescriptor | null): any; +export declare function PlotResultDescriptorToJSON(json: any): PlotResultDescriptor; +export declare function PlotResultDescriptorToJSONTyped(value?: PlotResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/PlotResultDescriptor.js b/typescript/dist/models/PlotResultDescriptor.js index 2aa324af..8c78bf60 100644 --- a/typescript/dist/models/PlotResultDescriptor.js +++ b/typescript/dist/models/PlotResultDescriptor.js @@ -13,45 +13,44 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PlotResultDescriptorToJSON = exports.PlotResultDescriptorFromJSONTyped = exports.PlotResultDescriptorFromJSON = exports.instanceOfPlotResultDescriptor = void 0; -const runtime_1 = require("../runtime"); -const BoundingBox2D_1 = require("./BoundingBox2D"); +exports.instanceOfPlotResultDescriptor = instanceOfPlotResultDescriptor; +exports.PlotResultDescriptorFromJSON = PlotResultDescriptorFromJSON; +exports.PlotResultDescriptorFromJSONTyped = PlotResultDescriptorFromJSONTyped; +exports.PlotResultDescriptorToJSON = PlotResultDescriptorToJSON; +exports.PlotResultDescriptorToJSONTyped = PlotResultDescriptorToJSONTyped; const TimeInterval_1 = require("./TimeInterval"); +const BoundingBox2D_1 = require("./BoundingBox2D"); /** * Check if a given object implements the PlotResultDescriptor interface. */ function instanceOfPlotResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "spatialReference" in value; - return isInstance; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + return true; } -exports.instanceOfPlotResultDescriptor = instanceOfPlotResultDescriptor; function PlotResultDescriptorFromJSON(json) { return PlotResultDescriptorFromJSONTyped(json, false); } -exports.PlotResultDescriptorFromJSON = PlotResultDescriptorFromJSON; function PlotResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !(0, runtime_1.exists)(json, 'bbox') ? undefined : (0, BoundingBox2D_1.BoundingBox2DFromJSON)(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : (0, BoundingBox2D_1.BoundingBox2DFromJSON)(json['bbox']), 'spatialReference': json['spatialReference'], - 'time': !(0, runtime_1.exists)(json, 'time') ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), + 'time': json['time'] == null ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), }; } -exports.PlotResultDescriptorFromJSONTyped = PlotResultDescriptorFromJSONTyped; -function PlotResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function PlotResultDescriptorToJSON(json) { + return PlotResultDescriptorToJSONTyped(json, false); +} +function PlotResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bbox': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value.bbox), - 'spatialReference': value.spatialReference, - 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value.time), + 'bbox': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value['bbox']), + 'spatialReference': value['spatialReference'], + 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value['time']), }; } -exports.PlotResultDescriptorToJSON = PlotResultDescriptorToJSON; diff --git a/typescript/dist/models/PlotUpdate.d.ts b/typescript/dist/models/PlotUpdate.d.ts index 422a95b0..d72055db 100644 --- a/typescript/dist/models/PlotUpdate.d.ts +++ b/typescript/dist/models/PlotUpdate.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { Plot } from './Plot'; -import { ProjectUpdateToken } from './ProjectUpdateToken'; +import type { Plot } from './Plot'; +import type { ProjectUpdateToken } from './ProjectUpdateToken'; /** * @type PlotUpdate * @@ -19,4 +19,5 @@ import { ProjectUpdateToken } from './ProjectUpdateToken'; export type PlotUpdate = Plot | ProjectUpdateToken; export declare function PlotUpdateFromJSON(json: any): PlotUpdate; export declare function PlotUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlotUpdate; -export declare function PlotUpdateToJSON(value?: PlotUpdate | null): any; +export declare function PlotUpdateToJSON(json: any): any; +export declare function PlotUpdateToJSONTyped(value?: PlotUpdate | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/PlotUpdate.js b/typescript/dist/models/PlotUpdate.js index 0d09e282..cbe0a748 100644 --- a/typescript/dist/models/PlotUpdate.js +++ b/typescript/dist/models/PlotUpdate.js @@ -13,34 +13,33 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PlotUpdateToJSON = exports.PlotUpdateFromJSONTyped = exports.PlotUpdateFromJSON = void 0; +exports.PlotUpdateFromJSON = PlotUpdateFromJSON; +exports.PlotUpdateFromJSONTyped = PlotUpdateFromJSONTyped; +exports.PlotUpdateToJSON = PlotUpdateToJSON; +exports.PlotUpdateToJSONTyped = PlotUpdateToJSONTyped; const Plot_1 = require("./Plot"); const ProjectUpdateToken_1 = require("./ProjectUpdateToken"); function PlotUpdateFromJSON(json) { return PlotUpdateFromJSONTyped(json, false); } -exports.PlotUpdateFromJSON = PlotUpdateFromJSON; function PlotUpdateFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - if (json === ProjectUpdateToken_1.ProjectUpdateToken.None) { - return ProjectUpdateToken_1.ProjectUpdateToken.None; - } - else if (json === ProjectUpdateToken_1.ProjectUpdateToken.Delete) { - return ProjectUpdateToken_1.ProjectUpdateToken.Delete; + if ((0, Plot_1.instanceOfPlot)(json)) { + return (0, Plot_1.PlotFromJSONTyped)(json, true); } - else { - return Object.assign({}, (0, Plot_1.PlotFromJSONTyped)(json, true)); + if ((0, ProjectUpdateToken_1.instanceOfProjectUpdateToken)(json)) { + return (0, ProjectUpdateToken_1.ProjectUpdateTokenFromJSONTyped)(json, true); } + return {}; } -exports.PlotUpdateFromJSONTyped = PlotUpdateFromJSONTyped; -function PlotUpdateToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function PlotUpdateToJSON(json) { + return PlotUpdateToJSONTyped(json, false); +} +function PlotUpdateToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } if (typeof value === 'object' && (0, Plot_1.instanceOfPlot)(value)) { return (0, Plot_1.PlotToJSON)(value); @@ -50,4 +49,3 @@ function PlotUpdateToJSON(value) { } return {}; } -exports.PlotUpdateToJSON = PlotUpdateToJSON; diff --git a/typescript/dist/models/PointSymbology.d.ts b/typescript/dist/models/PointSymbology.d.ts index 93f7ef4f..b778e1d2 100644 --- a/typescript/dist/models/PointSymbology.d.ts +++ b/typescript/dist/models/PointSymbology.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { ColorParam } from './ColorParam'; -import type { NumberParam } from './NumberParam'; -import type { StrokeParam } from './StrokeParam'; import type { TextSymbology } from './TextSymbology'; +import type { StrokeParam } from './StrokeParam'; +import type { NumberParam } from './NumberParam'; +import type { ColorParam } from './ColorParam'; /** * * @export @@ -60,7 +60,8 @@ export type PointSymbologyTypeEnum = typeof PointSymbologyTypeEnum[keyof typeof /** * Check if a given object implements the PointSymbology interface. */ -export declare function instanceOfPointSymbology(value: object): boolean; +export declare function instanceOfPointSymbology(value: object): value is PointSymbology; export declare function PointSymbologyFromJSON(json: any): PointSymbology; export declare function PointSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PointSymbology; -export declare function PointSymbologyToJSON(value?: PointSymbology | null): any; +export declare function PointSymbologyToJSON(json: any): PointSymbology; +export declare function PointSymbologyToJSONTyped(value?: PointSymbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/PointSymbology.js b/typescript/dist/models/PointSymbology.js index 2f198304..82b17ce8 100644 --- a/typescript/dist/models/PointSymbology.js +++ b/typescript/dist/models/PointSymbology.js @@ -13,12 +13,16 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PointSymbologyToJSON = exports.PointSymbologyFromJSONTyped = exports.PointSymbologyFromJSON = exports.instanceOfPointSymbology = exports.PointSymbologyTypeEnum = void 0; -const runtime_1 = require("../runtime"); -const ColorParam_1 = require("./ColorParam"); -const NumberParam_1 = require("./NumberParam"); -const StrokeParam_1 = require("./StrokeParam"); +exports.PointSymbologyTypeEnum = void 0; +exports.instanceOfPointSymbology = instanceOfPointSymbology; +exports.PointSymbologyFromJSON = PointSymbologyFromJSON; +exports.PointSymbologyFromJSONTyped = PointSymbologyFromJSONTyped; +exports.PointSymbologyToJSON = PointSymbologyToJSON; +exports.PointSymbologyToJSONTyped = PointSymbologyToJSONTyped; const TextSymbology_1 = require("./TextSymbology"); +const StrokeParam_1 = require("./StrokeParam"); +const NumberParam_1 = require("./NumberParam"); +const ColorParam_1 = require("./ColorParam"); /** * @export */ @@ -29,44 +33,43 @@ exports.PointSymbologyTypeEnum = { * Check if a given object implements the PointSymbology interface. */ function instanceOfPointSymbology(value) { - let isInstance = true; - isInstance = isInstance && "fillColor" in value; - isInstance = isInstance && "radius" in value; - isInstance = isInstance && "stroke" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('fillColor' in value) || value['fillColor'] === undefined) + return false; + if (!('radius' in value) || value['radius'] === undefined) + return false; + if (!('stroke' in value) || value['stroke'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfPointSymbology = instanceOfPointSymbology; function PointSymbologyFromJSON(json) { return PointSymbologyFromJSONTyped(json, false); } -exports.PointSymbologyFromJSON = PointSymbologyFromJSON; function PointSymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'fillColor': (0, ColorParam_1.ColorParamFromJSON)(json['fillColor']), 'radius': (0, NumberParam_1.NumberParamFromJSON)(json['radius']), 'stroke': (0, StrokeParam_1.StrokeParamFromJSON)(json['stroke']), - 'text': !(0, runtime_1.exists)(json, 'text') ? undefined : (0, TextSymbology_1.TextSymbologyFromJSON)(json['text']), + 'text': json['text'] == null ? undefined : (0, TextSymbology_1.TextSymbologyFromJSON)(json['text']), 'type': json['type'], }; } -exports.PointSymbologyFromJSONTyped = PointSymbologyFromJSONTyped; -function PointSymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function PointSymbologyToJSON(json) { + return PointSymbologyToJSONTyped(json, false); +} +function PointSymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'fillColor': (0, ColorParam_1.ColorParamToJSON)(value.fillColor), - 'radius': (0, NumberParam_1.NumberParamToJSON)(value.radius), - 'stroke': (0, StrokeParam_1.StrokeParamToJSON)(value.stroke), - 'text': (0, TextSymbology_1.TextSymbologyToJSON)(value.text), - 'type': value.type, + 'fillColor': (0, ColorParam_1.ColorParamToJSON)(value['fillColor']), + 'radius': (0, NumberParam_1.NumberParamToJSON)(value['radius']), + 'stroke': (0, StrokeParam_1.StrokeParamToJSON)(value['stroke']), + 'text': (0, TextSymbology_1.TextSymbologyToJSON)(value['text']), + 'type': value['type'], }; } -exports.PointSymbologyToJSON = PointSymbologyToJSON; diff --git a/typescript/dist/models/PolygonSymbology.d.ts b/typescript/dist/models/PolygonSymbology.d.ts index 33e2c149..d1d80598 100644 --- a/typescript/dist/models/PolygonSymbology.d.ts +++ b/typescript/dist/models/PolygonSymbology.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { ColorParam } from './ColorParam'; -import type { StrokeParam } from './StrokeParam'; import type { TextSymbology } from './TextSymbology'; +import type { StrokeParam } from './StrokeParam'; +import type { ColorParam } from './ColorParam'; /** * * @export @@ -59,7 +59,8 @@ export type PolygonSymbologyTypeEnum = typeof PolygonSymbologyTypeEnum[keyof typ /** * Check if a given object implements the PolygonSymbology interface. */ -export declare function instanceOfPolygonSymbology(value: object): boolean; +export declare function instanceOfPolygonSymbology(value: object): value is PolygonSymbology; export declare function PolygonSymbologyFromJSON(json: any): PolygonSymbology; export declare function PolygonSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PolygonSymbology; -export declare function PolygonSymbologyToJSON(value?: PolygonSymbology | null): any; +export declare function PolygonSymbologyToJSON(json: any): PolygonSymbology; +export declare function PolygonSymbologyToJSONTyped(value?: PolygonSymbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/PolygonSymbology.js b/typescript/dist/models/PolygonSymbology.js index 5d849d7b..095fe599 100644 --- a/typescript/dist/models/PolygonSymbology.js +++ b/typescript/dist/models/PolygonSymbology.js @@ -13,11 +13,15 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PolygonSymbologyToJSON = exports.PolygonSymbologyFromJSONTyped = exports.PolygonSymbologyFromJSON = exports.instanceOfPolygonSymbology = exports.PolygonSymbologyTypeEnum = void 0; -const runtime_1 = require("../runtime"); -const ColorParam_1 = require("./ColorParam"); -const StrokeParam_1 = require("./StrokeParam"); +exports.PolygonSymbologyTypeEnum = void 0; +exports.instanceOfPolygonSymbology = instanceOfPolygonSymbology; +exports.PolygonSymbologyFromJSON = PolygonSymbologyFromJSON; +exports.PolygonSymbologyFromJSONTyped = PolygonSymbologyFromJSONTyped; +exports.PolygonSymbologyToJSON = PolygonSymbologyToJSON; +exports.PolygonSymbologyToJSONTyped = PolygonSymbologyToJSONTyped; const TextSymbology_1 = require("./TextSymbology"); +const StrokeParam_1 = require("./StrokeParam"); +const ColorParam_1 = require("./ColorParam"); /** * @export */ @@ -28,44 +32,43 @@ exports.PolygonSymbologyTypeEnum = { * Check if a given object implements the PolygonSymbology interface. */ function instanceOfPolygonSymbology(value) { - let isInstance = true; - isInstance = isInstance && "autoSimplified" in value; - isInstance = isInstance && "fillColor" in value; - isInstance = isInstance && "stroke" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('autoSimplified' in value) || value['autoSimplified'] === undefined) + return false; + if (!('fillColor' in value) || value['fillColor'] === undefined) + return false; + if (!('stroke' in value) || value['stroke'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfPolygonSymbology = instanceOfPolygonSymbology; function PolygonSymbologyFromJSON(json) { return PolygonSymbologyFromJSONTyped(json, false); } -exports.PolygonSymbologyFromJSON = PolygonSymbologyFromJSON; function PolygonSymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'autoSimplified': json['autoSimplified'], 'fillColor': (0, ColorParam_1.ColorParamFromJSON)(json['fillColor']), 'stroke': (0, StrokeParam_1.StrokeParamFromJSON)(json['stroke']), - 'text': !(0, runtime_1.exists)(json, 'text') ? undefined : (0, TextSymbology_1.TextSymbologyFromJSON)(json['text']), + 'text': json['text'] == null ? undefined : (0, TextSymbology_1.TextSymbologyFromJSON)(json['text']), 'type': json['type'], }; } -exports.PolygonSymbologyFromJSONTyped = PolygonSymbologyFromJSONTyped; -function PolygonSymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function PolygonSymbologyToJSON(json) { + return PolygonSymbologyToJSONTyped(json, false); +} +function PolygonSymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'autoSimplified': value.autoSimplified, - 'fillColor': (0, ColorParam_1.ColorParamToJSON)(value.fillColor), - 'stroke': (0, StrokeParam_1.StrokeParamToJSON)(value.stroke), - 'text': (0, TextSymbology_1.TextSymbologyToJSON)(value.text), - 'type': value.type, + 'autoSimplified': value['autoSimplified'], + 'fillColor': (0, ColorParam_1.ColorParamToJSON)(value['fillColor']), + 'stroke': (0, StrokeParam_1.StrokeParamToJSON)(value['stroke']), + 'text': (0, TextSymbology_1.TextSymbologyToJSON)(value['text']), + 'type': value['type'], }; } -exports.PolygonSymbologyToJSON = PolygonSymbologyToJSON; diff --git a/typescript/dist/models/Project.d.ts b/typescript/dist/models/Project.d.ts index db1736f6..d28c5a44 100644 --- a/typescript/dist/models/Project.d.ts +++ b/typescript/dist/models/Project.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import type { TimeStep } from './TimeStep'; import type { Plot } from './Plot'; -import type { ProjectLayer } from './ProjectLayer'; import type { ProjectVersion } from './ProjectVersion'; import type { STRectangle } from './STRectangle'; -import type { TimeStep } from './TimeStep'; +import type { ProjectLayer } from './ProjectLayer'; /** * * @export @@ -72,7 +72,8 @@ export interface Project { /** * Check if a given object implements the Project interface. */ -export declare function instanceOfProject(value: object): boolean; +export declare function instanceOfProject(value: object): value is Project; export declare function ProjectFromJSON(json: any): Project; export declare function ProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): Project; -export declare function ProjectToJSON(value?: Project | null): any; +export declare function ProjectToJSON(json: any): Project; +export declare function ProjectToJSONTyped(value?: Project | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Project.js b/typescript/dist/models/Project.js index bad1b92f..b8cede48 100644 --- a/typescript/dist/models/Project.js +++ b/typescript/dist/models/Project.js @@ -13,34 +13,43 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProjectToJSON = exports.ProjectFromJSONTyped = exports.ProjectFromJSON = exports.instanceOfProject = void 0; +exports.instanceOfProject = instanceOfProject; +exports.ProjectFromJSON = ProjectFromJSON; +exports.ProjectFromJSONTyped = ProjectFromJSONTyped; +exports.ProjectToJSON = ProjectToJSON; +exports.ProjectToJSONTyped = ProjectToJSONTyped; +const TimeStep_1 = require("./TimeStep"); const Plot_1 = require("./Plot"); -const ProjectLayer_1 = require("./ProjectLayer"); const ProjectVersion_1 = require("./ProjectVersion"); const STRectangle_1 = require("./STRectangle"); -const TimeStep_1 = require("./TimeStep"); +const ProjectLayer_1 = require("./ProjectLayer"); /** * Check if a given object implements the Project interface. */ function instanceOfProject(value) { - let isInstance = true; - isInstance = isInstance && "bounds" in value; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "layers" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "plots" in value; - isInstance = isInstance && "timeStep" in value; - isInstance = isInstance && "version" in value; - return isInstance; + if (!('bounds' in value) || value['bounds'] === undefined) + return false; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('layers' in value) || value['layers'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('plots' in value) || value['plots'] === undefined) + return false; + if (!('timeStep' in value) || value['timeStep'] === undefined) + return false; + if (!('version' in value) || value['version'] === undefined) + return false; + return true; } -exports.instanceOfProject = instanceOfProject; function ProjectFromJSON(json) { return ProjectFromJSONTyped(json, false); } -exports.ProjectFromJSON = ProjectFromJSON; function ProjectFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -54,23 +63,21 @@ function ProjectFromJSONTyped(json, ignoreDiscriminator) { 'version': (0, ProjectVersion_1.ProjectVersionFromJSON)(json['version']), }; } -exports.ProjectFromJSONTyped = ProjectFromJSONTyped; -function ProjectToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProjectToJSON(json) { + return ProjectToJSONTyped(json, false); +} +function ProjectToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bounds': (0, STRectangle_1.STRectangleToJSON)(value.bounds), - 'description': value.description, - 'id': value.id, - 'layers': (value.layers.map(ProjectLayer_1.ProjectLayerToJSON)), - 'name': value.name, - 'plots': (value.plots.map(Plot_1.PlotToJSON)), - 'timeStep': (0, TimeStep_1.TimeStepToJSON)(value.timeStep), - 'version': (0, ProjectVersion_1.ProjectVersionToJSON)(value.version), + 'bounds': (0, STRectangle_1.STRectangleToJSON)(value['bounds']), + 'description': value['description'], + 'id': value['id'], + 'layers': (value['layers'].map(ProjectLayer_1.ProjectLayerToJSON)), + 'name': value['name'], + 'plots': (value['plots'].map(Plot_1.PlotToJSON)), + 'timeStep': (0, TimeStep_1.TimeStepToJSON)(value['timeStep']), + 'version': (0, ProjectVersion_1.ProjectVersionToJSON)(value['version']), }; } -exports.ProjectToJSON = ProjectToJSON; diff --git a/typescript/dist/models/ProjectLayer.d.ts b/typescript/dist/models/ProjectLayer.d.ts index 67280de1..ee868427 100644 --- a/typescript/dist/models/ProjectLayer.d.ts +++ b/typescript/dist/models/ProjectLayer.d.ts @@ -45,7 +45,8 @@ export interface ProjectLayer { /** * Check if a given object implements the ProjectLayer interface. */ -export declare function instanceOfProjectLayer(value: object): boolean; +export declare function instanceOfProjectLayer(value: object): value is ProjectLayer; export declare function ProjectLayerFromJSON(json: any): ProjectLayer; export declare function ProjectLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectLayer; -export declare function ProjectLayerToJSON(value?: ProjectLayer | null): any; +export declare function ProjectLayerToJSON(json: any): ProjectLayer; +export declare function ProjectLayerToJSONTyped(value?: ProjectLayer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ProjectLayer.js b/typescript/dist/models/ProjectLayer.js index f55c636c..78e525eb 100644 --- a/typescript/dist/models/ProjectLayer.js +++ b/typescript/dist/models/ProjectLayer.js @@ -13,27 +13,32 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProjectLayerToJSON = exports.ProjectLayerFromJSONTyped = exports.ProjectLayerFromJSON = exports.instanceOfProjectLayer = void 0; +exports.instanceOfProjectLayer = instanceOfProjectLayer; +exports.ProjectLayerFromJSON = ProjectLayerFromJSON; +exports.ProjectLayerFromJSONTyped = ProjectLayerFromJSONTyped; +exports.ProjectLayerToJSON = ProjectLayerToJSON; +exports.ProjectLayerToJSONTyped = ProjectLayerToJSONTyped; const LayerVisibility_1 = require("./LayerVisibility"); const Symbology_1 = require("./Symbology"); /** * Check if a given object implements the ProjectLayer interface. */ function instanceOfProjectLayer(value) { - let isInstance = true; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "symbology" in value; - isInstance = isInstance && "visibility" in value; - isInstance = isInstance && "workflow" in value; - return isInstance; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('symbology' in value) || value['symbology'] === undefined) + return false; + if (!('visibility' in value) || value['visibility'] === undefined) + return false; + if (!('workflow' in value) || value['workflow'] === undefined) + return false; + return true; } -exports.instanceOfProjectLayer = instanceOfProjectLayer; function ProjectLayerFromJSON(json) { return ProjectLayerFromJSONTyped(json, false); } -exports.ProjectLayerFromJSON = ProjectLayerFromJSON; function ProjectLayerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,19 +48,17 @@ function ProjectLayerFromJSONTyped(json, ignoreDiscriminator) { 'workflow': json['workflow'], }; } -exports.ProjectLayerFromJSONTyped = ProjectLayerFromJSONTyped; -function ProjectLayerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProjectLayerToJSON(json) { + return ProjectLayerToJSONTyped(json, false); +} +function ProjectLayerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'name': value.name, - 'symbology': (0, Symbology_1.SymbologyToJSON)(value.symbology), - 'visibility': (0, LayerVisibility_1.LayerVisibilityToJSON)(value.visibility), - 'workflow': value.workflow, + 'name': value['name'], + 'symbology': (0, Symbology_1.SymbologyToJSON)(value['symbology']), + 'visibility': (0, LayerVisibility_1.LayerVisibilityToJSON)(value['visibility']), + 'workflow': value['workflow'], }; } -exports.ProjectLayerToJSON = ProjectLayerToJSON; diff --git a/typescript/dist/models/ProjectListing.d.ts b/typescript/dist/models/ProjectListing.d.ts index 4d755f72..5961c6b9 100644 --- a/typescript/dist/models/ProjectListing.d.ts +++ b/typescript/dist/models/ProjectListing.d.ts @@ -55,7 +55,8 @@ export interface ProjectListing { /** * Check if a given object implements the ProjectListing interface. */ -export declare function instanceOfProjectListing(value: object): boolean; +export declare function instanceOfProjectListing(value: object): value is ProjectListing; export declare function ProjectListingFromJSON(json: any): ProjectListing; export declare function ProjectListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectListing; -export declare function ProjectListingToJSON(value?: ProjectListing | null): any; +export declare function ProjectListingToJSON(json: any): ProjectListing; +export declare function ProjectListingToJSONTyped(value?: ProjectListing | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ProjectListing.js b/typescript/dist/models/ProjectListing.js index c3261137..064943af 100644 --- a/typescript/dist/models/ProjectListing.js +++ b/typescript/dist/models/ProjectListing.js @@ -13,27 +13,34 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProjectListingToJSON = exports.ProjectListingFromJSONTyped = exports.ProjectListingFromJSON = exports.instanceOfProjectListing = void 0; +exports.instanceOfProjectListing = instanceOfProjectListing; +exports.ProjectListingFromJSON = ProjectListingFromJSON; +exports.ProjectListingFromJSONTyped = ProjectListingFromJSONTyped; +exports.ProjectListingToJSON = ProjectListingToJSON; +exports.ProjectListingToJSONTyped = ProjectListingToJSONTyped; /** * Check if a given object implements the ProjectListing interface. */ function instanceOfProjectListing(value) { - let isInstance = true; - isInstance = isInstance && "changed" in value; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "layerNames" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "plotNames" in value; - return isInstance; + if (!('changed' in value) || value['changed'] === undefined) + return false; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('layerNames' in value) || value['layerNames'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('plotNames' in value) || value['plotNames'] === undefined) + return false; + return true; } -exports.instanceOfProjectListing = instanceOfProjectListing; function ProjectListingFromJSON(json) { return ProjectListingFromJSONTyped(json, false); } -exports.ProjectListingFromJSON = ProjectListingFromJSON; function ProjectListingFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -45,21 +52,19 @@ function ProjectListingFromJSONTyped(json, ignoreDiscriminator) { 'plotNames': json['plotNames'], }; } -exports.ProjectListingFromJSONTyped = ProjectListingFromJSONTyped; -function ProjectListingToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProjectListingToJSON(json) { + return ProjectListingToJSONTyped(json, false); +} +function ProjectListingToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'changed': (value.changed.toISOString()), - 'description': value.description, - 'id': value.id, - 'layerNames': value.layerNames, - 'name': value.name, - 'plotNames': value.plotNames, + 'changed': ((value['changed']).toISOString()), + 'description': value['description'], + 'id': value['id'], + 'layerNames': value['layerNames'], + 'name': value['name'], + 'plotNames': value['plotNames'], }; } -exports.ProjectListingToJSON = ProjectListingToJSON; diff --git a/typescript/dist/models/ProjectResource.d.ts b/typescript/dist/models/ProjectResource.d.ts index 3f17fdca..cec38c91 100644 --- a/typescript/dist/models/ProjectResource.d.ts +++ b/typescript/dist/models/ProjectResource.d.ts @@ -38,7 +38,8 @@ export type ProjectResourceTypeEnum = typeof ProjectResourceTypeEnum[keyof typeo /** * Check if a given object implements the ProjectResource interface. */ -export declare function instanceOfProjectResource(value: object): boolean; +export declare function instanceOfProjectResource(value: object): value is ProjectResource; export declare function ProjectResourceFromJSON(json: any): ProjectResource; export declare function ProjectResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectResource; -export declare function ProjectResourceToJSON(value?: ProjectResource | null): any; +export declare function ProjectResourceToJSON(json: any): ProjectResource; +export declare function ProjectResourceToJSONTyped(value?: ProjectResource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ProjectResource.js b/typescript/dist/models/ProjectResource.js index 5cfe8ff5..6c322ea1 100644 --- a/typescript/dist/models/ProjectResource.js +++ b/typescript/dist/models/ProjectResource.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProjectResourceToJSON = exports.ProjectResourceFromJSONTyped = exports.ProjectResourceFromJSON = exports.instanceOfProjectResource = exports.ProjectResourceTypeEnum = void 0; +exports.ProjectResourceTypeEnum = void 0; +exports.instanceOfProjectResource = instanceOfProjectResource; +exports.ProjectResourceFromJSON = ProjectResourceFromJSON; +exports.ProjectResourceFromJSONTyped = ProjectResourceFromJSONTyped; +exports.ProjectResourceToJSON = ProjectResourceToJSON; +exports.ProjectResourceToJSONTyped = ProjectResourceToJSONTyped; /** * @export */ @@ -24,18 +29,17 @@ exports.ProjectResourceTypeEnum = { * Check if a given object implements the ProjectResource interface. */ function instanceOfProjectResource(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfProjectResource = instanceOfProjectResource; function ProjectResourceFromJSON(json) { return ProjectResourceFromJSONTyped(json, false); } -exports.ProjectResourceFromJSON = ProjectResourceFromJSON; function ProjectResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +47,15 @@ function ProjectResourceFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.ProjectResourceFromJSONTyped = ProjectResourceFromJSONTyped; -function ProjectResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProjectResourceToJSON(json) { + return ProjectResourceToJSONTyped(json, false); +} +function ProjectResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } -exports.ProjectResourceToJSON = ProjectResourceToJSON; diff --git a/typescript/dist/models/ProjectUpdateToken.d.ts b/typescript/dist/models/ProjectUpdateToken.d.ts index b774adf5..e5d4daae 100644 --- a/typescript/dist/models/ProjectUpdateToken.d.ts +++ b/typescript/dist/models/ProjectUpdateToken.d.ts @@ -18,7 +18,8 @@ export declare const ProjectUpdateToken: { readonly Delete: "delete"; }; export type ProjectUpdateToken = typeof ProjectUpdateToken[keyof typeof ProjectUpdateToken]; +export declare function instanceOfProjectUpdateToken(value: any): boolean; export declare function ProjectUpdateTokenFromJSON(json: any): ProjectUpdateToken; export declare function ProjectUpdateTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectUpdateToken; -export declare function instanceOfProjectUpdateToken(value: any): boolean; export declare function ProjectUpdateTokenToJSON(value?: ProjectUpdateToken | null): any; +export declare function ProjectUpdateTokenToJSONTyped(value: any, ignoreDiscriminator: boolean): ProjectUpdateToken; diff --git a/typescript/dist/models/ProjectUpdateToken.js b/typescript/dist/models/ProjectUpdateToken.js index 8ef45bac..46ba086f 100644 --- a/typescript/dist/models/ProjectUpdateToken.js +++ b/typescript/dist/models/ProjectUpdateToken.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProjectUpdateTokenToJSON = exports.instanceOfProjectUpdateToken = exports.ProjectUpdateTokenFromJSONTyped = exports.ProjectUpdateTokenFromJSON = exports.ProjectUpdateToken = void 0; +exports.ProjectUpdateToken = void 0; +exports.instanceOfProjectUpdateToken = instanceOfProjectUpdateToken; +exports.ProjectUpdateTokenFromJSON = ProjectUpdateTokenFromJSON; +exports.ProjectUpdateTokenFromJSONTyped = ProjectUpdateTokenFromJSONTyped; +exports.ProjectUpdateTokenToJSON = ProjectUpdateTokenToJSON; +exports.ProjectUpdateTokenToJSONTyped = ProjectUpdateTokenToJSONTyped; /** * * @export @@ -22,19 +27,25 @@ exports.ProjectUpdateToken = { None: 'none', Delete: 'delete' }; +function instanceOfProjectUpdateToken(value) { + for (const key in exports.ProjectUpdateToken) { + if (Object.prototype.hasOwnProperty.call(exports.ProjectUpdateToken, key)) { + if (exports.ProjectUpdateToken[key] === value) { + return true; + } + } + } + return false; +} function ProjectUpdateTokenFromJSON(json) { return ProjectUpdateTokenFromJSONTyped(json, false); } -exports.ProjectUpdateTokenFromJSON = ProjectUpdateTokenFromJSON; function ProjectUpdateTokenFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.ProjectUpdateTokenFromJSONTyped = ProjectUpdateTokenFromJSONTyped; -function instanceOfProjectUpdateToken(value) { - return value === exports.ProjectUpdateToken.None || value === exports.ProjectUpdateToken.Delete; -} -exports.instanceOfProjectUpdateToken = instanceOfProjectUpdateToken; function ProjectUpdateTokenToJSON(value) { return value; } -exports.ProjectUpdateTokenToJSON = ProjectUpdateTokenToJSON; +function ProjectUpdateTokenToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/ProjectVersion.d.ts b/typescript/dist/models/ProjectVersion.d.ts index 53c498d3..865d0190 100644 --- a/typescript/dist/models/ProjectVersion.d.ts +++ b/typescript/dist/models/ProjectVersion.d.ts @@ -31,7 +31,8 @@ export interface ProjectVersion { /** * Check if a given object implements the ProjectVersion interface. */ -export declare function instanceOfProjectVersion(value: object): boolean; +export declare function instanceOfProjectVersion(value: object): value is ProjectVersion; export declare function ProjectVersionFromJSON(json: any): ProjectVersion; export declare function ProjectVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectVersion; -export declare function ProjectVersionToJSON(value?: ProjectVersion | null): any; +export declare function ProjectVersionToJSON(json: any): ProjectVersion; +export declare function ProjectVersionToJSONTyped(value?: ProjectVersion | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ProjectVersion.js b/typescript/dist/models/ProjectVersion.js index 09ce6ea2..9218d8e1 100644 --- a/typescript/dist/models/ProjectVersion.js +++ b/typescript/dist/models/ProjectVersion.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProjectVersionToJSON = exports.ProjectVersionFromJSONTyped = exports.ProjectVersionFromJSON = exports.instanceOfProjectVersion = void 0; +exports.instanceOfProjectVersion = instanceOfProjectVersion; +exports.ProjectVersionFromJSON = ProjectVersionFromJSON; +exports.ProjectVersionFromJSONTyped = ProjectVersionFromJSONTyped; +exports.ProjectVersionToJSON = ProjectVersionToJSON; +exports.ProjectVersionToJSONTyped = ProjectVersionToJSONTyped; /** * Check if a given object implements the ProjectVersion interface. */ function instanceOfProjectVersion(value) { - let isInstance = true; - isInstance = isInstance && "changed" in value; - isInstance = isInstance && "id" in value; - return isInstance; + if (!('changed' in value) || value['changed'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + return true; } -exports.instanceOfProjectVersion = instanceOfProjectVersion; function ProjectVersionFromJSON(json) { return ProjectVersionFromJSONTyped(json, false); } -exports.ProjectVersionFromJSON = ProjectVersionFromJSON; function ProjectVersionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function ProjectVersionFromJSONTyped(json, ignoreDiscriminator) { 'id': json['id'], }; } -exports.ProjectVersionFromJSONTyped = ProjectVersionFromJSONTyped; -function ProjectVersionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProjectVersionToJSON(json) { + return ProjectVersionToJSONTyped(json, false); +} +function ProjectVersionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'changed': (value.changed.toISOString()), - 'id': value.id, + 'changed': ((value['changed']).toISOString()), + 'id': value['id'], }; } -exports.ProjectVersionToJSON = ProjectVersionToJSON; diff --git a/typescript/dist/models/Provenance.d.ts b/typescript/dist/models/Provenance.d.ts index 27abef59..261dd5a4 100644 --- a/typescript/dist/models/Provenance.d.ts +++ b/typescript/dist/models/Provenance.d.ts @@ -37,7 +37,8 @@ export interface Provenance { /** * Check if a given object implements the Provenance interface. */ -export declare function instanceOfProvenance(value: object): boolean; +export declare function instanceOfProvenance(value: object): value is Provenance; export declare function ProvenanceFromJSON(json: any): Provenance; export declare function ProvenanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Provenance; -export declare function ProvenanceToJSON(value?: Provenance | null): any; +export declare function ProvenanceToJSON(json: any): Provenance; +export declare function ProvenanceToJSONTyped(value?: Provenance | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Provenance.js b/typescript/dist/models/Provenance.js index 9598375b..a160a0f6 100644 --- a/typescript/dist/models/Provenance.js +++ b/typescript/dist/models/Provenance.js @@ -13,24 +13,28 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProvenanceToJSON = exports.ProvenanceFromJSONTyped = exports.ProvenanceFromJSON = exports.instanceOfProvenance = void 0; +exports.instanceOfProvenance = instanceOfProvenance; +exports.ProvenanceFromJSON = ProvenanceFromJSON; +exports.ProvenanceFromJSONTyped = ProvenanceFromJSONTyped; +exports.ProvenanceToJSON = ProvenanceToJSON; +exports.ProvenanceToJSONTyped = ProvenanceToJSONTyped; /** * Check if a given object implements the Provenance interface. */ function instanceOfProvenance(value) { - let isInstance = true; - isInstance = isInstance && "citation" in value; - isInstance = isInstance && "license" in value; - isInstance = isInstance && "uri" in value; - return isInstance; + if (!('citation' in value) || value['citation'] === undefined) + return false; + if (!('license' in value) || value['license'] === undefined) + return false; + if (!('uri' in value) || value['uri'] === undefined) + return false; + return true; } -exports.instanceOfProvenance = instanceOfProvenance; function ProvenanceFromJSON(json) { return ProvenanceFromJSONTyped(json, false); } -exports.ProvenanceFromJSON = ProvenanceFromJSON; function ProvenanceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,18 +43,16 @@ function ProvenanceFromJSONTyped(json, ignoreDiscriminator) { 'uri': json['uri'], }; } -exports.ProvenanceFromJSONTyped = ProvenanceFromJSONTyped; -function ProvenanceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProvenanceToJSON(json) { + return ProvenanceToJSONTyped(json, false); +} +function ProvenanceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'citation': value.citation, - 'license': value.license, - 'uri': value.uri, + 'citation': value['citation'], + 'license': value['license'], + 'uri': value['uri'], }; } -exports.ProvenanceToJSON = ProvenanceToJSON; diff --git a/typescript/dist/models/ProvenanceEntry.d.ts b/typescript/dist/models/ProvenanceEntry.d.ts index 201905bc..51773c9f 100644 --- a/typescript/dist/models/ProvenanceEntry.d.ts +++ b/typescript/dist/models/ProvenanceEntry.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { DataId } from './DataId'; import type { Provenance } from './Provenance'; +import type { DataId } from './DataId'; /** * * @export @@ -33,7 +33,8 @@ export interface ProvenanceEntry { /** * Check if a given object implements the ProvenanceEntry interface. */ -export declare function instanceOfProvenanceEntry(value: object): boolean; +export declare function instanceOfProvenanceEntry(value: object): value is ProvenanceEntry; export declare function ProvenanceEntryFromJSON(json: any): ProvenanceEntry; export declare function ProvenanceEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProvenanceEntry; -export declare function ProvenanceEntryToJSON(value?: ProvenanceEntry | null): any; +export declare function ProvenanceEntryToJSON(json: any): ProvenanceEntry; +export declare function ProvenanceEntryToJSONTyped(value?: ProvenanceEntry | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ProvenanceEntry.js b/typescript/dist/models/ProvenanceEntry.js index b9de60e0..477e288f 100644 --- a/typescript/dist/models/ProvenanceEntry.js +++ b/typescript/dist/models/ProvenanceEntry.js @@ -13,25 +13,28 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProvenanceEntryToJSON = exports.ProvenanceEntryFromJSONTyped = exports.ProvenanceEntryFromJSON = exports.instanceOfProvenanceEntry = void 0; -const DataId_1 = require("./DataId"); +exports.instanceOfProvenanceEntry = instanceOfProvenanceEntry; +exports.ProvenanceEntryFromJSON = ProvenanceEntryFromJSON; +exports.ProvenanceEntryFromJSONTyped = ProvenanceEntryFromJSONTyped; +exports.ProvenanceEntryToJSON = ProvenanceEntryToJSON; +exports.ProvenanceEntryToJSONTyped = ProvenanceEntryToJSONTyped; const Provenance_1 = require("./Provenance"); +const DataId_1 = require("./DataId"); /** * Check if a given object implements the ProvenanceEntry interface. */ function instanceOfProvenanceEntry(value) { - let isInstance = true; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "provenance" in value; - return isInstance; + if (!('data' in value) || value['data'] === undefined) + return false; + if (!('provenance' in value) || value['provenance'] === undefined) + return false; + return true; } -exports.instanceOfProvenanceEntry = instanceOfProvenanceEntry; function ProvenanceEntryFromJSON(json) { return ProvenanceEntryFromJSONTyped(json, false); } -exports.ProvenanceEntryFromJSON = ProvenanceEntryFromJSON; function ProvenanceEntryFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,17 +42,15 @@ function ProvenanceEntryFromJSONTyped(json, ignoreDiscriminator) { 'provenance': (0, Provenance_1.ProvenanceFromJSON)(json['provenance']), }; } -exports.ProvenanceEntryFromJSONTyped = ProvenanceEntryFromJSONTyped; -function ProvenanceEntryToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProvenanceEntryToJSON(json) { + return ProvenanceEntryToJSONTyped(json, false); +} +function ProvenanceEntryToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'data': (value.data.map(DataId_1.DataIdToJSON)), - 'provenance': (0, Provenance_1.ProvenanceToJSON)(value.provenance), + 'data': (value['data'].map(DataId_1.DataIdToJSON)), + 'provenance': (0, Provenance_1.ProvenanceToJSON)(value['provenance']), }; } -exports.ProvenanceEntryToJSON = ProvenanceEntryToJSON; diff --git a/typescript/dist/models/ProvenanceOutput.d.ts b/typescript/dist/models/ProvenanceOutput.d.ts index 4db62aef..edd3a866 100644 --- a/typescript/dist/models/ProvenanceOutput.d.ts +++ b/typescript/dist/models/ProvenanceOutput.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { DataId } from './DataId'; import type { Provenance } from './Provenance'; +import type { DataId } from './DataId'; /** * * @export @@ -33,7 +33,8 @@ export interface ProvenanceOutput { /** * Check if a given object implements the ProvenanceOutput interface. */ -export declare function instanceOfProvenanceOutput(value: object): boolean; +export declare function instanceOfProvenanceOutput(value: object): value is ProvenanceOutput; export declare function ProvenanceOutputFromJSON(json: any): ProvenanceOutput; export declare function ProvenanceOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProvenanceOutput; -export declare function ProvenanceOutputToJSON(value?: ProvenanceOutput | null): any; +export declare function ProvenanceOutputToJSON(json: any): ProvenanceOutput; +export declare function ProvenanceOutputToJSONTyped(value?: ProvenanceOutput | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ProvenanceOutput.js b/typescript/dist/models/ProvenanceOutput.js index b1174c01..7deba758 100644 --- a/typescript/dist/models/ProvenanceOutput.js +++ b/typescript/dist/models/ProvenanceOutput.js @@ -13,43 +13,42 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProvenanceOutputToJSON = exports.ProvenanceOutputFromJSONTyped = exports.ProvenanceOutputFromJSON = exports.instanceOfProvenanceOutput = void 0; -const runtime_1 = require("../runtime"); -const DataId_1 = require("./DataId"); +exports.instanceOfProvenanceOutput = instanceOfProvenanceOutput; +exports.ProvenanceOutputFromJSON = ProvenanceOutputFromJSON; +exports.ProvenanceOutputFromJSONTyped = ProvenanceOutputFromJSONTyped; +exports.ProvenanceOutputToJSON = ProvenanceOutputToJSON; +exports.ProvenanceOutputToJSONTyped = ProvenanceOutputToJSONTyped; const Provenance_1 = require("./Provenance"); +const DataId_1 = require("./DataId"); /** * Check if a given object implements the ProvenanceOutput interface. */ function instanceOfProvenanceOutput(value) { - let isInstance = true; - isInstance = isInstance && "data" in value; - return isInstance; + if (!('data' in value) || value['data'] === undefined) + return false; + return true; } -exports.instanceOfProvenanceOutput = instanceOfProvenanceOutput; function ProvenanceOutputFromJSON(json) { return ProvenanceOutputFromJSONTyped(json, false); } -exports.ProvenanceOutputFromJSON = ProvenanceOutputFromJSON; function ProvenanceOutputFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'data': (0, DataId_1.DataIdFromJSON)(json['data']), - 'provenance': !(0, runtime_1.exists)(json, 'provenance') ? undefined : (json['provenance'] === null ? null : json['provenance'].map(Provenance_1.ProvenanceFromJSON)), + 'provenance': json['provenance'] == null ? undefined : (json['provenance'].map(Provenance_1.ProvenanceFromJSON)), }; } -exports.ProvenanceOutputFromJSONTyped = ProvenanceOutputFromJSONTyped; -function ProvenanceOutputToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProvenanceOutputToJSON(json) { + return ProvenanceOutputToJSONTyped(json, false); +} +function ProvenanceOutputToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'data': (0, DataId_1.DataIdToJSON)(value.data), - 'provenance': value.provenance === undefined ? undefined : (value.provenance === null ? null : value.provenance.map(Provenance_1.ProvenanceToJSON)), + 'data': (0, DataId_1.DataIdToJSON)(value['data']), + 'provenance': value['provenance'] == null ? undefined : (value['provenance'].map(Provenance_1.ProvenanceToJSON)), }; } -exports.ProvenanceOutputToJSON = ProvenanceOutputToJSON; diff --git a/typescript/dist/models/Provenances.d.ts b/typescript/dist/models/Provenances.d.ts index 3396296e..6b34eb12 100644 --- a/typescript/dist/models/Provenances.d.ts +++ b/typescript/dist/models/Provenances.d.ts @@ -26,7 +26,8 @@ export interface Provenances { /** * Check if a given object implements the Provenances interface. */ -export declare function instanceOfProvenances(value: object): boolean; +export declare function instanceOfProvenances(value: object): value is Provenances; export declare function ProvenancesFromJSON(json: any): Provenances; export declare function ProvenancesFromJSONTyped(json: any, ignoreDiscriminator: boolean): Provenances; -export declare function ProvenancesToJSON(value?: Provenances | null): any; +export declare function ProvenancesToJSON(json: any): Provenances; +export declare function ProvenancesToJSONTyped(value?: Provenances | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Provenances.js b/typescript/dist/models/Provenances.js index e9aaee1a..6d580e4e 100644 --- a/typescript/dist/models/Provenances.js +++ b/typescript/dist/models/Provenances.js @@ -13,39 +13,39 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProvenancesToJSON = exports.ProvenancesFromJSONTyped = exports.ProvenancesFromJSON = exports.instanceOfProvenances = void 0; +exports.instanceOfProvenances = instanceOfProvenances; +exports.ProvenancesFromJSON = ProvenancesFromJSON; +exports.ProvenancesFromJSONTyped = ProvenancesFromJSONTyped; +exports.ProvenancesToJSON = ProvenancesToJSON; +exports.ProvenancesToJSONTyped = ProvenancesToJSONTyped; const Provenance_1 = require("./Provenance"); /** * Check if a given object implements the Provenances interface. */ function instanceOfProvenances(value) { - let isInstance = true; - isInstance = isInstance && "provenances" in value; - return isInstance; + if (!('provenances' in value) || value['provenances'] === undefined) + return false; + return true; } -exports.instanceOfProvenances = instanceOfProvenances; function ProvenancesFromJSON(json) { return ProvenancesFromJSONTyped(json, false); } -exports.ProvenancesFromJSON = ProvenancesFromJSON; function ProvenancesFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'provenances': (json['provenances'].map(Provenance_1.ProvenanceFromJSON)), }; } -exports.ProvenancesFromJSONTyped = ProvenancesFromJSONTyped; -function ProvenancesToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProvenancesToJSON(json) { + return ProvenancesToJSONTyped(json, false); +} +function ProvenancesToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'provenances': (value.provenances.map(Provenance_1.ProvenanceToJSON)), + 'provenances': (value['provenances'].map(Provenance_1.ProvenanceToJSON)), }; } -exports.ProvenancesToJSON = ProvenancesToJSON; diff --git a/typescript/dist/models/ProviderCapabilities.d.ts b/typescript/dist/models/ProviderCapabilities.d.ts index 09c7c0ed..9c7abe92 100644 --- a/typescript/dist/models/ProviderCapabilities.d.ts +++ b/typescript/dist/models/ProviderCapabilities.d.ts @@ -32,7 +32,8 @@ export interface ProviderCapabilities { /** * Check if a given object implements the ProviderCapabilities interface. */ -export declare function instanceOfProviderCapabilities(value: object): boolean; +export declare function instanceOfProviderCapabilities(value: object): value is ProviderCapabilities; export declare function ProviderCapabilitiesFromJSON(json: any): ProviderCapabilities; export declare function ProviderCapabilitiesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderCapabilities; -export declare function ProviderCapabilitiesToJSON(value?: ProviderCapabilities | null): any; +export declare function ProviderCapabilitiesToJSON(json: any): ProviderCapabilities; +export declare function ProviderCapabilitiesToJSONTyped(value?: ProviderCapabilities | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ProviderCapabilities.js b/typescript/dist/models/ProviderCapabilities.js index 9b420f9b..241b5935 100644 --- a/typescript/dist/models/ProviderCapabilities.js +++ b/typescript/dist/models/ProviderCapabilities.js @@ -13,24 +13,27 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProviderCapabilitiesToJSON = exports.ProviderCapabilitiesFromJSONTyped = exports.ProviderCapabilitiesFromJSON = exports.instanceOfProviderCapabilities = void 0; +exports.instanceOfProviderCapabilities = instanceOfProviderCapabilities; +exports.ProviderCapabilitiesFromJSON = ProviderCapabilitiesFromJSON; +exports.ProviderCapabilitiesFromJSONTyped = ProviderCapabilitiesFromJSONTyped; +exports.ProviderCapabilitiesToJSON = ProviderCapabilitiesToJSON; +exports.ProviderCapabilitiesToJSONTyped = ProviderCapabilitiesToJSONTyped; const SearchCapabilities_1 = require("./SearchCapabilities"); /** * Check if a given object implements the ProviderCapabilities interface. */ function instanceOfProviderCapabilities(value) { - let isInstance = true; - isInstance = isInstance && "listing" in value; - isInstance = isInstance && "search" in value; - return isInstance; + if (!('listing' in value) || value['listing'] === undefined) + return false; + if (!('search' in value) || value['search'] === undefined) + return false; + return true; } -exports.instanceOfProviderCapabilities = instanceOfProviderCapabilities; function ProviderCapabilitiesFromJSON(json) { return ProviderCapabilitiesFromJSONTyped(json, false); } -exports.ProviderCapabilitiesFromJSON = ProviderCapabilitiesFromJSON; function ProviderCapabilitiesFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,17 +41,15 @@ function ProviderCapabilitiesFromJSONTyped(json, ignoreDiscriminator) { 'search': (0, SearchCapabilities_1.SearchCapabilitiesFromJSON)(json['search']), }; } -exports.ProviderCapabilitiesFromJSONTyped = ProviderCapabilitiesFromJSONTyped; -function ProviderCapabilitiesToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProviderCapabilitiesToJSON(json) { + return ProviderCapabilitiesToJSONTyped(json, false); +} +function ProviderCapabilitiesToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'listing': value.listing, - 'search': (0, SearchCapabilities_1.SearchCapabilitiesToJSON)(value.search), + 'listing': value['listing'], + 'search': (0, SearchCapabilities_1.SearchCapabilitiesToJSON)(value['search']), }; } -exports.ProviderCapabilitiesToJSON = ProviderCapabilitiesToJSON; diff --git a/typescript/dist/models/ProviderLayerCollectionId.d.ts b/typescript/dist/models/ProviderLayerCollectionId.d.ts index 2ee909ae..c92867ec 100644 --- a/typescript/dist/models/ProviderLayerCollectionId.d.ts +++ b/typescript/dist/models/ProviderLayerCollectionId.d.ts @@ -31,7 +31,8 @@ export interface ProviderLayerCollectionId { /** * Check if a given object implements the ProviderLayerCollectionId interface. */ -export declare function instanceOfProviderLayerCollectionId(value: object): boolean; +export declare function instanceOfProviderLayerCollectionId(value: object): value is ProviderLayerCollectionId; export declare function ProviderLayerCollectionIdFromJSON(json: any): ProviderLayerCollectionId; export declare function ProviderLayerCollectionIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderLayerCollectionId; -export declare function ProviderLayerCollectionIdToJSON(value?: ProviderLayerCollectionId | null): any; +export declare function ProviderLayerCollectionIdToJSON(json: any): ProviderLayerCollectionId; +export declare function ProviderLayerCollectionIdToJSONTyped(value?: ProviderLayerCollectionId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ProviderLayerCollectionId.js b/typescript/dist/models/ProviderLayerCollectionId.js index 4aee36ca..f24d2dab 100644 --- a/typescript/dist/models/ProviderLayerCollectionId.js +++ b/typescript/dist/models/ProviderLayerCollectionId.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProviderLayerCollectionIdToJSON = exports.ProviderLayerCollectionIdFromJSONTyped = exports.ProviderLayerCollectionIdFromJSON = exports.instanceOfProviderLayerCollectionId = void 0; +exports.instanceOfProviderLayerCollectionId = instanceOfProviderLayerCollectionId; +exports.ProviderLayerCollectionIdFromJSON = ProviderLayerCollectionIdFromJSON; +exports.ProviderLayerCollectionIdFromJSONTyped = ProviderLayerCollectionIdFromJSONTyped; +exports.ProviderLayerCollectionIdToJSON = ProviderLayerCollectionIdToJSON; +exports.ProviderLayerCollectionIdToJSONTyped = ProviderLayerCollectionIdToJSONTyped; /** * Check if a given object implements the ProviderLayerCollectionId interface. */ function instanceOfProviderLayerCollectionId(value) { - let isInstance = true; - isInstance = isInstance && "collectionId" in value; - isInstance = isInstance && "providerId" in value; - return isInstance; + if (!('collectionId' in value) || value['collectionId'] === undefined) + return false; + if (!('providerId' in value) || value['providerId'] === undefined) + return false; + return true; } -exports.instanceOfProviderLayerCollectionId = instanceOfProviderLayerCollectionId; function ProviderLayerCollectionIdFromJSON(json) { return ProviderLayerCollectionIdFromJSONTyped(json, false); } -exports.ProviderLayerCollectionIdFromJSON = ProviderLayerCollectionIdFromJSON; function ProviderLayerCollectionIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function ProviderLayerCollectionIdFromJSONTyped(json, ignoreDiscriminator) { 'providerId': json['providerId'], }; } -exports.ProviderLayerCollectionIdFromJSONTyped = ProviderLayerCollectionIdFromJSONTyped; -function ProviderLayerCollectionIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProviderLayerCollectionIdToJSON(json) { + return ProviderLayerCollectionIdToJSONTyped(json, false); +} +function ProviderLayerCollectionIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'collectionId': value.collectionId, - 'providerId': value.providerId, + 'collectionId': value['collectionId'], + 'providerId': value['providerId'], }; } -exports.ProviderLayerCollectionIdToJSON = ProviderLayerCollectionIdToJSON; diff --git a/typescript/dist/models/ProviderLayerId.d.ts b/typescript/dist/models/ProviderLayerId.d.ts index a116a721..bd3e3489 100644 --- a/typescript/dist/models/ProviderLayerId.d.ts +++ b/typescript/dist/models/ProviderLayerId.d.ts @@ -31,7 +31,8 @@ export interface ProviderLayerId { /** * Check if a given object implements the ProviderLayerId interface. */ -export declare function instanceOfProviderLayerId(value: object): boolean; +export declare function instanceOfProviderLayerId(value: object): value is ProviderLayerId; export declare function ProviderLayerIdFromJSON(json: any): ProviderLayerId; export declare function ProviderLayerIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderLayerId; -export declare function ProviderLayerIdToJSON(value?: ProviderLayerId | null): any; +export declare function ProviderLayerIdToJSON(json: any): ProviderLayerId; +export declare function ProviderLayerIdToJSONTyped(value?: ProviderLayerId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ProviderLayerId.js b/typescript/dist/models/ProviderLayerId.js index af0db8ed..90acf225 100644 --- a/typescript/dist/models/ProviderLayerId.js +++ b/typescript/dist/models/ProviderLayerId.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ProviderLayerIdToJSON = exports.ProviderLayerIdFromJSONTyped = exports.ProviderLayerIdFromJSON = exports.instanceOfProviderLayerId = void 0; +exports.instanceOfProviderLayerId = instanceOfProviderLayerId; +exports.ProviderLayerIdFromJSON = ProviderLayerIdFromJSON; +exports.ProviderLayerIdFromJSONTyped = ProviderLayerIdFromJSONTyped; +exports.ProviderLayerIdToJSON = ProviderLayerIdToJSON; +exports.ProviderLayerIdToJSONTyped = ProviderLayerIdToJSONTyped; /** * Check if a given object implements the ProviderLayerId interface. */ function instanceOfProviderLayerId(value) { - let isInstance = true; - isInstance = isInstance && "layerId" in value; - isInstance = isInstance && "providerId" in value; - return isInstance; + if (!('layerId' in value) || value['layerId'] === undefined) + return false; + if (!('providerId' in value) || value['providerId'] === undefined) + return false; + return true; } -exports.instanceOfProviderLayerId = instanceOfProviderLayerId; function ProviderLayerIdFromJSON(json) { return ProviderLayerIdFromJSONTyped(json, false); } -exports.ProviderLayerIdFromJSON = ProviderLayerIdFromJSON; function ProviderLayerIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function ProviderLayerIdFromJSONTyped(json, ignoreDiscriminator) { 'providerId': json['providerId'], }; } -exports.ProviderLayerIdFromJSONTyped = ProviderLayerIdFromJSONTyped; -function ProviderLayerIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ProviderLayerIdToJSON(json) { + return ProviderLayerIdToJSONTyped(json, false); +} +function ProviderLayerIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'layerId': value.layerId, - 'providerId': value.providerId, + 'layerId': value['layerId'], + 'providerId': value['providerId'], }; } -exports.ProviderLayerIdToJSON = ProviderLayerIdToJSON; diff --git a/typescript/dist/models/Quota.d.ts b/typescript/dist/models/Quota.d.ts index aacaf997..2bfabd2d 100644 --- a/typescript/dist/models/Quota.d.ts +++ b/typescript/dist/models/Quota.d.ts @@ -31,7 +31,8 @@ export interface Quota { /** * Check if a given object implements the Quota interface. */ -export declare function instanceOfQuota(value: object): boolean; +export declare function instanceOfQuota(value: object): value is Quota; export declare function QuotaFromJSON(json: any): Quota; export declare function QuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): Quota; -export declare function QuotaToJSON(value?: Quota | null): any; +export declare function QuotaToJSON(json: any): Quota; +export declare function QuotaToJSONTyped(value?: Quota | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Quota.js b/typescript/dist/models/Quota.js index 407e151b..0dfaa70b 100644 --- a/typescript/dist/models/Quota.js +++ b/typescript/dist/models/Quota.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.QuotaToJSON = exports.QuotaFromJSONTyped = exports.QuotaFromJSON = exports.instanceOfQuota = void 0; +exports.instanceOfQuota = instanceOfQuota; +exports.QuotaFromJSON = QuotaFromJSON; +exports.QuotaFromJSONTyped = QuotaFromJSONTyped; +exports.QuotaToJSON = QuotaToJSON; +exports.QuotaToJSONTyped = QuotaToJSONTyped; /** * Check if a given object implements the Quota interface. */ function instanceOfQuota(value) { - let isInstance = true; - isInstance = isInstance && "available" in value; - isInstance = isInstance && "used" in value; - return isInstance; + if (!('available' in value) || value['available'] === undefined) + return false; + if (!('used' in value) || value['used'] === undefined) + return false; + return true; } -exports.instanceOfQuota = instanceOfQuota; function QuotaFromJSON(json) { return QuotaFromJSONTyped(json, false); } -exports.QuotaFromJSON = QuotaFromJSON; function QuotaFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function QuotaFromJSONTyped(json, ignoreDiscriminator) { 'used': json['used'], }; } -exports.QuotaFromJSONTyped = QuotaFromJSONTyped; -function QuotaToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function QuotaToJSON(json) { + return QuotaToJSONTyped(json, false); +} +function QuotaToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'available': value.available, - 'used': value.used, + 'available': value['available'], + 'used': value['used'], }; } -exports.QuotaToJSON = QuotaToJSON; diff --git a/typescript/dist/models/RasterBandDescriptor.d.ts b/typescript/dist/models/RasterBandDescriptor.d.ts index f92d1e13..39902342 100644 --- a/typescript/dist/models/RasterBandDescriptor.d.ts +++ b/typescript/dist/models/RasterBandDescriptor.d.ts @@ -32,7 +32,8 @@ export interface RasterBandDescriptor { /** * Check if a given object implements the RasterBandDescriptor interface. */ -export declare function instanceOfRasterBandDescriptor(value: object): boolean; +export declare function instanceOfRasterBandDescriptor(value: object): value is RasterBandDescriptor; export declare function RasterBandDescriptorFromJSON(json: any): RasterBandDescriptor; export declare function RasterBandDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterBandDescriptor; -export declare function RasterBandDescriptorToJSON(value?: RasterBandDescriptor | null): any; +export declare function RasterBandDescriptorToJSON(json: any): RasterBandDescriptor; +export declare function RasterBandDescriptorToJSONTyped(value?: RasterBandDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/RasterBandDescriptor.js b/typescript/dist/models/RasterBandDescriptor.js index b4125e01..611ffe58 100644 --- a/typescript/dist/models/RasterBandDescriptor.js +++ b/typescript/dist/models/RasterBandDescriptor.js @@ -13,24 +13,27 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RasterBandDescriptorToJSON = exports.RasterBandDescriptorFromJSONTyped = exports.RasterBandDescriptorFromJSON = exports.instanceOfRasterBandDescriptor = void 0; +exports.instanceOfRasterBandDescriptor = instanceOfRasterBandDescriptor; +exports.RasterBandDescriptorFromJSON = RasterBandDescriptorFromJSON; +exports.RasterBandDescriptorFromJSONTyped = RasterBandDescriptorFromJSONTyped; +exports.RasterBandDescriptorToJSON = RasterBandDescriptorToJSON; +exports.RasterBandDescriptorToJSONTyped = RasterBandDescriptorToJSONTyped; const Measurement_1 = require("./Measurement"); /** * Check if a given object implements the RasterBandDescriptor interface. */ function instanceOfRasterBandDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "measurement" in value; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('measurement' in value) || value['measurement'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } -exports.instanceOfRasterBandDescriptor = instanceOfRasterBandDescriptor; function RasterBandDescriptorFromJSON(json) { return RasterBandDescriptorFromJSONTyped(json, false); } -exports.RasterBandDescriptorFromJSON = RasterBandDescriptorFromJSON; function RasterBandDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,17 +41,15 @@ function RasterBandDescriptorFromJSONTyped(json, ignoreDiscriminator) { 'name': json['name'], }; } -exports.RasterBandDescriptorFromJSONTyped = RasterBandDescriptorFromJSONTyped; -function RasterBandDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function RasterBandDescriptorToJSON(json) { + return RasterBandDescriptorToJSONTyped(json, false); +} +function RasterBandDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'measurement': (0, Measurement_1.MeasurementToJSON)(value.measurement), - 'name': value.name, + 'measurement': (0, Measurement_1.MeasurementToJSON)(value['measurement']), + 'name': value['name'], }; } -exports.RasterBandDescriptorToJSON = RasterBandDescriptorToJSON; diff --git a/typescript/dist/models/RasterColorizer.d.ts b/typescript/dist/models/RasterColorizer.d.ts index 419a61ef..5d339746 100644 --- a/typescript/dist/models/RasterColorizer.d.ts +++ b/typescript/dist/models/RasterColorizer.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { MultiBandRasterColorizer } from './MultiBandRasterColorizer'; -import { SingleBandRasterColorizer } from './SingleBandRasterColorizer'; +import type { MultiBandRasterColorizer } from './MultiBandRasterColorizer'; +import type { SingleBandRasterColorizer } from './SingleBandRasterColorizer'; /** * @type RasterColorizer * @@ -23,4 +23,5 @@ export type RasterColorizer = { } & SingleBandRasterColorizer; export declare function RasterColorizerFromJSON(json: any): RasterColorizer; export declare function RasterColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterColorizer; -export declare function RasterColorizerToJSON(value?: RasterColorizer | null): any; +export declare function RasterColorizerToJSON(json: any): any; +export declare function RasterColorizerToJSONTyped(value?: RasterColorizer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/RasterColorizer.js b/typescript/dist/models/RasterColorizer.js index 4323cec5..3ff3db37 100644 --- a/typescript/dist/models/RasterColorizer.js +++ b/typescript/dist/models/RasterColorizer.js @@ -13,41 +13,41 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RasterColorizerToJSON = exports.RasterColorizerFromJSONTyped = exports.RasterColorizerFromJSON = void 0; +exports.RasterColorizerFromJSON = RasterColorizerFromJSON; +exports.RasterColorizerFromJSONTyped = RasterColorizerFromJSONTyped; +exports.RasterColorizerToJSON = RasterColorizerToJSON; +exports.RasterColorizerToJSONTyped = RasterColorizerToJSONTyped; const MultiBandRasterColorizer_1 = require("./MultiBandRasterColorizer"); const SingleBandRasterColorizer_1 = require("./SingleBandRasterColorizer"); function RasterColorizerFromJSON(json) { return RasterColorizerFromJSONTyped(json, false); } -exports.RasterColorizerFromJSON = RasterColorizerFromJSON; function RasterColorizerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'multiBand': - return Object.assign(Object.assign({}, (0, MultiBandRasterColorizer_1.MultiBandRasterColorizerFromJSONTyped)(json, true)), { type: 'multiBand' }); + return Object.assign({}, (0, MultiBandRasterColorizer_1.MultiBandRasterColorizerFromJSONTyped)(json, true), { type: 'multiBand' }); case 'singleBand': - return Object.assign(Object.assign({}, (0, SingleBandRasterColorizer_1.SingleBandRasterColorizerFromJSONTyped)(json, true)), { type: 'singleBand' }); + return Object.assign({}, (0, SingleBandRasterColorizer_1.SingleBandRasterColorizerFromJSONTyped)(json, true), { type: 'singleBand' }); default: throw new Error(`No variant of RasterColorizer exists with 'type=${json['type']}'`); } } -exports.RasterColorizerFromJSONTyped = RasterColorizerFromJSONTyped; -function RasterColorizerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function RasterColorizerToJSON(json) { + return RasterColorizerToJSONTyped(json, false); +} +function RasterColorizerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'multiBand': - return (0, MultiBandRasterColorizer_1.MultiBandRasterColorizerToJSON)(value); + return Object.assign({}, (0, MultiBandRasterColorizer_1.MultiBandRasterColorizerToJSON)(value), { type: 'multiBand' }); case 'singleBand': - return (0, SingleBandRasterColorizer_1.SingleBandRasterColorizerToJSON)(value); + return Object.assign({}, (0, SingleBandRasterColorizer_1.SingleBandRasterColorizerToJSON)(value), { type: 'singleBand' }); default: throw new Error(`No variant of RasterColorizer exists with 'type=${value['type']}'`); } } -exports.RasterColorizerToJSON = RasterColorizerToJSON; diff --git a/typescript/dist/models/RasterDataType.d.ts b/typescript/dist/models/RasterDataType.d.ts index 1bc186b0..7adc7ec7 100644 --- a/typescript/dist/models/RasterDataType.d.ts +++ b/typescript/dist/models/RasterDataType.d.ts @@ -26,6 +26,8 @@ export declare const RasterDataType: { readonly F64: "F64"; }; export type RasterDataType = typeof RasterDataType[keyof typeof RasterDataType]; +export declare function instanceOfRasterDataType(value: any): boolean; export declare function RasterDataTypeFromJSON(json: any): RasterDataType; export declare function RasterDataTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterDataType; export declare function RasterDataTypeToJSON(value?: RasterDataType | null): any; +export declare function RasterDataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): RasterDataType; diff --git a/typescript/dist/models/RasterDataType.js b/typescript/dist/models/RasterDataType.js index b7fcabfe..320fa9db 100644 --- a/typescript/dist/models/RasterDataType.js +++ b/typescript/dist/models/RasterDataType.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RasterDataTypeToJSON = exports.RasterDataTypeFromJSONTyped = exports.RasterDataTypeFromJSON = exports.RasterDataType = void 0; +exports.RasterDataType = void 0; +exports.instanceOfRasterDataType = instanceOfRasterDataType; +exports.RasterDataTypeFromJSON = RasterDataTypeFromJSON; +exports.RasterDataTypeFromJSONTyped = RasterDataTypeFromJSONTyped; +exports.RasterDataTypeToJSON = RasterDataTypeToJSON; +exports.RasterDataTypeToJSONTyped = RasterDataTypeToJSONTyped; /** * * @export @@ -30,15 +35,25 @@ exports.RasterDataType = { F32: 'F32', F64: 'F64' }; +function instanceOfRasterDataType(value) { + for (const key in exports.RasterDataType) { + if (Object.prototype.hasOwnProperty.call(exports.RasterDataType, key)) { + if (exports.RasterDataType[key] === value) { + return true; + } + } + } + return false; +} function RasterDataTypeFromJSON(json) { return RasterDataTypeFromJSONTyped(json, false); } -exports.RasterDataTypeFromJSON = RasterDataTypeFromJSON; function RasterDataTypeFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.RasterDataTypeFromJSONTyped = RasterDataTypeFromJSONTyped; function RasterDataTypeToJSON(value) { return value; } -exports.RasterDataTypeToJSON = RasterDataTypeToJSON; +function RasterDataTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/RasterDatasetFromWorkflow.d.ts b/typescript/dist/models/RasterDatasetFromWorkflow.d.ts index befa1f2f..33426d0c 100644 --- a/typescript/dist/models/RasterDatasetFromWorkflow.d.ts +++ b/typescript/dist/models/RasterDatasetFromWorkflow.d.ts @@ -50,7 +50,8 @@ export interface RasterDatasetFromWorkflow { /** * Check if a given object implements the RasterDatasetFromWorkflow interface. */ -export declare function instanceOfRasterDatasetFromWorkflow(value: object): boolean; +export declare function instanceOfRasterDatasetFromWorkflow(value: object): value is RasterDatasetFromWorkflow; export declare function RasterDatasetFromWorkflowFromJSON(json: any): RasterDatasetFromWorkflow; export declare function RasterDatasetFromWorkflowFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterDatasetFromWorkflow; -export declare function RasterDatasetFromWorkflowToJSON(value?: RasterDatasetFromWorkflow | null): any; +export declare function RasterDatasetFromWorkflowToJSON(json: any): RasterDatasetFromWorkflow; +export declare function RasterDatasetFromWorkflowToJSONTyped(value?: RasterDatasetFromWorkflow | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/RasterDatasetFromWorkflow.js b/typescript/dist/models/RasterDatasetFromWorkflow.js index 4c67f7c9..3405d194 100644 --- a/typescript/dist/models/RasterDatasetFromWorkflow.js +++ b/typescript/dist/models/RasterDatasetFromWorkflow.js @@ -13,49 +13,49 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RasterDatasetFromWorkflowToJSON = exports.RasterDatasetFromWorkflowFromJSONTyped = exports.RasterDatasetFromWorkflowFromJSON = exports.instanceOfRasterDatasetFromWorkflow = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfRasterDatasetFromWorkflow = instanceOfRasterDatasetFromWorkflow; +exports.RasterDatasetFromWorkflowFromJSON = RasterDatasetFromWorkflowFromJSON; +exports.RasterDatasetFromWorkflowFromJSONTyped = RasterDatasetFromWorkflowFromJSONTyped; +exports.RasterDatasetFromWorkflowToJSON = RasterDatasetFromWorkflowToJSON; +exports.RasterDatasetFromWorkflowToJSONTyped = RasterDatasetFromWorkflowToJSONTyped; const RasterQueryRectangle_1 = require("./RasterQueryRectangle"); /** * Check if a given object implements the RasterDatasetFromWorkflow interface. */ function instanceOfRasterDatasetFromWorkflow(value) { - let isInstance = true; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "query" in value; - return isInstance; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('query' in value) || value['query'] === undefined) + return false; + return true; } -exports.instanceOfRasterDatasetFromWorkflow = instanceOfRasterDatasetFromWorkflow; function RasterDatasetFromWorkflowFromJSON(json) { return RasterDatasetFromWorkflowFromJSONTyped(json, false); } -exports.RasterDatasetFromWorkflowFromJSON = RasterDatasetFromWorkflowFromJSON; function RasterDatasetFromWorkflowFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'asCog': !(0, runtime_1.exists)(json, 'asCog') ? undefined : json['asCog'], - 'description': !(0, runtime_1.exists)(json, 'description') ? undefined : json['description'], + 'asCog': json['asCog'] == null ? undefined : json['asCog'], + 'description': json['description'] == null ? undefined : json['description'], 'displayName': json['displayName'], - 'name': !(0, runtime_1.exists)(json, 'name') ? undefined : json['name'], + 'name': json['name'] == null ? undefined : json['name'], 'query': (0, RasterQueryRectangle_1.RasterQueryRectangleFromJSON)(json['query']), }; } -exports.RasterDatasetFromWorkflowFromJSONTyped = RasterDatasetFromWorkflowFromJSONTyped; -function RasterDatasetFromWorkflowToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function RasterDatasetFromWorkflowToJSON(json) { + return RasterDatasetFromWorkflowToJSONTyped(json, false); +} +function RasterDatasetFromWorkflowToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'asCog': value.asCog, - 'description': value.description, - 'displayName': value.displayName, - 'name': value.name, - 'query': (0, RasterQueryRectangle_1.RasterQueryRectangleToJSON)(value.query), + 'asCog': value['asCog'], + 'description': value['description'], + 'displayName': value['displayName'], + 'name': value['name'], + 'query': (0, RasterQueryRectangle_1.RasterQueryRectangleToJSON)(value['query']), }; } -exports.RasterDatasetFromWorkflowToJSON = RasterDatasetFromWorkflowToJSON; diff --git a/typescript/dist/models/RasterDatasetFromWorkflowResult.d.ts b/typescript/dist/models/RasterDatasetFromWorkflowResult.d.ts index ae2bc1b7..8dc5b237 100644 --- a/typescript/dist/models/RasterDatasetFromWorkflowResult.d.ts +++ b/typescript/dist/models/RasterDatasetFromWorkflowResult.d.ts @@ -31,7 +31,8 @@ export interface RasterDatasetFromWorkflowResult { /** * Check if a given object implements the RasterDatasetFromWorkflowResult interface. */ -export declare function instanceOfRasterDatasetFromWorkflowResult(value: object): boolean; +export declare function instanceOfRasterDatasetFromWorkflowResult(value: object): value is RasterDatasetFromWorkflowResult; export declare function RasterDatasetFromWorkflowResultFromJSON(json: any): RasterDatasetFromWorkflowResult; export declare function RasterDatasetFromWorkflowResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterDatasetFromWorkflowResult; -export declare function RasterDatasetFromWorkflowResultToJSON(value?: RasterDatasetFromWorkflowResult | null): any; +export declare function RasterDatasetFromWorkflowResultToJSON(json: any): RasterDatasetFromWorkflowResult; +export declare function RasterDatasetFromWorkflowResultToJSONTyped(value?: RasterDatasetFromWorkflowResult | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/RasterDatasetFromWorkflowResult.js b/typescript/dist/models/RasterDatasetFromWorkflowResult.js index a533619b..3da74556 100644 --- a/typescript/dist/models/RasterDatasetFromWorkflowResult.js +++ b/typescript/dist/models/RasterDatasetFromWorkflowResult.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RasterDatasetFromWorkflowResultToJSON = exports.RasterDatasetFromWorkflowResultFromJSONTyped = exports.RasterDatasetFromWorkflowResultFromJSON = exports.instanceOfRasterDatasetFromWorkflowResult = void 0; +exports.instanceOfRasterDatasetFromWorkflowResult = instanceOfRasterDatasetFromWorkflowResult; +exports.RasterDatasetFromWorkflowResultFromJSON = RasterDatasetFromWorkflowResultFromJSON; +exports.RasterDatasetFromWorkflowResultFromJSONTyped = RasterDatasetFromWorkflowResultFromJSONTyped; +exports.RasterDatasetFromWorkflowResultToJSON = RasterDatasetFromWorkflowResultToJSON; +exports.RasterDatasetFromWorkflowResultToJSONTyped = RasterDatasetFromWorkflowResultToJSONTyped; /** * Check if a given object implements the RasterDatasetFromWorkflowResult interface. */ function instanceOfRasterDatasetFromWorkflowResult(value) { - let isInstance = true; - isInstance = isInstance && "dataset" in value; - isInstance = isInstance && "upload" in value; - return isInstance; + if (!('dataset' in value) || value['dataset'] === undefined) + return false; + if (!('upload' in value) || value['upload'] === undefined) + return false; + return true; } -exports.instanceOfRasterDatasetFromWorkflowResult = instanceOfRasterDatasetFromWorkflowResult; function RasterDatasetFromWorkflowResultFromJSON(json) { return RasterDatasetFromWorkflowResultFromJSONTyped(json, false); } -exports.RasterDatasetFromWorkflowResultFromJSON = RasterDatasetFromWorkflowResultFromJSON; function RasterDatasetFromWorkflowResultFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function RasterDatasetFromWorkflowResultFromJSONTyped(json, ignoreDiscriminator) 'upload': json['upload'], }; } -exports.RasterDatasetFromWorkflowResultFromJSONTyped = RasterDatasetFromWorkflowResultFromJSONTyped; -function RasterDatasetFromWorkflowResultToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function RasterDatasetFromWorkflowResultToJSON(json) { + return RasterDatasetFromWorkflowResultToJSONTyped(json, false); +} +function RasterDatasetFromWorkflowResultToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'dataset': value.dataset, - 'upload': value.upload, + 'dataset': value['dataset'], + 'upload': value['upload'], }; } -exports.RasterDatasetFromWorkflowResultToJSON = RasterDatasetFromWorkflowResultToJSON; diff --git a/typescript/dist/models/RasterPropertiesEntryType.d.ts b/typescript/dist/models/RasterPropertiesEntryType.d.ts index e099bc24..f77ca49d 100644 --- a/typescript/dist/models/RasterPropertiesEntryType.d.ts +++ b/typescript/dist/models/RasterPropertiesEntryType.d.ts @@ -18,6 +18,8 @@ export declare const RasterPropertiesEntryType: { readonly String: "String"; }; export type RasterPropertiesEntryType = typeof RasterPropertiesEntryType[keyof typeof RasterPropertiesEntryType]; +export declare function instanceOfRasterPropertiesEntryType(value: any): boolean; export declare function RasterPropertiesEntryTypeFromJSON(json: any): RasterPropertiesEntryType; export declare function RasterPropertiesEntryTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterPropertiesEntryType; export declare function RasterPropertiesEntryTypeToJSON(value?: RasterPropertiesEntryType | null): any; +export declare function RasterPropertiesEntryTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): RasterPropertiesEntryType; diff --git a/typescript/dist/models/RasterPropertiesEntryType.js b/typescript/dist/models/RasterPropertiesEntryType.js index 84175e6e..d18878b0 100644 --- a/typescript/dist/models/RasterPropertiesEntryType.js +++ b/typescript/dist/models/RasterPropertiesEntryType.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RasterPropertiesEntryTypeToJSON = exports.RasterPropertiesEntryTypeFromJSONTyped = exports.RasterPropertiesEntryTypeFromJSON = exports.RasterPropertiesEntryType = void 0; +exports.RasterPropertiesEntryType = void 0; +exports.instanceOfRasterPropertiesEntryType = instanceOfRasterPropertiesEntryType; +exports.RasterPropertiesEntryTypeFromJSON = RasterPropertiesEntryTypeFromJSON; +exports.RasterPropertiesEntryTypeFromJSONTyped = RasterPropertiesEntryTypeFromJSONTyped; +exports.RasterPropertiesEntryTypeToJSON = RasterPropertiesEntryTypeToJSON; +exports.RasterPropertiesEntryTypeToJSONTyped = RasterPropertiesEntryTypeToJSONTyped; /** * * @export @@ -22,15 +27,25 @@ exports.RasterPropertiesEntryType = { Number: 'Number', String: 'String' }; +function instanceOfRasterPropertiesEntryType(value) { + for (const key in exports.RasterPropertiesEntryType) { + if (Object.prototype.hasOwnProperty.call(exports.RasterPropertiesEntryType, key)) { + if (exports.RasterPropertiesEntryType[key] === value) { + return true; + } + } + } + return false; +} function RasterPropertiesEntryTypeFromJSON(json) { return RasterPropertiesEntryTypeFromJSONTyped(json, false); } -exports.RasterPropertiesEntryTypeFromJSON = RasterPropertiesEntryTypeFromJSON; function RasterPropertiesEntryTypeFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.RasterPropertiesEntryTypeFromJSONTyped = RasterPropertiesEntryTypeFromJSONTyped; function RasterPropertiesEntryTypeToJSON(value) { return value; } -exports.RasterPropertiesEntryTypeToJSON = RasterPropertiesEntryTypeToJSON; +function RasterPropertiesEntryTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/RasterPropertiesKey.d.ts b/typescript/dist/models/RasterPropertiesKey.d.ts index 1651e0c6..c340d3e8 100644 --- a/typescript/dist/models/RasterPropertiesKey.d.ts +++ b/typescript/dist/models/RasterPropertiesKey.d.ts @@ -31,7 +31,8 @@ export interface RasterPropertiesKey { /** * Check if a given object implements the RasterPropertiesKey interface. */ -export declare function instanceOfRasterPropertiesKey(value: object): boolean; +export declare function instanceOfRasterPropertiesKey(value: object): value is RasterPropertiesKey; export declare function RasterPropertiesKeyFromJSON(json: any): RasterPropertiesKey; export declare function RasterPropertiesKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterPropertiesKey; -export declare function RasterPropertiesKeyToJSON(value?: RasterPropertiesKey | null): any; +export declare function RasterPropertiesKeyToJSON(json: any): RasterPropertiesKey; +export declare function RasterPropertiesKeyToJSONTyped(value?: RasterPropertiesKey | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/RasterPropertiesKey.js b/typescript/dist/models/RasterPropertiesKey.js index 45c2d981..279e6709 100644 --- a/typescript/dist/models/RasterPropertiesKey.js +++ b/typescript/dist/models/RasterPropertiesKey.js @@ -13,41 +13,40 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RasterPropertiesKeyToJSON = exports.RasterPropertiesKeyFromJSONTyped = exports.RasterPropertiesKeyFromJSON = exports.instanceOfRasterPropertiesKey = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfRasterPropertiesKey = instanceOfRasterPropertiesKey; +exports.RasterPropertiesKeyFromJSON = RasterPropertiesKeyFromJSON; +exports.RasterPropertiesKeyFromJSONTyped = RasterPropertiesKeyFromJSONTyped; +exports.RasterPropertiesKeyToJSON = RasterPropertiesKeyToJSON; +exports.RasterPropertiesKeyToJSONTyped = RasterPropertiesKeyToJSONTyped; /** * Check if a given object implements the RasterPropertiesKey interface. */ function instanceOfRasterPropertiesKey(value) { - let isInstance = true; - isInstance = isInstance && "key" in value; - return isInstance; + if (!('key' in value) || value['key'] === undefined) + return false; + return true; } -exports.instanceOfRasterPropertiesKey = instanceOfRasterPropertiesKey; function RasterPropertiesKeyFromJSON(json) { return RasterPropertiesKeyFromJSONTyped(json, false); } -exports.RasterPropertiesKeyFromJSON = RasterPropertiesKeyFromJSON; function RasterPropertiesKeyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'domain': !(0, runtime_1.exists)(json, 'domain') ? undefined : json['domain'], + 'domain': json['domain'] == null ? undefined : json['domain'], 'key': json['key'], }; } -exports.RasterPropertiesKeyFromJSONTyped = RasterPropertiesKeyFromJSONTyped; -function RasterPropertiesKeyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function RasterPropertiesKeyToJSON(json) { + return RasterPropertiesKeyToJSONTyped(json, false); +} +function RasterPropertiesKeyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'domain': value.domain, - 'key': value.key, + 'domain': value['domain'], + 'key': value['key'], }; } -exports.RasterPropertiesKeyToJSON = RasterPropertiesKeyToJSON; diff --git a/typescript/dist/models/RasterQueryRectangle.d.ts b/typescript/dist/models/RasterQueryRectangle.d.ts index 38c6b2a7..03d13584 100644 --- a/typescript/dist/models/RasterQueryRectangle.d.ts +++ b/typescript/dist/models/RasterQueryRectangle.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { SpatialPartition2D } from './SpatialPartition2D'; import type { SpatialResolution } from './SpatialResolution'; import type { TimeInterval } from './TimeInterval'; +import type { SpatialPartition2D } from './SpatialPartition2D'; /** * A spatio-temporal rectangle with a specified resolution * @export @@ -40,7 +40,8 @@ export interface RasterQueryRectangle { /** * Check if a given object implements the RasterQueryRectangle interface. */ -export declare function instanceOfRasterQueryRectangle(value: object): boolean; +export declare function instanceOfRasterQueryRectangle(value: object): value is RasterQueryRectangle; export declare function RasterQueryRectangleFromJSON(json: any): RasterQueryRectangle; export declare function RasterQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterQueryRectangle; -export declare function RasterQueryRectangleToJSON(value?: RasterQueryRectangle | null): any; +export declare function RasterQueryRectangleToJSON(json: any): RasterQueryRectangle; +export declare function RasterQueryRectangleToJSONTyped(value?: RasterQueryRectangle | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/RasterQueryRectangle.js b/typescript/dist/models/RasterQueryRectangle.js index 0c39224e..42c3c453 100644 --- a/typescript/dist/models/RasterQueryRectangle.js +++ b/typescript/dist/models/RasterQueryRectangle.js @@ -13,27 +13,31 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RasterQueryRectangleToJSON = exports.RasterQueryRectangleFromJSONTyped = exports.RasterQueryRectangleFromJSON = exports.instanceOfRasterQueryRectangle = void 0; -const SpatialPartition2D_1 = require("./SpatialPartition2D"); +exports.instanceOfRasterQueryRectangle = instanceOfRasterQueryRectangle; +exports.RasterQueryRectangleFromJSON = RasterQueryRectangleFromJSON; +exports.RasterQueryRectangleFromJSONTyped = RasterQueryRectangleFromJSONTyped; +exports.RasterQueryRectangleToJSON = RasterQueryRectangleToJSON; +exports.RasterQueryRectangleToJSONTyped = RasterQueryRectangleToJSONTyped; const SpatialResolution_1 = require("./SpatialResolution"); const TimeInterval_1 = require("./TimeInterval"); +const SpatialPartition2D_1 = require("./SpatialPartition2D"); /** * Check if a given object implements the RasterQueryRectangle interface. */ function instanceOfRasterQueryRectangle(value) { - let isInstance = true; - isInstance = isInstance && "spatialBounds" in value; - isInstance = isInstance && "spatialResolution" in value; - isInstance = isInstance && "timeInterval" in value; - return isInstance; + if (!('spatialBounds' in value) || value['spatialBounds'] === undefined) + return false; + if (!('spatialResolution' in value) || value['spatialResolution'] === undefined) + return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) + return false; + return true; } -exports.instanceOfRasterQueryRectangle = instanceOfRasterQueryRectangle; function RasterQueryRectangleFromJSON(json) { return RasterQueryRectangleFromJSONTyped(json, false); } -exports.RasterQueryRectangleFromJSON = RasterQueryRectangleFromJSON; function RasterQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,18 +46,16 @@ function RasterQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { 'timeInterval': (0, TimeInterval_1.TimeIntervalFromJSON)(json['timeInterval']), }; } -exports.RasterQueryRectangleFromJSONTyped = RasterQueryRectangleFromJSONTyped; -function RasterQueryRectangleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function RasterQueryRectangleToJSON(json) { + return RasterQueryRectangleToJSONTyped(json, false); +} +function RasterQueryRectangleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'spatialBounds': (0, SpatialPartition2D_1.SpatialPartition2DToJSON)(value.spatialBounds), - 'spatialResolution': (0, SpatialResolution_1.SpatialResolutionToJSON)(value.spatialResolution), - 'timeInterval': (0, TimeInterval_1.TimeIntervalToJSON)(value.timeInterval), + 'spatialBounds': (0, SpatialPartition2D_1.SpatialPartition2DToJSON)(value['spatialBounds']), + 'spatialResolution': (0, SpatialResolution_1.SpatialResolutionToJSON)(value['spatialResolution']), + 'timeInterval': (0, TimeInterval_1.TimeIntervalToJSON)(value['timeInterval']), }; } -exports.RasterQueryRectangleToJSON = RasterQueryRectangleToJSON; diff --git a/typescript/dist/models/RasterResultDescriptor.d.ts b/typescript/dist/models/RasterResultDescriptor.d.ts index 681b9aee..d8decd8a 100644 --- a/typescript/dist/models/RasterResultDescriptor.d.ts +++ b/typescript/dist/models/RasterResultDescriptor.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import type { SpatialResolution } from './SpatialResolution'; +import type { TimeInterval } from './TimeInterval'; import type { RasterBandDescriptor } from './RasterBandDescriptor'; import type { RasterDataType } from './RasterDataType'; import type { SpatialPartition2D } from './SpatialPartition2D'; -import type { SpatialResolution } from './SpatialResolution'; -import type { TimeInterval } from './TimeInterval'; /** * A `ResultDescriptor` for raster queries * @export @@ -60,7 +60,8 @@ export interface RasterResultDescriptor { /** * Check if a given object implements the RasterResultDescriptor interface. */ -export declare function instanceOfRasterResultDescriptor(value: object): boolean; +export declare function instanceOfRasterResultDescriptor(value: object): value is RasterResultDescriptor; export declare function RasterResultDescriptorFromJSON(json: any): RasterResultDescriptor; export declare function RasterResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterResultDescriptor; -export declare function RasterResultDescriptorToJSON(value?: RasterResultDescriptor | null): any; +export declare function RasterResultDescriptorToJSON(json: any): RasterResultDescriptor; +export declare function RasterResultDescriptorToJSONTyped(value?: RasterResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/RasterResultDescriptor.js b/typescript/dist/models/RasterResultDescriptor.js index 9838acc1..78f8cc7f 100644 --- a/typescript/dist/models/RasterResultDescriptor.js +++ b/typescript/dist/models/RasterResultDescriptor.js @@ -13,56 +13,57 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RasterResultDescriptorToJSON = exports.RasterResultDescriptorFromJSONTyped = exports.RasterResultDescriptorFromJSON = exports.instanceOfRasterResultDescriptor = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfRasterResultDescriptor = instanceOfRasterResultDescriptor; +exports.RasterResultDescriptorFromJSON = RasterResultDescriptorFromJSON; +exports.RasterResultDescriptorFromJSONTyped = RasterResultDescriptorFromJSONTyped; +exports.RasterResultDescriptorToJSON = RasterResultDescriptorToJSON; +exports.RasterResultDescriptorToJSONTyped = RasterResultDescriptorToJSONTyped; +const SpatialResolution_1 = require("./SpatialResolution"); +const TimeInterval_1 = require("./TimeInterval"); const RasterBandDescriptor_1 = require("./RasterBandDescriptor"); const RasterDataType_1 = require("./RasterDataType"); const SpatialPartition2D_1 = require("./SpatialPartition2D"); -const SpatialResolution_1 = require("./SpatialResolution"); -const TimeInterval_1 = require("./TimeInterval"); /** * Check if a given object implements the RasterResultDescriptor interface. */ function instanceOfRasterResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "bands" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - return isInstance; + if (!('bands' in value) || value['bands'] === undefined) + return false; + if (!('dataType' in value) || value['dataType'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + return true; } -exports.instanceOfRasterResultDescriptor = instanceOfRasterResultDescriptor; function RasterResultDescriptorFromJSON(json) { return RasterResultDescriptorFromJSONTyped(json, false); } -exports.RasterResultDescriptorFromJSON = RasterResultDescriptorFromJSON; function RasterResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bands': (json['bands'].map(RasterBandDescriptor_1.RasterBandDescriptorFromJSON)), - 'bbox': !(0, runtime_1.exists)(json, 'bbox') ? undefined : (0, SpatialPartition2D_1.SpatialPartition2DFromJSON)(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : (0, SpatialPartition2D_1.SpatialPartition2DFromJSON)(json['bbox']), 'dataType': (0, RasterDataType_1.RasterDataTypeFromJSON)(json['dataType']), - 'resolution': !(0, runtime_1.exists)(json, 'resolution') ? undefined : (0, SpatialResolution_1.SpatialResolutionFromJSON)(json['resolution']), + 'resolution': json['resolution'] == null ? undefined : (0, SpatialResolution_1.SpatialResolutionFromJSON)(json['resolution']), 'spatialReference': json['spatialReference'], - 'time': !(0, runtime_1.exists)(json, 'time') ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), + 'time': json['time'] == null ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), }; } -exports.RasterResultDescriptorFromJSONTyped = RasterResultDescriptorFromJSONTyped; -function RasterResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function RasterResultDescriptorToJSON(json) { + return RasterResultDescriptorToJSONTyped(json, false); +} +function RasterResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bands': (value.bands.map(RasterBandDescriptor_1.RasterBandDescriptorToJSON)), - 'bbox': (0, SpatialPartition2D_1.SpatialPartition2DToJSON)(value.bbox), - 'dataType': (0, RasterDataType_1.RasterDataTypeToJSON)(value.dataType), - 'resolution': (0, SpatialResolution_1.SpatialResolutionToJSON)(value.resolution), - 'spatialReference': value.spatialReference, - 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value.time), + 'bands': (value['bands'].map(RasterBandDescriptor_1.RasterBandDescriptorToJSON)), + 'bbox': (0, SpatialPartition2D_1.SpatialPartition2DToJSON)(value['bbox']), + 'dataType': (0, RasterDataType_1.RasterDataTypeToJSON)(value['dataType']), + 'resolution': (0, SpatialResolution_1.SpatialResolutionToJSON)(value['resolution']), + 'spatialReference': value['spatialReference'], + 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value['time']), }; } -exports.RasterResultDescriptorToJSON = RasterResultDescriptorToJSON; diff --git a/typescript/dist/models/RasterStreamWebsocketResultType.d.ts b/typescript/dist/models/RasterStreamWebsocketResultType.d.ts index 7d6d304b..1c1c0b2c 100644 --- a/typescript/dist/models/RasterStreamWebsocketResultType.d.ts +++ b/typescript/dist/models/RasterStreamWebsocketResultType.d.ts @@ -17,6 +17,8 @@ export declare const RasterStreamWebsocketResultType: { readonly Arrow: "arrow"; }; export type RasterStreamWebsocketResultType = typeof RasterStreamWebsocketResultType[keyof typeof RasterStreamWebsocketResultType]; +export declare function instanceOfRasterStreamWebsocketResultType(value: any): boolean; export declare function RasterStreamWebsocketResultTypeFromJSON(json: any): RasterStreamWebsocketResultType; export declare function RasterStreamWebsocketResultTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterStreamWebsocketResultType; export declare function RasterStreamWebsocketResultTypeToJSON(value?: RasterStreamWebsocketResultType | null): any; +export declare function RasterStreamWebsocketResultTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): RasterStreamWebsocketResultType; diff --git a/typescript/dist/models/RasterStreamWebsocketResultType.js b/typescript/dist/models/RasterStreamWebsocketResultType.js index cd4cdf5c..657e5263 100644 --- a/typescript/dist/models/RasterStreamWebsocketResultType.js +++ b/typescript/dist/models/RasterStreamWebsocketResultType.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RasterStreamWebsocketResultTypeToJSON = exports.RasterStreamWebsocketResultTypeFromJSONTyped = exports.RasterStreamWebsocketResultTypeFromJSON = exports.RasterStreamWebsocketResultType = void 0; +exports.RasterStreamWebsocketResultType = void 0; +exports.instanceOfRasterStreamWebsocketResultType = instanceOfRasterStreamWebsocketResultType; +exports.RasterStreamWebsocketResultTypeFromJSON = RasterStreamWebsocketResultTypeFromJSON; +exports.RasterStreamWebsocketResultTypeFromJSONTyped = RasterStreamWebsocketResultTypeFromJSONTyped; +exports.RasterStreamWebsocketResultTypeToJSON = RasterStreamWebsocketResultTypeToJSON; +exports.RasterStreamWebsocketResultTypeToJSONTyped = RasterStreamWebsocketResultTypeToJSONTyped; /** * The stream result type for `raster_stream_websocket`. * @export @@ -21,15 +26,25 @@ exports.RasterStreamWebsocketResultTypeToJSON = exports.RasterStreamWebsocketRes exports.RasterStreamWebsocketResultType = { Arrow: 'arrow' }; +function instanceOfRasterStreamWebsocketResultType(value) { + for (const key in exports.RasterStreamWebsocketResultType) { + if (Object.prototype.hasOwnProperty.call(exports.RasterStreamWebsocketResultType, key)) { + if (exports.RasterStreamWebsocketResultType[key] === value) { + return true; + } + } + } + return false; +} function RasterStreamWebsocketResultTypeFromJSON(json) { return RasterStreamWebsocketResultTypeFromJSONTyped(json, false); } -exports.RasterStreamWebsocketResultTypeFromJSON = RasterStreamWebsocketResultTypeFromJSON; function RasterStreamWebsocketResultTypeFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.RasterStreamWebsocketResultTypeFromJSONTyped = RasterStreamWebsocketResultTypeFromJSONTyped; function RasterStreamWebsocketResultTypeToJSON(value) { return value; } -exports.RasterStreamWebsocketResultTypeToJSON = RasterStreamWebsocketResultTypeToJSON; +function RasterStreamWebsocketResultTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/RasterSymbology.d.ts b/typescript/dist/models/RasterSymbology.d.ts index 9ae2052d..c5957ad2 100644 --- a/typescript/dist/models/RasterSymbology.d.ts +++ b/typescript/dist/models/RasterSymbology.d.ts @@ -45,7 +45,8 @@ export type RasterSymbologyTypeEnum = typeof RasterSymbologyTypeEnum[keyof typeo /** * Check if a given object implements the RasterSymbology interface. */ -export declare function instanceOfRasterSymbology(value: object): boolean; +export declare function instanceOfRasterSymbology(value: object): value is RasterSymbology; export declare function RasterSymbologyFromJSON(json: any): RasterSymbology; export declare function RasterSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterSymbology; -export declare function RasterSymbologyToJSON(value?: RasterSymbology | null): any; +export declare function RasterSymbologyToJSON(json: any): RasterSymbology; +export declare function RasterSymbologyToJSONTyped(value?: RasterSymbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/RasterSymbology.js b/typescript/dist/models/RasterSymbology.js index d1e2b5df..3327298b 100644 --- a/typescript/dist/models/RasterSymbology.js +++ b/typescript/dist/models/RasterSymbology.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RasterSymbologyToJSON = exports.RasterSymbologyFromJSONTyped = exports.RasterSymbologyFromJSON = exports.instanceOfRasterSymbology = exports.RasterSymbologyTypeEnum = void 0; +exports.RasterSymbologyTypeEnum = void 0; +exports.instanceOfRasterSymbology = instanceOfRasterSymbology; +exports.RasterSymbologyFromJSON = RasterSymbologyFromJSON; +exports.RasterSymbologyFromJSONTyped = RasterSymbologyFromJSONTyped; +exports.RasterSymbologyToJSON = RasterSymbologyToJSON; +exports.RasterSymbologyToJSONTyped = RasterSymbologyToJSONTyped; const RasterColorizer_1 = require("./RasterColorizer"); /** * @export @@ -25,19 +30,19 @@ exports.RasterSymbologyTypeEnum = { * Check if a given object implements the RasterSymbology interface. */ function instanceOfRasterSymbology(value) { - let isInstance = true; - isInstance = isInstance && "opacity" in value; - isInstance = isInstance && "rasterColorizer" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('opacity' in value) || value['opacity'] === undefined) + return false; + if (!('rasterColorizer' in value) || value['rasterColorizer'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfRasterSymbology = instanceOfRasterSymbology; function RasterSymbologyFromJSON(json) { return RasterSymbologyFromJSONTyped(json, false); } -exports.RasterSymbologyFromJSON = RasterSymbologyFromJSON; function RasterSymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -46,18 +51,16 @@ function RasterSymbologyFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.RasterSymbologyFromJSONTyped = RasterSymbologyFromJSONTyped; -function RasterSymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function RasterSymbologyToJSON(json) { + return RasterSymbologyToJSONTyped(json, false); +} +function RasterSymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'opacity': value.opacity, - 'rasterColorizer': (0, RasterColorizer_1.RasterColorizerToJSON)(value.rasterColorizer), - 'type': value.type, + 'opacity': value['opacity'], + 'rasterColorizer': (0, RasterColorizer_1.RasterColorizerToJSON)(value['rasterColorizer']), + 'type': value['type'], }; } -exports.RasterSymbologyToJSON = RasterSymbologyToJSON; diff --git a/typescript/dist/models/Resource.d.ts b/typescript/dist/models/Resource.d.ts index 68910807..524dd463 100644 --- a/typescript/dist/models/Resource.d.ts +++ b/typescript/dist/models/Resource.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DatasetResource } from './DatasetResource'; -import { LayerCollectionResource } from './LayerCollectionResource'; -import { LayerResource } from './LayerResource'; -import { MlModelResource } from './MlModelResource'; -import { ProjectResource } from './ProjectResource'; +import type { DatasetResource } from './DatasetResource'; +import type { LayerCollectionResource } from './LayerCollectionResource'; +import type { LayerResource } from './LayerResource'; +import type { MlModelResource } from './MlModelResource'; +import type { ProjectResource } from './ProjectResource'; /** * @type Resource * @@ -32,4 +32,5 @@ export type Resource = { } & ProjectResource; export declare function ResourceFromJSON(json: any): Resource; export declare function ResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Resource; -export declare function ResourceToJSON(value?: Resource | null): any; +export declare function ResourceToJSON(json: any): any; +export declare function ResourceToJSONTyped(value?: Resource | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Resource.js b/typescript/dist/models/Resource.js index e42b277e..416eaa28 100644 --- a/typescript/dist/models/Resource.js +++ b/typescript/dist/models/Resource.js @@ -13,7 +13,10 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ResourceToJSON = exports.ResourceFromJSONTyped = exports.ResourceFromJSON = void 0; +exports.ResourceFromJSON = ResourceFromJSON; +exports.ResourceFromJSONTyped = ResourceFromJSONTyped; +exports.ResourceToJSON = ResourceToJSON; +exports.ResourceToJSONTyped = ResourceToJSONTyped; const DatasetResource_1 = require("./DatasetResource"); const LayerCollectionResource_1 = require("./LayerCollectionResource"); const LayerResource_1 = require("./LayerResource"); @@ -22,47 +25,44 @@ const ProjectResource_1 = require("./ProjectResource"); function ResourceFromJSON(json) { return ResourceFromJSONTyped(json, false); } -exports.ResourceFromJSON = ResourceFromJSON; function ResourceFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'dataset': - return Object.assign(Object.assign({}, (0, DatasetResource_1.DatasetResourceFromJSONTyped)(json, true)), { type: 'dataset' }); + return Object.assign({}, (0, DatasetResource_1.DatasetResourceFromJSONTyped)(json, true), { type: 'dataset' }); case 'layer': - return Object.assign(Object.assign({}, (0, LayerResource_1.LayerResourceFromJSONTyped)(json, true)), { type: 'layer' }); + return Object.assign({}, (0, LayerResource_1.LayerResourceFromJSONTyped)(json, true), { type: 'layer' }); case 'layerCollection': - return Object.assign(Object.assign({}, (0, LayerCollectionResource_1.LayerCollectionResourceFromJSONTyped)(json, true)), { type: 'layerCollection' }); + return Object.assign({}, (0, LayerCollectionResource_1.LayerCollectionResourceFromJSONTyped)(json, true), { type: 'layerCollection' }); case 'mlModel': - return Object.assign(Object.assign({}, (0, MlModelResource_1.MlModelResourceFromJSONTyped)(json, true)), { type: 'mlModel' }); + return Object.assign({}, (0, MlModelResource_1.MlModelResourceFromJSONTyped)(json, true), { type: 'mlModel' }); case 'project': - return Object.assign(Object.assign({}, (0, ProjectResource_1.ProjectResourceFromJSONTyped)(json, true)), { type: 'project' }); + return Object.assign({}, (0, ProjectResource_1.ProjectResourceFromJSONTyped)(json, true), { type: 'project' }); default: throw new Error(`No variant of Resource exists with 'type=${json['type']}'`); } } -exports.ResourceFromJSONTyped = ResourceFromJSONTyped; -function ResourceToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ResourceToJSON(json) { + return ResourceToJSONTyped(json, false); +} +function ResourceToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'dataset': - return (0, DatasetResource_1.DatasetResourceToJSON)(value); + return Object.assign({}, (0, DatasetResource_1.DatasetResourceToJSON)(value), { type: 'dataset' }); case 'layer': - return (0, LayerResource_1.LayerResourceToJSON)(value); + return Object.assign({}, (0, LayerResource_1.LayerResourceToJSON)(value), { type: 'layer' }); case 'layerCollection': - return (0, LayerCollectionResource_1.LayerCollectionResourceToJSON)(value); + return Object.assign({}, (0, LayerCollectionResource_1.LayerCollectionResourceToJSON)(value), { type: 'layerCollection' }); case 'mlModel': - return (0, MlModelResource_1.MlModelResourceToJSON)(value); + return Object.assign({}, (0, MlModelResource_1.MlModelResourceToJSON)(value), { type: 'mlModel' }); case 'project': - return (0, ProjectResource_1.ProjectResourceToJSON)(value); + return Object.assign({}, (0, ProjectResource_1.ProjectResourceToJSON)(value), { type: 'project' }); default: throw new Error(`No variant of Resource exists with 'type=${value['type']}'`); } } -exports.ResourceToJSON = ResourceToJSON; diff --git a/typescript/dist/models/ResourceId.d.ts b/typescript/dist/models/ResourceId.d.ts index 71315089..8080fd6f 100644 --- a/typescript/dist/models/ResourceId.d.ts +++ b/typescript/dist/models/ResourceId.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { ResourceIdDatasetId } from './ResourceIdDatasetId'; -import { ResourceIdLayer } from './ResourceIdLayer'; -import { ResourceIdLayerCollection } from './ResourceIdLayerCollection'; -import { ResourceIdMlModel } from './ResourceIdMlModel'; -import { ResourceIdProject } from './ResourceIdProject'; +import type { ResourceIdDatasetId } from './ResourceIdDatasetId'; +import type { ResourceIdLayer } from './ResourceIdLayer'; +import type { ResourceIdLayerCollection } from './ResourceIdLayerCollection'; +import type { ResourceIdMlModel } from './ResourceIdMlModel'; +import type { ResourceIdProject } from './ResourceIdProject'; /** * @type ResourceId * @@ -32,4 +32,5 @@ export type ResourceId = { } & ResourceIdProject; export declare function ResourceIdFromJSON(json: any): ResourceId; export declare function ResourceIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceId; -export declare function ResourceIdToJSON(value?: ResourceId | null): any; +export declare function ResourceIdToJSON(json: any): any; +export declare function ResourceIdToJSONTyped(value?: ResourceId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ResourceId.js b/typescript/dist/models/ResourceId.js index c92967f3..1bb71804 100644 --- a/typescript/dist/models/ResourceId.js +++ b/typescript/dist/models/ResourceId.js @@ -13,7 +13,10 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ResourceIdToJSON = exports.ResourceIdFromJSONTyped = exports.ResourceIdFromJSON = void 0; +exports.ResourceIdFromJSON = ResourceIdFromJSON; +exports.ResourceIdFromJSONTyped = ResourceIdFromJSONTyped; +exports.ResourceIdToJSON = ResourceIdToJSON; +exports.ResourceIdToJSONTyped = ResourceIdToJSONTyped; const ResourceIdDatasetId_1 = require("./ResourceIdDatasetId"); const ResourceIdLayer_1 = require("./ResourceIdLayer"); const ResourceIdLayerCollection_1 = require("./ResourceIdLayerCollection"); @@ -22,47 +25,44 @@ const ResourceIdProject_1 = require("./ResourceIdProject"); function ResourceIdFromJSON(json) { return ResourceIdFromJSONTyped(json, false); } -exports.ResourceIdFromJSON = ResourceIdFromJSON; function ResourceIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'DatasetId': - return Object.assign(Object.assign({}, (0, ResourceIdDatasetId_1.ResourceIdDatasetIdFromJSONTyped)(json, true)), { type: 'DatasetId' }); + return Object.assign({}, (0, ResourceIdDatasetId_1.ResourceIdDatasetIdFromJSONTyped)(json, true), { type: 'DatasetId' }); case 'Layer': - return Object.assign(Object.assign({}, (0, ResourceIdLayer_1.ResourceIdLayerFromJSONTyped)(json, true)), { type: 'Layer' }); + return Object.assign({}, (0, ResourceIdLayer_1.ResourceIdLayerFromJSONTyped)(json, true), { type: 'Layer' }); case 'LayerCollection': - return Object.assign(Object.assign({}, (0, ResourceIdLayerCollection_1.ResourceIdLayerCollectionFromJSONTyped)(json, true)), { type: 'LayerCollection' }); + return Object.assign({}, (0, ResourceIdLayerCollection_1.ResourceIdLayerCollectionFromJSONTyped)(json, true), { type: 'LayerCollection' }); case 'MlModel': - return Object.assign(Object.assign({}, (0, ResourceIdMlModel_1.ResourceIdMlModelFromJSONTyped)(json, true)), { type: 'MlModel' }); + return Object.assign({}, (0, ResourceIdMlModel_1.ResourceIdMlModelFromJSONTyped)(json, true), { type: 'MlModel' }); case 'Project': - return Object.assign(Object.assign({}, (0, ResourceIdProject_1.ResourceIdProjectFromJSONTyped)(json, true)), { type: 'Project' }); + return Object.assign({}, (0, ResourceIdProject_1.ResourceIdProjectFromJSONTyped)(json, true), { type: 'Project' }); default: throw new Error(`No variant of ResourceId exists with 'type=${json['type']}'`); } } -exports.ResourceIdFromJSONTyped = ResourceIdFromJSONTyped; -function ResourceIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ResourceIdToJSON(json) { + return ResourceIdToJSONTyped(json, false); +} +function ResourceIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'DatasetId': - return (0, ResourceIdDatasetId_1.ResourceIdDatasetIdToJSON)(value); + return Object.assign({}, (0, ResourceIdDatasetId_1.ResourceIdDatasetIdToJSON)(value), { type: 'DatasetId' }); case 'Layer': - return (0, ResourceIdLayer_1.ResourceIdLayerToJSON)(value); + return Object.assign({}, (0, ResourceIdLayer_1.ResourceIdLayerToJSON)(value), { type: 'Layer' }); case 'LayerCollection': - return (0, ResourceIdLayerCollection_1.ResourceIdLayerCollectionToJSON)(value); + return Object.assign({}, (0, ResourceIdLayerCollection_1.ResourceIdLayerCollectionToJSON)(value), { type: 'LayerCollection' }); case 'MlModel': - return (0, ResourceIdMlModel_1.ResourceIdMlModelToJSON)(value); + return Object.assign({}, (0, ResourceIdMlModel_1.ResourceIdMlModelToJSON)(value), { type: 'MlModel' }); case 'Project': - return (0, ResourceIdProject_1.ResourceIdProjectToJSON)(value); + return Object.assign({}, (0, ResourceIdProject_1.ResourceIdProjectToJSON)(value), { type: 'Project' }); default: throw new Error(`No variant of ResourceId exists with 'type=${value['type']}'`); } } -exports.ResourceIdToJSON = ResourceIdToJSON; diff --git a/typescript/dist/models/ResourceIdDatasetId.d.ts b/typescript/dist/models/ResourceIdDatasetId.d.ts index 8f275dd2..9d2b4942 100644 --- a/typescript/dist/models/ResourceIdDatasetId.d.ts +++ b/typescript/dist/models/ResourceIdDatasetId.d.ts @@ -38,7 +38,8 @@ export type ResourceIdDatasetIdTypeEnum = typeof ResourceIdDatasetIdTypeEnum[key /** * Check if a given object implements the ResourceIdDatasetId interface. */ -export declare function instanceOfResourceIdDatasetId(value: object): boolean; +export declare function instanceOfResourceIdDatasetId(value: object): value is ResourceIdDatasetId; export declare function ResourceIdDatasetIdFromJSON(json: any): ResourceIdDatasetId; export declare function ResourceIdDatasetIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdDatasetId; -export declare function ResourceIdDatasetIdToJSON(value?: ResourceIdDatasetId | null): any; +export declare function ResourceIdDatasetIdToJSON(json: any): ResourceIdDatasetId; +export declare function ResourceIdDatasetIdToJSONTyped(value?: ResourceIdDatasetId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ResourceIdDatasetId.js b/typescript/dist/models/ResourceIdDatasetId.js index 08d2809f..2a9f6884 100644 --- a/typescript/dist/models/ResourceIdDatasetId.js +++ b/typescript/dist/models/ResourceIdDatasetId.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ResourceIdDatasetIdToJSON = exports.ResourceIdDatasetIdFromJSONTyped = exports.ResourceIdDatasetIdFromJSON = exports.instanceOfResourceIdDatasetId = exports.ResourceIdDatasetIdTypeEnum = void 0; +exports.ResourceIdDatasetIdTypeEnum = void 0; +exports.instanceOfResourceIdDatasetId = instanceOfResourceIdDatasetId; +exports.ResourceIdDatasetIdFromJSON = ResourceIdDatasetIdFromJSON; +exports.ResourceIdDatasetIdFromJSONTyped = ResourceIdDatasetIdFromJSONTyped; +exports.ResourceIdDatasetIdToJSON = ResourceIdDatasetIdToJSON; +exports.ResourceIdDatasetIdToJSONTyped = ResourceIdDatasetIdToJSONTyped; /** * @export */ @@ -24,18 +29,17 @@ exports.ResourceIdDatasetIdTypeEnum = { * Check if a given object implements the ResourceIdDatasetId interface. */ function instanceOfResourceIdDatasetId(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfResourceIdDatasetId = instanceOfResourceIdDatasetId; function ResourceIdDatasetIdFromJSON(json) { return ResourceIdDatasetIdFromJSONTyped(json, false); } -exports.ResourceIdDatasetIdFromJSON = ResourceIdDatasetIdFromJSON; function ResourceIdDatasetIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +47,15 @@ function ResourceIdDatasetIdFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.ResourceIdDatasetIdFromJSONTyped = ResourceIdDatasetIdFromJSONTyped; -function ResourceIdDatasetIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ResourceIdDatasetIdToJSON(json) { + return ResourceIdDatasetIdToJSONTyped(json, false); +} +function ResourceIdDatasetIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } -exports.ResourceIdDatasetIdToJSON = ResourceIdDatasetIdToJSON; diff --git a/typescript/dist/models/ResourceIdLayer.d.ts b/typescript/dist/models/ResourceIdLayer.d.ts index 5d47d9ca..d68024e6 100644 --- a/typescript/dist/models/ResourceIdLayer.d.ts +++ b/typescript/dist/models/ResourceIdLayer.d.ts @@ -33,16 +33,13 @@ export interface ResourceIdLayer { */ export declare const ResourceIdLayerTypeEnum: { readonly Layer: "Layer"; - readonly LayerCollection: "LayerCollection"; - readonly Project: "Project"; - readonly DatasetId: "DatasetId"; - readonly MlModel: "MlModel"; }; export type ResourceIdLayerTypeEnum = typeof ResourceIdLayerTypeEnum[keyof typeof ResourceIdLayerTypeEnum]; /** * Check if a given object implements the ResourceIdLayer interface. */ -export declare function instanceOfResourceIdLayer(value: object): boolean; +export declare function instanceOfResourceIdLayer(value: object): value is ResourceIdLayer; export declare function ResourceIdLayerFromJSON(json: any): ResourceIdLayer; export declare function ResourceIdLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdLayer; -export declare function ResourceIdLayerToJSON(value?: ResourceIdLayer | null): any; +export declare function ResourceIdLayerToJSON(json: any): ResourceIdLayer; +export declare function ResourceIdLayerToJSONTyped(value?: ResourceIdLayer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ResourceIdLayer.js b/typescript/dist/models/ResourceIdLayer.js index d1355e3f..89a19bfc 100644 --- a/typescript/dist/models/ResourceIdLayer.js +++ b/typescript/dist/models/ResourceIdLayer.js @@ -13,33 +13,33 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ResourceIdLayerToJSON = exports.ResourceIdLayerFromJSONTyped = exports.ResourceIdLayerFromJSON = exports.instanceOfResourceIdLayer = exports.ResourceIdLayerTypeEnum = void 0; +exports.ResourceIdLayerTypeEnum = void 0; +exports.instanceOfResourceIdLayer = instanceOfResourceIdLayer; +exports.ResourceIdLayerFromJSON = ResourceIdLayerFromJSON; +exports.ResourceIdLayerFromJSONTyped = ResourceIdLayerFromJSONTyped; +exports.ResourceIdLayerToJSON = ResourceIdLayerToJSON; +exports.ResourceIdLayerToJSONTyped = ResourceIdLayerToJSONTyped; /** * @export */ exports.ResourceIdLayerTypeEnum = { - Layer: 'Layer', - LayerCollection: 'LayerCollection', - Project: 'Project', - DatasetId: 'DatasetId', - MlModel: 'MlModel' + Layer: 'Layer' }; /** * Check if a given object implements the ResourceIdLayer interface. */ function instanceOfResourceIdLayer(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfResourceIdLayer = instanceOfResourceIdLayer; function ResourceIdLayerFromJSON(json) { return ResourceIdLayerFromJSONTyped(json, false); } -exports.ResourceIdLayerFromJSON = ResourceIdLayerFromJSON; function ResourceIdLayerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -47,17 +47,15 @@ function ResourceIdLayerFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.ResourceIdLayerFromJSONTyped = ResourceIdLayerFromJSONTyped; -function ResourceIdLayerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ResourceIdLayerToJSON(json) { + return ResourceIdLayerToJSONTyped(json, false); +} +function ResourceIdLayerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } -exports.ResourceIdLayerToJSON = ResourceIdLayerToJSON; diff --git a/typescript/dist/models/ResourceIdLayerCollection.d.ts b/typescript/dist/models/ResourceIdLayerCollection.d.ts index a94a4755..51e94abb 100644 --- a/typescript/dist/models/ResourceIdLayerCollection.d.ts +++ b/typescript/dist/models/ResourceIdLayerCollection.d.ts @@ -38,7 +38,8 @@ export type ResourceIdLayerCollectionTypeEnum = typeof ResourceIdLayerCollection /** * Check if a given object implements the ResourceIdLayerCollection interface. */ -export declare function instanceOfResourceIdLayerCollection(value: object): boolean; +export declare function instanceOfResourceIdLayerCollection(value: object): value is ResourceIdLayerCollection; export declare function ResourceIdLayerCollectionFromJSON(json: any): ResourceIdLayerCollection; export declare function ResourceIdLayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdLayerCollection; -export declare function ResourceIdLayerCollectionToJSON(value?: ResourceIdLayerCollection | null): any; +export declare function ResourceIdLayerCollectionToJSON(json: any): ResourceIdLayerCollection; +export declare function ResourceIdLayerCollectionToJSONTyped(value?: ResourceIdLayerCollection | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ResourceIdLayerCollection.js b/typescript/dist/models/ResourceIdLayerCollection.js index 8bed4565..2a702474 100644 --- a/typescript/dist/models/ResourceIdLayerCollection.js +++ b/typescript/dist/models/ResourceIdLayerCollection.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ResourceIdLayerCollectionToJSON = exports.ResourceIdLayerCollectionFromJSONTyped = exports.ResourceIdLayerCollectionFromJSON = exports.instanceOfResourceIdLayerCollection = exports.ResourceIdLayerCollectionTypeEnum = void 0; +exports.ResourceIdLayerCollectionTypeEnum = void 0; +exports.instanceOfResourceIdLayerCollection = instanceOfResourceIdLayerCollection; +exports.ResourceIdLayerCollectionFromJSON = ResourceIdLayerCollectionFromJSON; +exports.ResourceIdLayerCollectionFromJSONTyped = ResourceIdLayerCollectionFromJSONTyped; +exports.ResourceIdLayerCollectionToJSON = ResourceIdLayerCollectionToJSON; +exports.ResourceIdLayerCollectionToJSONTyped = ResourceIdLayerCollectionToJSONTyped; /** * @export */ @@ -24,18 +29,17 @@ exports.ResourceIdLayerCollectionTypeEnum = { * Check if a given object implements the ResourceIdLayerCollection interface. */ function instanceOfResourceIdLayerCollection(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfResourceIdLayerCollection = instanceOfResourceIdLayerCollection; function ResourceIdLayerCollectionFromJSON(json) { return ResourceIdLayerCollectionFromJSONTyped(json, false); } -exports.ResourceIdLayerCollectionFromJSON = ResourceIdLayerCollectionFromJSON; function ResourceIdLayerCollectionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +47,15 @@ function ResourceIdLayerCollectionFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.ResourceIdLayerCollectionFromJSONTyped = ResourceIdLayerCollectionFromJSONTyped; -function ResourceIdLayerCollectionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ResourceIdLayerCollectionToJSON(json) { + return ResourceIdLayerCollectionToJSONTyped(json, false); +} +function ResourceIdLayerCollectionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } -exports.ResourceIdLayerCollectionToJSON = ResourceIdLayerCollectionToJSON; diff --git a/typescript/dist/models/ResourceIdMlModel.d.ts b/typescript/dist/models/ResourceIdMlModel.d.ts index 98bf3fb7..a7e47a2a 100644 --- a/typescript/dist/models/ResourceIdMlModel.d.ts +++ b/typescript/dist/models/ResourceIdMlModel.d.ts @@ -38,7 +38,8 @@ export type ResourceIdMlModelTypeEnum = typeof ResourceIdMlModelTypeEnum[keyof t /** * Check if a given object implements the ResourceIdMlModel interface. */ -export declare function instanceOfResourceIdMlModel(value: object): boolean; +export declare function instanceOfResourceIdMlModel(value: object): value is ResourceIdMlModel; export declare function ResourceIdMlModelFromJSON(json: any): ResourceIdMlModel; export declare function ResourceIdMlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdMlModel; -export declare function ResourceIdMlModelToJSON(value?: ResourceIdMlModel | null): any; +export declare function ResourceIdMlModelToJSON(json: any): ResourceIdMlModel; +export declare function ResourceIdMlModelToJSONTyped(value?: ResourceIdMlModel | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ResourceIdMlModel.js b/typescript/dist/models/ResourceIdMlModel.js index 0b9ca791..3a172ca2 100644 --- a/typescript/dist/models/ResourceIdMlModel.js +++ b/typescript/dist/models/ResourceIdMlModel.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ResourceIdMlModelToJSON = exports.ResourceIdMlModelFromJSONTyped = exports.ResourceIdMlModelFromJSON = exports.instanceOfResourceIdMlModel = exports.ResourceIdMlModelTypeEnum = void 0; +exports.ResourceIdMlModelTypeEnum = void 0; +exports.instanceOfResourceIdMlModel = instanceOfResourceIdMlModel; +exports.ResourceIdMlModelFromJSON = ResourceIdMlModelFromJSON; +exports.ResourceIdMlModelFromJSONTyped = ResourceIdMlModelFromJSONTyped; +exports.ResourceIdMlModelToJSON = ResourceIdMlModelToJSON; +exports.ResourceIdMlModelToJSONTyped = ResourceIdMlModelToJSONTyped; /** * @export */ @@ -24,18 +29,17 @@ exports.ResourceIdMlModelTypeEnum = { * Check if a given object implements the ResourceIdMlModel interface. */ function instanceOfResourceIdMlModel(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfResourceIdMlModel = instanceOfResourceIdMlModel; function ResourceIdMlModelFromJSON(json) { return ResourceIdMlModelFromJSONTyped(json, false); } -exports.ResourceIdMlModelFromJSON = ResourceIdMlModelFromJSON; function ResourceIdMlModelFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +47,15 @@ function ResourceIdMlModelFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.ResourceIdMlModelFromJSONTyped = ResourceIdMlModelFromJSONTyped; -function ResourceIdMlModelToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ResourceIdMlModelToJSON(json) { + return ResourceIdMlModelToJSONTyped(json, false); +} +function ResourceIdMlModelToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } -exports.ResourceIdMlModelToJSON = ResourceIdMlModelToJSON; diff --git a/typescript/dist/models/ResourceIdProject.d.ts b/typescript/dist/models/ResourceIdProject.d.ts index e084783a..ed026316 100644 --- a/typescript/dist/models/ResourceIdProject.d.ts +++ b/typescript/dist/models/ResourceIdProject.d.ts @@ -38,7 +38,8 @@ export type ResourceIdProjectTypeEnum = typeof ResourceIdProjectTypeEnum[keyof t /** * Check if a given object implements the ResourceIdProject interface. */ -export declare function instanceOfResourceIdProject(value: object): boolean; +export declare function instanceOfResourceIdProject(value: object): value is ResourceIdProject; export declare function ResourceIdProjectFromJSON(json: any): ResourceIdProject; export declare function ResourceIdProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdProject; -export declare function ResourceIdProjectToJSON(value?: ResourceIdProject | null): any; +export declare function ResourceIdProjectToJSON(json: any): ResourceIdProject; +export declare function ResourceIdProjectToJSONTyped(value?: ResourceIdProject | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ResourceIdProject.js b/typescript/dist/models/ResourceIdProject.js index 5a96db76..ace07ef5 100644 --- a/typescript/dist/models/ResourceIdProject.js +++ b/typescript/dist/models/ResourceIdProject.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ResourceIdProjectToJSON = exports.ResourceIdProjectFromJSONTyped = exports.ResourceIdProjectFromJSON = exports.instanceOfResourceIdProject = exports.ResourceIdProjectTypeEnum = void 0; +exports.ResourceIdProjectTypeEnum = void 0; +exports.instanceOfResourceIdProject = instanceOfResourceIdProject; +exports.ResourceIdProjectFromJSON = ResourceIdProjectFromJSON; +exports.ResourceIdProjectFromJSONTyped = ResourceIdProjectFromJSONTyped; +exports.ResourceIdProjectToJSON = ResourceIdProjectToJSON; +exports.ResourceIdProjectToJSONTyped = ResourceIdProjectToJSONTyped; /** * @export */ @@ -24,18 +29,17 @@ exports.ResourceIdProjectTypeEnum = { * Check if a given object implements the ResourceIdProject interface. */ function instanceOfResourceIdProject(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfResourceIdProject = instanceOfResourceIdProject; function ResourceIdProjectFromJSON(json) { return ResourceIdProjectFromJSONTyped(json, false); } -exports.ResourceIdProjectFromJSON = ResourceIdProjectFromJSON; function ResourceIdProjectFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +47,15 @@ function ResourceIdProjectFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.ResourceIdProjectFromJSONTyped = ResourceIdProjectFromJSONTyped; -function ResourceIdProjectToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ResourceIdProjectToJSON(json) { + return ResourceIdProjectToJSONTyped(json, false); +} +function ResourceIdProjectToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } -exports.ResourceIdProjectToJSON = ResourceIdProjectToJSON; diff --git a/typescript/dist/models/RgbaColorizer.js b/typescript/dist/models/RgbaColorizer.js index 4bc811c7..147bb07f 100644 --- a/typescript/dist/models/RgbaColorizer.js +++ b/typescript/dist/models/RgbaColorizer.js @@ -13,7 +13,11 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RgbaColorizerToJSON = exports.RgbaColorizerFromJSONTyped = exports.RgbaColorizerFromJSON = exports.instanceOfRgbaColorizer = exports.RgbaColorizerTypeEnum = void 0; +exports.RgbaColorizerTypeEnum = void 0; +exports.instanceOfRgbaColorizer = instanceOfRgbaColorizer; +exports.RgbaColorizerFromJSON = RgbaColorizerFromJSON; +exports.RgbaColorizerFromJSONTyped = RgbaColorizerFromJSONTyped; +exports.RgbaColorizerToJSON = RgbaColorizerToJSON; /** * @export */ @@ -28,11 +32,9 @@ function instanceOfRgbaColorizer(value) { isInstance = isInstance && "type" in value; return isInstance; } -exports.instanceOfRgbaColorizer = instanceOfRgbaColorizer; function RgbaColorizerFromJSON(json) { return RgbaColorizerFromJSONTyped(json, false); } -exports.RgbaColorizerFromJSON = RgbaColorizerFromJSON; function RgbaColorizerFromJSONTyped(json, ignoreDiscriminator) { if ((json === undefined) || (json === null)) { return json; @@ -41,7 +43,6 @@ function RgbaColorizerFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.RgbaColorizerFromJSONTyped = RgbaColorizerFromJSONTyped; function RgbaColorizerToJSON(value) { if (value === undefined) { return undefined; @@ -53,4 +54,3 @@ function RgbaColorizerToJSON(value) { 'type': value.type, }; } -exports.RgbaColorizerToJSON = RgbaColorizerToJSON; diff --git a/typescript/dist/models/Role.d.ts b/typescript/dist/models/Role.d.ts index 94df2ecd..0f20560d 100644 --- a/typescript/dist/models/Role.d.ts +++ b/typescript/dist/models/Role.d.ts @@ -31,7 +31,8 @@ export interface Role { /** * Check if a given object implements the Role interface. */ -export declare function instanceOfRole(value: object): boolean; +export declare function instanceOfRole(value: object): value is Role; export declare function RoleFromJSON(json: any): Role; export declare function RoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Role; -export declare function RoleToJSON(value?: Role | null): any; +export declare function RoleToJSON(json: any): Role; +export declare function RoleToJSONTyped(value?: Role | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Role.js b/typescript/dist/models/Role.js index 1fe38f05..6d4019e8 100644 --- a/typescript/dist/models/Role.js +++ b/typescript/dist/models/Role.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RoleToJSON = exports.RoleFromJSONTyped = exports.RoleFromJSON = exports.instanceOfRole = void 0; +exports.instanceOfRole = instanceOfRole; +exports.RoleFromJSON = RoleFromJSON; +exports.RoleFromJSONTyped = RoleFromJSONTyped; +exports.RoleToJSON = RoleToJSON; +exports.RoleToJSONTyped = RoleToJSONTyped; /** * Check if a given object implements the Role interface. */ function instanceOfRole(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } -exports.instanceOfRole = instanceOfRole; function RoleFromJSON(json) { return RoleFromJSONTyped(json, false); } -exports.RoleFromJSON = RoleFromJSON; function RoleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function RoleFromJSONTyped(json, ignoreDiscriminator) { 'name': json['name'], }; } -exports.RoleFromJSONTyped = RoleFromJSONTyped; -function RoleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function RoleToJSON(json) { + return RoleToJSONTyped(json, false); +} +function RoleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'id': value.id, - 'name': value.name, + 'id': value['id'], + 'name': value['name'], }; } -exports.RoleToJSON = RoleToJSON; diff --git a/typescript/dist/models/RoleDescription.d.ts b/typescript/dist/models/RoleDescription.d.ts index 90f7a05c..605a297c 100644 --- a/typescript/dist/models/RoleDescription.d.ts +++ b/typescript/dist/models/RoleDescription.d.ts @@ -32,7 +32,8 @@ export interface RoleDescription { /** * Check if a given object implements the RoleDescription interface. */ -export declare function instanceOfRoleDescription(value: object): boolean; +export declare function instanceOfRoleDescription(value: object): value is RoleDescription; export declare function RoleDescriptionFromJSON(json: any): RoleDescription; export declare function RoleDescriptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): RoleDescription; -export declare function RoleDescriptionToJSON(value?: RoleDescription | null): any; +export declare function RoleDescriptionToJSON(json: any): RoleDescription; +export declare function RoleDescriptionToJSONTyped(value?: RoleDescription | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/RoleDescription.js b/typescript/dist/models/RoleDescription.js index 01e22406..bca144c9 100644 --- a/typescript/dist/models/RoleDescription.js +++ b/typescript/dist/models/RoleDescription.js @@ -13,24 +13,27 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.RoleDescriptionToJSON = exports.RoleDescriptionFromJSONTyped = exports.RoleDescriptionFromJSON = exports.instanceOfRoleDescription = void 0; +exports.instanceOfRoleDescription = instanceOfRoleDescription; +exports.RoleDescriptionFromJSON = RoleDescriptionFromJSON; +exports.RoleDescriptionFromJSONTyped = RoleDescriptionFromJSONTyped; +exports.RoleDescriptionToJSON = RoleDescriptionToJSON; +exports.RoleDescriptionToJSONTyped = RoleDescriptionToJSONTyped; const Role_1 = require("./Role"); /** * Check if a given object implements the RoleDescription interface. */ function instanceOfRoleDescription(value) { - let isInstance = true; - isInstance = isInstance && "individual" in value; - isInstance = isInstance && "role" in value; - return isInstance; + if (!('individual' in value) || value['individual'] === undefined) + return false; + if (!('role' in value) || value['role'] === undefined) + return false; + return true; } -exports.instanceOfRoleDescription = instanceOfRoleDescription; function RoleDescriptionFromJSON(json) { return RoleDescriptionFromJSONTyped(json, false); } -exports.RoleDescriptionFromJSON = RoleDescriptionFromJSON; function RoleDescriptionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,17 +41,15 @@ function RoleDescriptionFromJSONTyped(json, ignoreDiscriminator) { 'role': (0, Role_1.RoleFromJSON)(json['role']), }; } -exports.RoleDescriptionFromJSONTyped = RoleDescriptionFromJSONTyped; -function RoleDescriptionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function RoleDescriptionToJSON(json) { + return RoleDescriptionToJSONTyped(json, false); +} +function RoleDescriptionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'individual': value.individual, - 'role': (0, Role_1.RoleToJSON)(value.role), + 'individual': value['individual'], + 'role': (0, Role_1.RoleToJSON)(value['role']), }; } -exports.RoleDescriptionToJSON = RoleDescriptionToJSON; diff --git a/typescript/dist/models/STRectangle.d.ts b/typescript/dist/models/STRectangle.d.ts index cd9273b8..7ec0062b 100644 --- a/typescript/dist/models/STRectangle.d.ts +++ b/typescript/dist/models/STRectangle.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; import type { TimeInterval } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * * @export @@ -39,7 +39,8 @@ export interface STRectangle { /** * Check if a given object implements the STRectangle interface. */ -export declare function instanceOfSTRectangle(value: object): boolean; +export declare function instanceOfSTRectangle(value: object): value is STRectangle; export declare function STRectangleFromJSON(json: any): STRectangle; export declare function STRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): STRectangle; -export declare function STRectangleToJSON(value?: STRectangle | null): any; +export declare function STRectangleToJSON(json: any): STRectangle; +export declare function STRectangleToJSONTyped(value?: STRectangle | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/STRectangle.js b/typescript/dist/models/STRectangle.js index 6eb3d435..3622a712 100644 --- a/typescript/dist/models/STRectangle.js +++ b/typescript/dist/models/STRectangle.js @@ -13,26 +13,30 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.STRectangleToJSON = exports.STRectangleFromJSONTyped = exports.STRectangleFromJSON = exports.instanceOfSTRectangle = void 0; -const BoundingBox2D_1 = require("./BoundingBox2D"); +exports.instanceOfSTRectangle = instanceOfSTRectangle; +exports.STRectangleFromJSON = STRectangleFromJSON; +exports.STRectangleFromJSONTyped = STRectangleFromJSONTyped; +exports.STRectangleToJSON = STRectangleToJSON; +exports.STRectangleToJSONTyped = STRectangleToJSONTyped; const TimeInterval_1 = require("./TimeInterval"); +const BoundingBox2D_1 = require("./BoundingBox2D"); /** * Check if a given object implements the STRectangle interface. */ function instanceOfSTRectangle(value) { - let isInstance = true; - isInstance = isInstance && "boundingBox" in value; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "timeInterval" in value; - return isInstance; + if (!('boundingBox' in value) || value['boundingBox'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) + return false; + return true; } -exports.instanceOfSTRectangle = instanceOfSTRectangle; function STRectangleFromJSON(json) { return STRectangleFromJSONTyped(json, false); } -exports.STRectangleFromJSON = STRectangleFromJSON; function STRectangleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,18 +45,16 @@ function STRectangleFromJSONTyped(json, ignoreDiscriminator) { 'timeInterval': (0, TimeInterval_1.TimeIntervalFromJSON)(json['timeInterval']), }; } -exports.STRectangleFromJSONTyped = STRectangleFromJSONTyped; -function STRectangleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function STRectangleToJSON(json) { + return STRectangleToJSONTyped(json, false); +} +function STRectangleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'boundingBox': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value.boundingBox), - 'spatialReference': value.spatialReference, - 'timeInterval': (0, TimeInterval_1.TimeIntervalToJSON)(value.timeInterval), + 'boundingBox': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value['boundingBox']), + 'spatialReference': value['spatialReference'], + 'timeInterval': (0, TimeInterval_1.TimeIntervalToJSON)(value['timeInterval']), }; } -exports.STRectangleToJSON = STRectangleToJSON; diff --git a/typescript/dist/models/SearchCapabilities.d.ts b/typescript/dist/models/SearchCapabilities.d.ts index 5569fc6d..a02189f9 100644 --- a/typescript/dist/models/SearchCapabilities.d.ts +++ b/typescript/dist/models/SearchCapabilities.d.ts @@ -38,7 +38,8 @@ export interface SearchCapabilities { /** * Check if a given object implements the SearchCapabilities interface. */ -export declare function instanceOfSearchCapabilities(value: object): boolean; +export declare function instanceOfSearchCapabilities(value: object): value is SearchCapabilities; export declare function SearchCapabilitiesFromJSON(json: any): SearchCapabilities; export declare function SearchCapabilitiesFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchCapabilities; -export declare function SearchCapabilitiesToJSON(value?: SearchCapabilities | null): any; +export declare function SearchCapabilitiesToJSON(json: any): SearchCapabilities; +export declare function SearchCapabilitiesToJSONTyped(value?: SearchCapabilities | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/SearchCapabilities.js b/typescript/dist/models/SearchCapabilities.js index 46d5e6cf..1958ed9f 100644 --- a/typescript/dist/models/SearchCapabilities.js +++ b/typescript/dist/models/SearchCapabilities.js @@ -13,45 +13,45 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.SearchCapabilitiesToJSON = exports.SearchCapabilitiesFromJSONTyped = exports.SearchCapabilitiesFromJSON = exports.instanceOfSearchCapabilities = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfSearchCapabilities = instanceOfSearchCapabilities; +exports.SearchCapabilitiesFromJSON = SearchCapabilitiesFromJSON; +exports.SearchCapabilitiesFromJSONTyped = SearchCapabilitiesFromJSONTyped; +exports.SearchCapabilitiesToJSON = SearchCapabilitiesToJSON; +exports.SearchCapabilitiesToJSONTyped = SearchCapabilitiesToJSONTyped; const SearchTypes_1 = require("./SearchTypes"); /** * Check if a given object implements the SearchCapabilities interface. */ function instanceOfSearchCapabilities(value) { - let isInstance = true; - isInstance = isInstance && "autocomplete" in value; - isInstance = isInstance && "searchTypes" in value; - return isInstance; + if (!('autocomplete' in value) || value['autocomplete'] === undefined) + return false; + if (!('searchTypes' in value) || value['searchTypes'] === undefined) + return false; + return true; } -exports.instanceOfSearchCapabilities = instanceOfSearchCapabilities; function SearchCapabilitiesFromJSON(json) { return SearchCapabilitiesFromJSONTyped(json, false); } -exports.SearchCapabilitiesFromJSON = SearchCapabilitiesFromJSON; function SearchCapabilitiesFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'autocomplete': json['autocomplete'], - 'filters': !(0, runtime_1.exists)(json, 'filters') ? undefined : json['filters'], + 'filters': json['filters'] == null ? undefined : json['filters'], 'searchTypes': (0, SearchTypes_1.SearchTypesFromJSON)(json['searchTypes']), }; } -exports.SearchCapabilitiesFromJSONTyped = SearchCapabilitiesFromJSONTyped; -function SearchCapabilitiesToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function SearchCapabilitiesToJSON(json) { + return SearchCapabilitiesToJSONTyped(json, false); +} +function SearchCapabilitiesToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'autocomplete': value.autocomplete, - 'filters': value.filters, - 'searchTypes': (0, SearchTypes_1.SearchTypesToJSON)(value.searchTypes), + 'autocomplete': value['autocomplete'], + 'filters': value['filters'], + 'searchTypes': (0, SearchTypes_1.SearchTypesToJSON)(value['searchTypes']), }; } -exports.SearchCapabilitiesToJSON = SearchCapabilitiesToJSON; diff --git a/typescript/dist/models/SearchType.d.ts b/typescript/dist/models/SearchType.d.ts index d18be08e..ed33eb7c 100644 --- a/typescript/dist/models/SearchType.d.ts +++ b/typescript/dist/models/SearchType.d.ts @@ -18,6 +18,8 @@ export declare const SearchType: { readonly Prefix: "prefix"; }; export type SearchType = typeof SearchType[keyof typeof SearchType]; +export declare function instanceOfSearchType(value: any): boolean; export declare function SearchTypeFromJSON(json: any): SearchType; export declare function SearchTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchType; export declare function SearchTypeToJSON(value?: SearchType | null): any; +export declare function SearchTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): SearchType; diff --git a/typescript/dist/models/SearchType.js b/typescript/dist/models/SearchType.js index 1bc2d313..3047b8ef 100644 --- a/typescript/dist/models/SearchType.js +++ b/typescript/dist/models/SearchType.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.SearchTypeToJSON = exports.SearchTypeFromJSONTyped = exports.SearchTypeFromJSON = exports.SearchType = void 0; +exports.SearchType = void 0; +exports.instanceOfSearchType = instanceOfSearchType; +exports.SearchTypeFromJSON = SearchTypeFromJSON; +exports.SearchTypeFromJSONTyped = SearchTypeFromJSONTyped; +exports.SearchTypeToJSON = SearchTypeToJSON; +exports.SearchTypeToJSONTyped = SearchTypeToJSONTyped; /** * * @export @@ -22,15 +27,25 @@ exports.SearchType = { Fulltext: 'fulltext', Prefix: 'prefix' }; +function instanceOfSearchType(value) { + for (const key in exports.SearchType) { + if (Object.prototype.hasOwnProperty.call(exports.SearchType, key)) { + if (exports.SearchType[key] === value) { + return true; + } + } + } + return false; +} function SearchTypeFromJSON(json) { return SearchTypeFromJSONTyped(json, false); } -exports.SearchTypeFromJSON = SearchTypeFromJSON; function SearchTypeFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.SearchTypeFromJSONTyped = SearchTypeFromJSONTyped; function SearchTypeToJSON(value) { return value; } -exports.SearchTypeToJSON = SearchTypeToJSON; +function SearchTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/SearchTypes.d.ts b/typescript/dist/models/SearchTypes.d.ts index b65c95c4..1c1a83c8 100644 --- a/typescript/dist/models/SearchTypes.d.ts +++ b/typescript/dist/models/SearchTypes.d.ts @@ -31,7 +31,8 @@ export interface SearchTypes { /** * Check if a given object implements the SearchTypes interface. */ -export declare function instanceOfSearchTypes(value: object): boolean; +export declare function instanceOfSearchTypes(value: object): value is SearchTypes; export declare function SearchTypesFromJSON(json: any): SearchTypes; export declare function SearchTypesFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchTypes; -export declare function SearchTypesToJSON(value?: SearchTypes | null): any; +export declare function SearchTypesToJSON(json: any): SearchTypes; +export declare function SearchTypesToJSONTyped(value?: SearchTypes | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/SearchTypes.js b/typescript/dist/models/SearchTypes.js index f14e0e07..881d1a78 100644 --- a/typescript/dist/models/SearchTypes.js +++ b/typescript/dist/models/SearchTypes.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.SearchTypesToJSON = exports.SearchTypesFromJSONTyped = exports.SearchTypesFromJSON = exports.instanceOfSearchTypes = void 0; +exports.instanceOfSearchTypes = instanceOfSearchTypes; +exports.SearchTypesFromJSON = SearchTypesFromJSON; +exports.SearchTypesFromJSONTyped = SearchTypesFromJSONTyped; +exports.SearchTypesToJSON = SearchTypesToJSON; +exports.SearchTypesToJSONTyped = SearchTypesToJSONTyped; /** * Check if a given object implements the SearchTypes interface. */ function instanceOfSearchTypes(value) { - let isInstance = true; - isInstance = isInstance && "fulltext" in value; - isInstance = isInstance && "prefix" in value; - return isInstance; + if (!('fulltext' in value) || value['fulltext'] === undefined) + return false; + if (!('prefix' in value) || value['prefix'] === undefined) + return false; + return true; } -exports.instanceOfSearchTypes = instanceOfSearchTypes; function SearchTypesFromJSON(json) { return SearchTypesFromJSONTyped(json, false); } -exports.SearchTypesFromJSON = SearchTypesFromJSON; function SearchTypesFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function SearchTypesFromJSONTyped(json, ignoreDiscriminator) { 'prefix': json['prefix'], }; } -exports.SearchTypesFromJSONTyped = SearchTypesFromJSONTyped; -function SearchTypesToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function SearchTypesToJSON(json) { + return SearchTypesToJSONTyped(json, false); +} +function SearchTypesToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'fulltext': value.fulltext, - 'prefix': value.prefix, + 'fulltext': value['fulltext'], + 'prefix': value['prefix'], }; } -exports.SearchTypesToJSON = SearchTypesToJSON; diff --git a/typescript/dist/models/ServerInfo.d.ts b/typescript/dist/models/ServerInfo.d.ts index d74cf3e6..5b3b26f1 100644 --- a/typescript/dist/models/ServerInfo.d.ts +++ b/typescript/dist/models/ServerInfo.d.ts @@ -43,7 +43,8 @@ export interface ServerInfo { /** * Check if a given object implements the ServerInfo interface. */ -export declare function instanceOfServerInfo(value: object): boolean; +export declare function instanceOfServerInfo(value: object): value is ServerInfo; export declare function ServerInfoFromJSON(json: any): ServerInfo; export declare function ServerInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ServerInfo; -export declare function ServerInfoToJSON(value?: ServerInfo | null): any; +export declare function ServerInfoToJSON(json: any): ServerInfo; +export declare function ServerInfoToJSONTyped(value?: ServerInfo | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/ServerInfo.js b/typescript/dist/models/ServerInfo.js index 34665214..20db0dc2 100644 --- a/typescript/dist/models/ServerInfo.js +++ b/typescript/dist/models/ServerInfo.js @@ -13,25 +13,30 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.ServerInfoToJSON = exports.ServerInfoFromJSONTyped = exports.ServerInfoFromJSON = exports.instanceOfServerInfo = void 0; +exports.instanceOfServerInfo = instanceOfServerInfo; +exports.ServerInfoFromJSON = ServerInfoFromJSON; +exports.ServerInfoFromJSONTyped = ServerInfoFromJSONTyped; +exports.ServerInfoToJSON = ServerInfoToJSON; +exports.ServerInfoToJSONTyped = ServerInfoToJSONTyped; /** * Check if a given object implements the ServerInfo interface. */ function instanceOfServerInfo(value) { - let isInstance = true; - isInstance = isInstance && "buildDate" in value; - isInstance = isInstance && "commitHash" in value; - isInstance = isInstance && "features" in value; - isInstance = isInstance && "version" in value; - return isInstance; + if (!('buildDate' in value) || value['buildDate'] === undefined) + return false; + if (!('commitHash' in value) || value['commitHash'] === undefined) + return false; + if (!('features' in value) || value['features'] === undefined) + return false; + if (!('version' in value) || value['version'] === undefined) + return false; + return true; } -exports.instanceOfServerInfo = instanceOfServerInfo; function ServerInfoFromJSON(json) { return ServerInfoFromJSONTyped(json, false); } -exports.ServerInfoFromJSON = ServerInfoFromJSON; function ServerInfoFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,19 +46,17 @@ function ServerInfoFromJSONTyped(json, ignoreDiscriminator) { 'version': json['version'], }; } -exports.ServerInfoFromJSONTyped = ServerInfoFromJSONTyped; -function ServerInfoToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function ServerInfoToJSON(json) { + return ServerInfoToJSONTyped(json, false); +} +function ServerInfoToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'buildDate': value.buildDate, - 'commitHash': value.commitHash, - 'features': value.features, - 'version': value.version, + 'buildDate': value['buildDate'], + 'commitHash': value['commitHash'], + 'features': value['features'], + 'version': value['version'], }; } -exports.ServerInfoToJSON = ServerInfoToJSON; diff --git a/typescript/dist/models/SingleBandRasterColorizer.d.ts b/typescript/dist/models/SingleBandRasterColorizer.d.ts index 6968e547..f2a97929 100644 --- a/typescript/dist/models/SingleBandRasterColorizer.d.ts +++ b/typescript/dist/models/SingleBandRasterColorizer.d.ts @@ -40,13 +40,13 @@ export interface SingleBandRasterColorizer { */ export declare const SingleBandRasterColorizerTypeEnum: { readonly SingleBand: "singleBand"; - readonly MultiBand: "multiBand"; }; export type SingleBandRasterColorizerTypeEnum = typeof SingleBandRasterColorizerTypeEnum[keyof typeof SingleBandRasterColorizerTypeEnum]; /** * Check if a given object implements the SingleBandRasterColorizer interface. */ -export declare function instanceOfSingleBandRasterColorizer(value: object): boolean; +export declare function instanceOfSingleBandRasterColorizer(value: object): value is SingleBandRasterColorizer; export declare function SingleBandRasterColorizerFromJSON(json: any): SingleBandRasterColorizer; export declare function SingleBandRasterColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): SingleBandRasterColorizer; -export declare function SingleBandRasterColorizerToJSON(value?: SingleBandRasterColorizer | null): any; +export declare function SingleBandRasterColorizerToJSON(json: any): SingleBandRasterColorizer; +export declare function SingleBandRasterColorizerToJSONTyped(value?: SingleBandRasterColorizer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/SingleBandRasterColorizer.js b/typescript/dist/models/SingleBandRasterColorizer.js index fbb6cb90..5573aaa1 100644 --- a/typescript/dist/models/SingleBandRasterColorizer.js +++ b/typescript/dist/models/SingleBandRasterColorizer.js @@ -13,32 +13,36 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.SingleBandRasterColorizerToJSON = exports.SingleBandRasterColorizerFromJSONTyped = exports.SingleBandRasterColorizerFromJSON = exports.instanceOfSingleBandRasterColorizer = exports.SingleBandRasterColorizerTypeEnum = void 0; +exports.SingleBandRasterColorizerTypeEnum = void 0; +exports.instanceOfSingleBandRasterColorizer = instanceOfSingleBandRasterColorizer; +exports.SingleBandRasterColorizerFromJSON = SingleBandRasterColorizerFromJSON; +exports.SingleBandRasterColorizerFromJSONTyped = SingleBandRasterColorizerFromJSONTyped; +exports.SingleBandRasterColorizerToJSON = SingleBandRasterColorizerToJSON; +exports.SingleBandRasterColorizerToJSONTyped = SingleBandRasterColorizerToJSONTyped; const Colorizer_1 = require("./Colorizer"); /** * @export */ exports.SingleBandRasterColorizerTypeEnum = { - SingleBand: 'singleBand', - MultiBand: 'multiBand' + SingleBand: 'singleBand' }; /** * Check if a given object implements the SingleBandRasterColorizer interface. */ function instanceOfSingleBandRasterColorizer(value) { - let isInstance = true; - isInstance = isInstance && "band" in value; - isInstance = isInstance && "bandColorizer" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('band' in value) || value['band'] === undefined) + return false; + if (!('bandColorizer' in value) || value['bandColorizer'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfSingleBandRasterColorizer = instanceOfSingleBandRasterColorizer; function SingleBandRasterColorizerFromJSON(json) { return SingleBandRasterColorizerFromJSONTyped(json, false); } -exports.SingleBandRasterColorizerFromJSON = SingleBandRasterColorizerFromJSON; function SingleBandRasterColorizerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -47,18 +51,16 @@ function SingleBandRasterColorizerFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.SingleBandRasterColorizerFromJSONTyped = SingleBandRasterColorizerFromJSONTyped; -function SingleBandRasterColorizerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function SingleBandRasterColorizerToJSON(json) { + return SingleBandRasterColorizerToJSONTyped(json, false); +} +function SingleBandRasterColorizerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'band': value.band, - 'bandColorizer': (0, Colorizer_1.ColorizerToJSON)(value.bandColorizer), - 'type': value.type, + 'band': value['band'], + 'bandColorizer': (0, Colorizer_1.ColorizerToJSON)(value['bandColorizer']), + 'type': value['type'], }; } -exports.SingleBandRasterColorizerToJSON = SingleBandRasterColorizerToJSON; diff --git a/typescript/dist/models/SpatialPartition2D.d.ts b/typescript/dist/models/SpatialPartition2D.d.ts index 04e34749..852ebcaf 100644 --- a/typescript/dist/models/SpatialPartition2D.d.ts +++ b/typescript/dist/models/SpatialPartition2D.d.ts @@ -32,7 +32,8 @@ export interface SpatialPartition2D { /** * Check if a given object implements the SpatialPartition2D interface. */ -export declare function instanceOfSpatialPartition2D(value: object): boolean; +export declare function instanceOfSpatialPartition2D(value: object): value is SpatialPartition2D; export declare function SpatialPartition2DFromJSON(json: any): SpatialPartition2D; export declare function SpatialPartition2DFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpatialPartition2D; -export declare function SpatialPartition2DToJSON(value?: SpatialPartition2D | null): any; +export declare function SpatialPartition2DToJSON(json: any): SpatialPartition2D; +export declare function SpatialPartition2DToJSONTyped(value?: SpatialPartition2D | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/SpatialPartition2D.js b/typescript/dist/models/SpatialPartition2D.js index 666a652c..3d8bc56c 100644 --- a/typescript/dist/models/SpatialPartition2D.js +++ b/typescript/dist/models/SpatialPartition2D.js @@ -13,24 +13,27 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.SpatialPartition2DToJSON = exports.SpatialPartition2DFromJSONTyped = exports.SpatialPartition2DFromJSON = exports.instanceOfSpatialPartition2D = void 0; +exports.instanceOfSpatialPartition2D = instanceOfSpatialPartition2D; +exports.SpatialPartition2DFromJSON = SpatialPartition2DFromJSON; +exports.SpatialPartition2DFromJSONTyped = SpatialPartition2DFromJSONTyped; +exports.SpatialPartition2DToJSON = SpatialPartition2DToJSON; +exports.SpatialPartition2DToJSONTyped = SpatialPartition2DToJSONTyped; const Coordinate2D_1 = require("./Coordinate2D"); /** * Check if a given object implements the SpatialPartition2D interface. */ function instanceOfSpatialPartition2D(value) { - let isInstance = true; - isInstance = isInstance && "lowerRightCoordinate" in value; - isInstance = isInstance && "upperLeftCoordinate" in value; - return isInstance; + if (!('lowerRightCoordinate' in value) || value['lowerRightCoordinate'] === undefined) + return false; + if (!('upperLeftCoordinate' in value) || value['upperLeftCoordinate'] === undefined) + return false; + return true; } -exports.instanceOfSpatialPartition2D = instanceOfSpatialPartition2D; function SpatialPartition2DFromJSON(json) { return SpatialPartition2DFromJSONTyped(json, false); } -exports.SpatialPartition2DFromJSON = SpatialPartition2DFromJSON; function SpatialPartition2DFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,17 +41,15 @@ function SpatialPartition2DFromJSONTyped(json, ignoreDiscriminator) { 'upperLeftCoordinate': (0, Coordinate2D_1.Coordinate2DFromJSON)(json['upperLeftCoordinate']), }; } -exports.SpatialPartition2DFromJSONTyped = SpatialPartition2DFromJSONTyped; -function SpatialPartition2DToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function SpatialPartition2DToJSON(json) { + return SpatialPartition2DToJSONTyped(json, false); +} +function SpatialPartition2DToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'lowerRightCoordinate': (0, Coordinate2D_1.Coordinate2DToJSON)(value.lowerRightCoordinate), - 'upperLeftCoordinate': (0, Coordinate2D_1.Coordinate2DToJSON)(value.upperLeftCoordinate), + 'lowerRightCoordinate': (0, Coordinate2D_1.Coordinate2DToJSON)(value['lowerRightCoordinate']), + 'upperLeftCoordinate': (0, Coordinate2D_1.Coordinate2DToJSON)(value['upperLeftCoordinate']), }; } -exports.SpatialPartition2DToJSON = SpatialPartition2DToJSON; diff --git a/typescript/dist/models/SpatialReferenceAuthority.d.ts b/typescript/dist/models/SpatialReferenceAuthority.d.ts index 5c8ed9ee..bebd27e9 100644 --- a/typescript/dist/models/SpatialReferenceAuthority.d.ts +++ b/typescript/dist/models/SpatialReferenceAuthority.d.ts @@ -20,6 +20,8 @@ export declare const SpatialReferenceAuthority: { readonly Esri: "ESRI"; }; export type SpatialReferenceAuthority = typeof SpatialReferenceAuthority[keyof typeof SpatialReferenceAuthority]; +export declare function instanceOfSpatialReferenceAuthority(value: any): boolean; export declare function SpatialReferenceAuthorityFromJSON(json: any): SpatialReferenceAuthority; export declare function SpatialReferenceAuthorityFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpatialReferenceAuthority; export declare function SpatialReferenceAuthorityToJSON(value?: SpatialReferenceAuthority | null): any; +export declare function SpatialReferenceAuthorityToJSONTyped(value: any, ignoreDiscriminator: boolean): SpatialReferenceAuthority; diff --git a/typescript/dist/models/SpatialReferenceAuthority.js b/typescript/dist/models/SpatialReferenceAuthority.js index ee8b915f..c5fe0f15 100644 --- a/typescript/dist/models/SpatialReferenceAuthority.js +++ b/typescript/dist/models/SpatialReferenceAuthority.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.SpatialReferenceAuthorityToJSON = exports.SpatialReferenceAuthorityFromJSONTyped = exports.SpatialReferenceAuthorityFromJSON = exports.SpatialReferenceAuthority = void 0; +exports.SpatialReferenceAuthority = void 0; +exports.instanceOfSpatialReferenceAuthority = instanceOfSpatialReferenceAuthority; +exports.SpatialReferenceAuthorityFromJSON = SpatialReferenceAuthorityFromJSON; +exports.SpatialReferenceAuthorityFromJSONTyped = SpatialReferenceAuthorityFromJSONTyped; +exports.SpatialReferenceAuthorityToJSON = SpatialReferenceAuthorityToJSON; +exports.SpatialReferenceAuthorityToJSONTyped = SpatialReferenceAuthorityToJSONTyped; /** * A spatial reference authority that is part of a spatial reference definition * @export @@ -24,15 +29,25 @@ exports.SpatialReferenceAuthority = { Iau2000: 'IAU2000', Esri: 'ESRI' }; +function instanceOfSpatialReferenceAuthority(value) { + for (const key in exports.SpatialReferenceAuthority) { + if (Object.prototype.hasOwnProperty.call(exports.SpatialReferenceAuthority, key)) { + if (exports.SpatialReferenceAuthority[key] === value) { + return true; + } + } + } + return false; +} function SpatialReferenceAuthorityFromJSON(json) { return SpatialReferenceAuthorityFromJSONTyped(json, false); } -exports.SpatialReferenceAuthorityFromJSON = SpatialReferenceAuthorityFromJSON; function SpatialReferenceAuthorityFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.SpatialReferenceAuthorityFromJSONTyped = SpatialReferenceAuthorityFromJSONTyped; function SpatialReferenceAuthorityToJSON(value) { return value; } -exports.SpatialReferenceAuthorityToJSON = SpatialReferenceAuthorityToJSON; +function SpatialReferenceAuthorityToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/SpatialReferenceSpecification.d.ts b/typescript/dist/models/SpatialReferenceSpecification.d.ts index 955a2fae..125610a4 100644 --- a/typescript/dist/models/SpatialReferenceSpecification.d.ts +++ b/typescript/dist/models/SpatialReferenceSpecification.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { AxisOrder } from './AxisOrder'; import type { BoundingBox2D } from './BoundingBox2D'; +import type { AxisOrder } from './AxisOrder'; /** * The specification of a spatial reference, where extent and axis labels are given * in natural order (x, y) = (east, north) @@ -58,7 +58,8 @@ export interface SpatialReferenceSpecification { /** * Check if a given object implements the SpatialReferenceSpecification interface. */ -export declare function instanceOfSpatialReferenceSpecification(value: object): boolean; +export declare function instanceOfSpatialReferenceSpecification(value: object): value is SpatialReferenceSpecification; export declare function SpatialReferenceSpecificationFromJSON(json: any): SpatialReferenceSpecification; export declare function SpatialReferenceSpecificationFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpatialReferenceSpecification; -export declare function SpatialReferenceSpecificationToJSON(value?: SpatialReferenceSpecification | null): any; +export declare function SpatialReferenceSpecificationToJSON(json: any): SpatialReferenceSpecification; +export declare function SpatialReferenceSpecificationToJSONTyped(value?: SpatialReferenceSpecification | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/SpatialReferenceSpecification.js b/typescript/dist/models/SpatialReferenceSpecification.js index e6274c28..9d7ca0b3 100644 --- a/typescript/dist/models/SpatialReferenceSpecification.js +++ b/typescript/dist/models/SpatialReferenceSpecification.js @@ -13,54 +13,56 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.SpatialReferenceSpecificationToJSON = exports.SpatialReferenceSpecificationFromJSONTyped = exports.SpatialReferenceSpecificationFromJSON = exports.instanceOfSpatialReferenceSpecification = void 0; -const runtime_1 = require("../runtime"); -const AxisOrder_1 = require("./AxisOrder"); +exports.instanceOfSpatialReferenceSpecification = instanceOfSpatialReferenceSpecification; +exports.SpatialReferenceSpecificationFromJSON = SpatialReferenceSpecificationFromJSON; +exports.SpatialReferenceSpecificationFromJSONTyped = SpatialReferenceSpecificationFromJSONTyped; +exports.SpatialReferenceSpecificationToJSON = SpatialReferenceSpecificationToJSON; +exports.SpatialReferenceSpecificationToJSONTyped = SpatialReferenceSpecificationToJSONTyped; const BoundingBox2D_1 = require("./BoundingBox2D"); +const AxisOrder_1 = require("./AxisOrder"); /** * Check if a given object implements the SpatialReferenceSpecification interface. */ function instanceOfSpatialReferenceSpecification(value) { - let isInstance = true; - isInstance = isInstance && "extent" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "projString" in value; - isInstance = isInstance && "spatialReference" in value; - return isInstance; + if (!('extent' in value) || value['extent'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('projString' in value) || value['projString'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + return true; } -exports.instanceOfSpatialReferenceSpecification = instanceOfSpatialReferenceSpecification; function SpatialReferenceSpecificationFromJSON(json) { return SpatialReferenceSpecificationFromJSONTyped(json, false); } -exports.SpatialReferenceSpecificationFromJSON = SpatialReferenceSpecificationFromJSON; function SpatialReferenceSpecificationFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'axisLabels': !(0, runtime_1.exists)(json, 'axisLabels') ? undefined : json['axisLabels'], - 'axisOrder': !(0, runtime_1.exists)(json, 'axisOrder') ? undefined : (0, AxisOrder_1.AxisOrderFromJSON)(json['axisOrder']), + 'axisLabels': json['axisLabels'] == null ? undefined : json['axisLabels'], + 'axisOrder': json['axisOrder'] == null ? undefined : (0, AxisOrder_1.AxisOrderFromJSON)(json['axisOrder']), 'extent': (0, BoundingBox2D_1.BoundingBox2DFromJSON)(json['extent']), 'name': json['name'], 'projString': json['projString'], 'spatialReference': json['spatialReference'], }; } -exports.SpatialReferenceSpecificationFromJSONTyped = SpatialReferenceSpecificationFromJSONTyped; -function SpatialReferenceSpecificationToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function SpatialReferenceSpecificationToJSON(json) { + return SpatialReferenceSpecificationToJSONTyped(json, false); +} +function SpatialReferenceSpecificationToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'axisLabels': value.axisLabels, - 'axisOrder': (0, AxisOrder_1.AxisOrderToJSON)(value.axisOrder), - 'extent': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value.extent), - 'name': value.name, - 'projString': value.projString, - 'spatialReference': value.spatialReference, + 'axisLabels': value['axisLabels'], + 'axisOrder': (0, AxisOrder_1.AxisOrderToJSON)(value['axisOrder']), + 'extent': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value['extent']), + 'name': value['name'], + 'projString': value['projString'], + 'spatialReference': value['spatialReference'], }; } -exports.SpatialReferenceSpecificationToJSON = SpatialReferenceSpecificationToJSON; diff --git a/typescript/dist/models/SpatialResolution.d.ts b/typescript/dist/models/SpatialResolution.d.ts index 4300e098..a1d9f259 100644 --- a/typescript/dist/models/SpatialResolution.d.ts +++ b/typescript/dist/models/SpatialResolution.d.ts @@ -31,7 +31,8 @@ export interface SpatialResolution { /** * Check if a given object implements the SpatialResolution interface. */ -export declare function instanceOfSpatialResolution(value: object): boolean; +export declare function instanceOfSpatialResolution(value: object): value is SpatialResolution; export declare function SpatialResolutionFromJSON(json: any): SpatialResolution; export declare function SpatialResolutionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpatialResolution; -export declare function SpatialResolutionToJSON(value?: SpatialResolution | null): any; +export declare function SpatialResolutionToJSON(json: any): SpatialResolution; +export declare function SpatialResolutionToJSONTyped(value?: SpatialResolution | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/SpatialResolution.js b/typescript/dist/models/SpatialResolution.js index 435151b7..e5c180fd 100644 --- a/typescript/dist/models/SpatialResolution.js +++ b/typescript/dist/models/SpatialResolution.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.SpatialResolutionToJSON = exports.SpatialResolutionFromJSONTyped = exports.SpatialResolutionFromJSON = exports.instanceOfSpatialResolution = void 0; +exports.instanceOfSpatialResolution = instanceOfSpatialResolution; +exports.SpatialResolutionFromJSON = SpatialResolutionFromJSON; +exports.SpatialResolutionFromJSONTyped = SpatialResolutionFromJSONTyped; +exports.SpatialResolutionToJSON = SpatialResolutionToJSON; +exports.SpatialResolutionToJSONTyped = SpatialResolutionToJSONTyped; /** * Check if a given object implements the SpatialResolution interface. */ function instanceOfSpatialResolution(value) { - let isInstance = true; - isInstance = isInstance && "x" in value; - isInstance = isInstance && "y" in value; - return isInstance; + if (!('x' in value) || value['x'] === undefined) + return false; + if (!('y' in value) || value['y'] === undefined) + return false; + return true; } -exports.instanceOfSpatialResolution = instanceOfSpatialResolution; function SpatialResolutionFromJSON(json) { return SpatialResolutionFromJSONTyped(json, false); } -exports.SpatialResolutionFromJSON = SpatialResolutionFromJSON; function SpatialResolutionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function SpatialResolutionFromJSONTyped(json, ignoreDiscriminator) { 'y': json['y'], }; } -exports.SpatialResolutionFromJSONTyped = SpatialResolutionFromJSONTyped; -function SpatialResolutionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function SpatialResolutionToJSON(json) { + return SpatialResolutionToJSONTyped(json, false); +} +function SpatialResolutionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'x': value.x, - 'y': value.y, + 'x': value['x'], + 'y': value['y'], }; } -exports.SpatialResolutionToJSON = SpatialResolutionToJSON; diff --git a/typescript/dist/models/StaticNumberParam.d.ts b/typescript/dist/models/StaticNumberParam.d.ts index 9b97064f..f09202f6 100644 --- a/typescript/dist/models/StaticNumberParam.d.ts +++ b/typescript/dist/models/StaticNumberParam.d.ts @@ -33,13 +33,13 @@ export interface StaticNumberParam { */ export declare const StaticNumberParamTypeEnum: { readonly Static: "static"; - readonly Derived: "derived"; }; export type StaticNumberParamTypeEnum = typeof StaticNumberParamTypeEnum[keyof typeof StaticNumberParamTypeEnum]; /** * Check if a given object implements the StaticNumberParam interface. */ -export declare function instanceOfStaticNumberParam(value: object): boolean; +export declare function instanceOfStaticNumberParam(value: object): value is StaticNumberParam; export declare function StaticNumberParamFromJSON(json: any): StaticNumberParam; export declare function StaticNumberParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): StaticNumberParam; -export declare function StaticNumberParamToJSON(value?: StaticNumberParam | null): any; +export declare function StaticNumberParamToJSON(json: any): StaticNumberParam; +export declare function StaticNumberParamToJSONTyped(value?: StaticNumberParam | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/StaticNumberParam.js b/typescript/dist/models/StaticNumberParam.js index aedc91af..10e30d9b 100644 --- a/typescript/dist/models/StaticNumberParam.js +++ b/typescript/dist/models/StaticNumberParam.js @@ -13,30 +13,33 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.StaticNumberParamToJSON = exports.StaticNumberParamFromJSONTyped = exports.StaticNumberParamFromJSON = exports.instanceOfStaticNumberParam = exports.StaticNumberParamTypeEnum = void 0; +exports.StaticNumberParamTypeEnum = void 0; +exports.instanceOfStaticNumberParam = instanceOfStaticNumberParam; +exports.StaticNumberParamFromJSON = StaticNumberParamFromJSON; +exports.StaticNumberParamFromJSONTyped = StaticNumberParamFromJSONTyped; +exports.StaticNumberParamToJSON = StaticNumberParamToJSON; +exports.StaticNumberParamToJSONTyped = StaticNumberParamToJSONTyped; /** * @export */ exports.StaticNumberParamTypeEnum = { - Static: 'static', - Derived: 'derived' + Static: 'static' }; /** * Check if a given object implements the StaticNumberParam interface. */ function instanceOfStaticNumberParam(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "value" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + if (!('value' in value) || value['value'] === undefined) + return false; + return true; } -exports.instanceOfStaticNumberParam = instanceOfStaticNumberParam; function StaticNumberParamFromJSON(json) { return StaticNumberParamFromJSONTyped(json, false); } -exports.StaticNumberParamFromJSON = StaticNumberParamFromJSON; function StaticNumberParamFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -44,17 +47,15 @@ function StaticNumberParamFromJSONTyped(json, ignoreDiscriminator) { 'value': json['value'], }; } -exports.StaticNumberParamFromJSONTyped = StaticNumberParamFromJSONTyped; -function StaticNumberParamToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function StaticNumberParamToJSON(json) { + return StaticNumberParamToJSONTyped(json, false); +} +function StaticNumberParamToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'type': value.type, - 'value': value.value, + 'type': value['type'], + 'value': value['value'], }; } -exports.StaticNumberParamToJSON = StaticNumberParamToJSON; diff --git a/typescript/dist/models/StrokeParam.d.ts b/typescript/dist/models/StrokeParam.d.ts index 4e8d0aa0..3dc4cab9 100644 --- a/typescript/dist/models/StrokeParam.d.ts +++ b/typescript/dist/models/StrokeParam.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { ColorParam } from './ColorParam'; import type { NumberParam } from './NumberParam'; +import type { ColorParam } from './ColorParam'; /** * * @export @@ -33,7 +33,8 @@ export interface StrokeParam { /** * Check if a given object implements the StrokeParam interface. */ -export declare function instanceOfStrokeParam(value: object): boolean; +export declare function instanceOfStrokeParam(value: object): value is StrokeParam; export declare function StrokeParamFromJSON(json: any): StrokeParam; export declare function StrokeParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): StrokeParam; -export declare function StrokeParamToJSON(value?: StrokeParam | null): any; +export declare function StrokeParamToJSON(json: any): StrokeParam; +export declare function StrokeParamToJSONTyped(value?: StrokeParam | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/StrokeParam.js b/typescript/dist/models/StrokeParam.js index 374714ef..8b58860d 100644 --- a/typescript/dist/models/StrokeParam.js +++ b/typescript/dist/models/StrokeParam.js @@ -13,25 +13,28 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.StrokeParamToJSON = exports.StrokeParamFromJSONTyped = exports.StrokeParamFromJSON = exports.instanceOfStrokeParam = void 0; -const ColorParam_1 = require("./ColorParam"); +exports.instanceOfStrokeParam = instanceOfStrokeParam; +exports.StrokeParamFromJSON = StrokeParamFromJSON; +exports.StrokeParamFromJSONTyped = StrokeParamFromJSONTyped; +exports.StrokeParamToJSON = StrokeParamToJSON; +exports.StrokeParamToJSONTyped = StrokeParamToJSONTyped; const NumberParam_1 = require("./NumberParam"); +const ColorParam_1 = require("./ColorParam"); /** * Check if a given object implements the StrokeParam interface. */ function instanceOfStrokeParam(value) { - let isInstance = true; - isInstance = isInstance && "color" in value; - isInstance = isInstance && "width" in value; - return isInstance; + if (!('color' in value) || value['color'] === undefined) + return false; + if (!('width' in value) || value['width'] === undefined) + return false; + return true; } -exports.instanceOfStrokeParam = instanceOfStrokeParam; function StrokeParamFromJSON(json) { return StrokeParamFromJSONTyped(json, false); } -exports.StrokeParamFromJSON = StrokeParamFromJSON; function StrokeParamFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,17 +42,15 @@ function StrokeParamFromJSONTyped(json, ignoreDiscriminator) { 'width': (0, NumberParam_1.NumberParamFromJSON)(json['width']), }; } -exports.StrokeParamFromJSONTyped = StrokeParamFromJSONTyped; -function StrokeParamToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function StrokeParamToJSON(json) { + return StrokeParamToJSONTyped(json, false); +} +function StrokeParamToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'color': (0, ColorParam_1.ColorParamToJSON)(value.color), - 'width': (0, NumberParam_1.NumberParamToJSON)(value.width), + 'color': (0, ColorParam_1.ColorParamToJSON)(value['color']), + 'width': (0, NumberParam_1.NumberParamToJSON)(value['width']), }; } -exports.StrokeParamToJSON = StrokeParamToJSON; diff --git a/typescript/dist/models/SuggestMetaData.d.ts b/typescript/dist/models/SuggestMetaData.d.ts index ade70e93..40200206 100644 --- a/typescript/dist/models/SuggestMetaData.d.ts +++ b/typescript/dist/models/SuggestMetaData.d.ts @@ -38,7 +38,8 @@ export interface SuggestMetaData { /** * Check if a given object implements the SuggestMetaData interface. */ -export declare function instanceOfSuggestMetaData(value: object): boolean; +export declare function instanceOfSuggestMetaData(value: object): value is SuggestMetaData; export declare function SuggestMetaDataFromJSON(json: any): SuggestMetaData; export declare function SuggestMetaDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SuggestMetaData; -export declare function SuggestMetaDataToJSON(value?: SuggestMetaData | null): any; +export declare function SuggestMetaDataToJSON(json: any): SuggestMetaData; +export declare function SuggestMetaDataToJSONTyped(value?: SuggestMetaData | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/SuggestMetaData.js b/typescript/dist/models/SuggestMetaData.js index df5dff56..1f978d52 100644 --- a/typescript/dist/models/SuggestMetaData.js +++ b/typescript/dist/models/SuggestMetaData.js @@ -13,44 +13,43 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.SuggestMetaDataToJSON = exports.SuggestMetaDataFromJSONTyped = exports.SuggestMetaDataFromJSON = exports.instanceOfSuggestMetaData = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfSuggestMetaData = instanceOfSuggestMetaData; +exports.SuggestMetaDataFromJSON = SuggestMetaDataFromJSON; +exports.SuggestMetaDataFromJSONTyped = SuggestMetaDataFromJSONTyped; +exports.SuggestMetaDataToJSON = SuggestMetaDataToJSON; +exports.SuggestMetaDataToJSONTyped = SuggestMetaDataToJSONTyped; const DataPath_1 = require("./DataPath"); /** * Check if a given object implements the SuggestMetaData interface. */ function instanceOfSuggestMetaData(value) { - let isInstance = true; - isInstance = isInstance && "dataPath" in value; - return isInstance; + if (!('dataPath' in value) || value['dataPath'] === undefined) + return false; + return true; } -exports.instanceOfSuggestMetaData = instanceOfSuggestMetaData; function SuggestMetaDataFromJSON(json) { return SuggestMetaDataFromJSONTyped(json, false); } -exports.SuggestMetaDataFromJSON = SuggestMetaDataFromJSON; function SuggestMetaDataFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'dataPath': (0, DataPath_1.DataPathFromJSON)(json['dataPath']), - 'layerName': !(0, runtime_1.exists)(json, 'layerName') ? undefined : json['layerName'], - 'mainFile': !(0, runtime_1.exists)(json, 'mainFile') ? undefined : json['mainFile'], + 'layerName': json['layerName'] == null ? undefined : json['layerName'], + 'mainFile': json['mainFile'] == null ? undefined : json['mainFile'], }; } -exports.SuggestMetaDataFromJSONTyped = SuggestMetaDataFromJSONTyped; -function SuggestMetaDataToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function SuggestMetaDataToJSON(json) { + return SuggestMetaDataToJSONTyped(json, false); +} +function SuggestMetaDataToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'dataPath': (0, DataPath_1.DataPathToJSON)(value.dataPath), - 'layerName': value.layerName, - 'mainFile': value.mainFile, + 'dataPath': (0, DataPath_1.DataPathToJSON)(value['dataPath']), + 'layerName': value['layerName'], + 'mainFile': value['mainFile'], }; } -exports.SuggestMetaDataToJSON = SuggestMetaDataToJSON; diff --git a/typescript/dist/models/Symbology.d.ts b/typescript/dist/models/Symbology.d.ts index d3d086d9..57162129 100644 --- a/typescript/dist/models/Symbology.d.ts +++ b/typescript/dist/models/Symbology.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { LineSymbology } from './LineSymbology'; -import { PointSymbology } from './PointSymbology'; -import { PolygonSymbology } from './PolygonSymbology'; -import { RasterSymbology } from './RasterSymbology'; +import type { LineSymbology } from './LineSymbology'; +import type { PointSymbology } from './PointSymbology'; +import type { PolygonSymbology } from './PolygonSymbology'; +import type { RasterSymbology } from './RasterSymbology'; /** * @type Symbology * @@ -29,4 +29,5 @@ export type Symbology = { } & RasterSymbology; export declare function SymbologyFromJSON(json: any): Symbology; export declare function SymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Symbology; -export declare function SymbologyToJSON(value?: Symbology | null): any; +export declare function SymbologyToJSON(json: any): any; +export declare function SymbologyToJSONTyped(value?: Symbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Symbology.js b/typescript/dist/models/Symbology.js index e13dd261..423a6603 100644 --- a/typescript/dist/models/Symbology.js +++ b/typescript/dist/models/Symbology.js @@ -13,7 +13,10 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.SymbologyToJSON = exports.SymbologyFromJSONTyped = exports.SymbologyFromJSON = void 0; +exports.SymbologyFromJSON = SymbologyFromJSON; +exports.SymbologyFromJSONTyped = SymbologyFromJSONTyped; +exports.SymbologyToJSON = SymbologyToJSON; +exports.SymbologyToJSONTyped = SymbologyToJSONTyped; const LineSymbology_1 = require("./LineSymbology"); const PointSymbology_1 = require("./PointSymbology"); const PolygonSymbology_1 = require("./PolygonSymbology"); @@ -21,43 +24,40 @@ const RasterSymbology_1 = require("./RasterSymbology"); function SymbologyFromJSON(json) { return SymbologyFromJSONTyped(json, false); } -exports.SymbologyFromJSON = SymbologyFromJSON; function SymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'line': - return Object.assign(Object.assign({}, (0, LineSymbology_1.LineSymbologyFromJSONTyped)(json, true)), { type: 'line' }); + return Object.assign({}, (0, LineSymbology_1.LineSymbologyFromJSONTyped)(json, true), { type: 'line' }); case 'point': - return Object.assign(Object.assign({}, (0, PointSymbology_1.PointSymbologyFromJSONTyped)(json, true)), { type: 'point' }); + return Object.assign({}, (0, PointSymbology_1.PointSymbologyFromJSONTyped)(json, true), { type: 'point' }); case 'polygon': - return Object.assign(Object.assign({}, (0, PolygonSymbology_1.PolygonSymbologyFromJSONTyped)(json, true)), { type: 'polygon' }); + return Object.assign({}, (0, PolygonSymbology_1.PolygonSymbologyFromJSONTyped)(json, true), { type: 'polygon' }); case 'raster': - return Object.assign(Object.assign({}, (0, RasterSymbology_1.RasterSymbologyFromJSONTyped)(json, true)), { type: 'raster' }); + return Object.assign({}, (0, RasterSymbology_1.RasterSymbologyFromJSONTyped)(json, true), { type: 'raster' }); default: throw new Error(`No variant of Symbology exists with 'type=${json['type']}'`); } } -exports.SymbologyFromJSONTyped = SymbologyFromJSONTyped; -function SymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function SymbologyToJSON(json) { + return SymbologyToJSONTyped(json, false); +} +function SymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'line': - return (0, LineSymbology_1.LineSymbologyToJSON)(value); + return Object.assign({}, (0, LineSymbology_1.LineSymbologyToJSON)(value), { type: 'line' }); case 'point': - return (0, PointSymbology_1.PointSymbologyToJSON)(value); + return Object.assign({}, (0, PointSymbology_1.PointSymbologyToJSON)(value), { type: 'point' }); case 'polygon': - return (0, PolygonSymbology_1.PolygonSymbologyToJSON)(value); + return Object.assign({}, (0, PolygonSymbology_1.PolygonSymbologyToJSON)(value), { type: 'polygon' }); case 'raster': - return (0, RasterSymbology_1.RasterSymbologyToJSON)(value); + return Object.assign({}, (0, RasterSymbology_1.RasterSymbologyToJSON)(value), { type: 'raster' }); default: throw new Error(`No variant of Symbology exists with 'type=${value['type']}'`); } } -exports.SymbologyToJSON = SymbologyToJSON; diff --git a/typescript/dist/models/TaskAbortOptions.d.ts b/typescript/dist/models/TaskAbortOptions.d.ts index da84a7fc..82aaa683 100644 --- a/typescript/dist/models/TaskAbortOptions.d.ts +++ b/typescript/dist/models/TaskAbortOptions.d.ts @@ -25,7 +25,8 @@ export interface TaskAbortOptions { /** * Check if a given object implements the TaskAbortOptions interface. */ -export declare function instanceOfTaskAbortOptions(value: object): boolean; +export declare function instanceOfTaskAbortOptions(value: object): value is TaskAbortOptions; export declare function TaskAbortOptionsFromJSON(json: any): TaskAbortOptions; export declare function TaskAbortOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskAbortOptions; -export declare function TaskAbortOptionsToJSON(value?: TaskAbortOptions | null): any; +export declare function TaskAbortOptionsToJSON(json: any): TaskAbortOptions; +export declare function TaskAbortOptionsToJSONTyped(value?: TaskAbortOptions | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TaskAbortOptions.js b/typescript/dist/models/TaskAbortOptions.js index 9af1b195..ad1d4c60 100644 --- a/typescript/dist/models/TaskAbortOptions.js +++ b/typescript/dist/models/TaskAbortOptions.js @@ -13,38 +13,36 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TaskAbortOptionsToJSON = exports.TaskAbortOptionsFromJSONTyped = exports.TaskAbortOptionsFromJSON = exports.instanceOfTaskAbortOptions = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfTaskAbortOptions = instanceOfTaskAbortOptions; +exports.TaskAbortOptionsFromJSON = TaskAbortOptionsFromJSON; +exports.TaskAbortOptionsFromJSONTyped = TaskAbortOptionsFromJSONTyped; +exports.TaskAbortOptionsToJSON = TaskAbortOptionsToJSON; +exports.TaskAbortOptionsToJSONTyped = TaskAbortOptionsToJSONTyped; /** * Check if a given object implements the TaskAbortOptions interface. */ function instanceOfTaskAbortOptions(value) { - let isInstance = true; - return isInstance; + return true; } -exports.instanceOfTaskAbortOptions = instanceOfTaskAbortOptions; function TaskAbortOptionsFromJSON(json) { return TaskAbortOptionsFromJSONTyped(json, false); } -exports.TaskAbortOptionsFromJSON = TaskAbortOptionsFromJSON; function TaskAbortOptionsFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'force': !(0, runtime_1.exists)(json, 'force') ? undefined : json['force'], + 'force': json['force'] == null ? undefined : json['force'], }; } -exports.TaskAbortOptionsFromJSONTyped = TaskAbortOptionsFromJSONTyped; -function TaskAbortOptionsToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TaskAbortOptionsToJSON(json) { + return TaskAbortOptionsToJSONTyped(json, false); +} +function TaskAbortOptionsToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'force': value.force, + 'force': value['force'], }; } -exports.TaskAbortOptionsToJSON = TaskAbortOptionsToJSON; diff --git a/typescript/dist/models/TaskFilter.d.ts b/typescript/dist/models/TaskFilter.d.ts index b680418d..a50058de 100644 --- a/typescript/dist/models/TaskFilter.d.ts +++ b/typescript/dist/models/TaskFilter.d.ts @@ -20,6 +20,8 @@ export declare const TaskFilter: { readonly Completed: "completed"; }; export type TaskFilter = typeof TaskFilter[keyof typeof TaskFilter]; +export declare function instanceOfTaskFilter(value: any): boolean; export declare function TaskFilterFromJSON(json: any): TaskFilter; export declare function TaskFilterFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskFilter; export declare function TaskFilterToJSON(value?: TaskFilter | null): any; +export declare function TaskFilterToJSONTyped(value: any, ignoreDiscriminator: boolean): TaskFilter; diff --git a/typescript/dist/models/TaskFilter.js b/typescript/dist/models/TaskFilter.js index be6c476b..3953e8de 100644 --- a/typescript/dist/models/TaskFilter.js +++ b/typescript/dist/models/TaskFilter.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TaskFilterToJSON = exports.TaskFilterFromJSONTyped = exports.TaskFilterFromJSON = exports.TaskFilter = void 0; +exports.TaskFilter = void 0; +exports.instanceOfTaskFilter = instanceOfTaskFilter; +exports.TaskFilterFromJSON = TaskFilterFromJSON; +exports.TaskFilterFromJSONTyped = TaskFilterFromJSONTyped; +exports.TaskFilterToJSON = TaskFilterToJSON; +exports.TaskFilterToJSONTyped = TaskFilterToJSONTyped; /** * * @export @@ -24,15 +29,25 @@ exports.TaskFilter = { Failed: 'failed', Completed: 'completed' }; +function instanceOfTaskFilter(value) { + for (const key in exports.TaskFilter) { + if (Object.prototype.hasOwnProperty.call(exports.TaskFilter, key)) { + if (exports.TaskFilter[key] === value) { + return true; + } + } + } + return false; +} function TaskFilterFromJSON(json) { return TaskFilterFromJSONTyped(json, false); } -exports.TaskFilterFromJSON = TaskFilterFromJSON; function TaskFilterFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.TaskFilterFromJSONTyped = TaskFilterFromJSONTyped; function TaskFilterToJSON(value) { return value; } -exports.TaskFilterToJSON = TaskFilterToJSON; +function TaskFilterToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/TaskListOptions.d.ts b/typescript/dist/models/TaskListOptions.d.ts index a92ba661..3ac3cecf 100644 --- a/typescript/dist/models/TaskListOptions.d.ts +++ b/typescript/dist/models/TaskListOptions.d.ts @@ -38,7 +38,8 @@ export interface TaskListOptions { /** * Check if a given object implements the TaskListOptions interface. */ -export declare function instanceOfTaskListOptions(value: object): boolean; +export declare function instanceOfTaskListOptions(value: object): value is TaskListOptions; export declare function TaskListOptionsFromJSON(json: any): TaskListOptions; export declare function TaskListOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskListOptions; -export declare function TaskListOptionsToJSON(value?: TaskListOptions | null): any; +export declare function TaskListOptionsToJSON(json: any): TaskListOptions; +export declare function TaskListOptionsToJSONTyped(value?: TaskListOptions | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TaskListOptions.js b/typescript/dist/models/TaskListOptions.js index bb4920ec..ba596d2b 100644 --- a/typescript/dist/models/TaskListOptions.js +++ b/typescript/dist/models/TaskListOptions.js @@ -13,43 +13,41 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TaskListOptionsToJSON = exports.TaskListOptionsFromJSONTyped = exports.TaskListOptionsFromJSON = exports.instanceOfTaskListOptions = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfTaskListOptions = instanceOfTaskListOptions; +exports.TaskListOptionsFromJSON = TaskListOptionsFromJSON; +exports.TaskListOptionsFromJSONTyped = TaskListOptionsFromJSONTyped; +exports.TaskListOptionsToJSON = TaskListOptionsToJSON; +exports.TaskListOptionsToJSONTyped = TaskListOptionsToJSONTyped; const TaskFilter_1 = require("./TaskFilter"); /** * Check if a given object implements the TaskListOptions interface. */ function instanceOfTaskListOptions(value) { - let isInstance = true; - return isInstance; + return true; } -exports.instanceOfTaskListOptions = instanceOfTaskListOptions; function TaskListOptionsFromJSON(json) { return TaskListOptionsFromJSONTyped(json, false); } -exports.TaskListOptionsFromJSON = TaskListOptionsFromJSON; function TaskListOptionsFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'filter': !(0, runtime_1.exists)(json, 'filter') ? undefined : (0, TaskFilter_1.TaskFilterFromJSON)(json['filter']), - 'limit': !(0, runtime_1.exists)(json, 'limit') ? undefined : json['limit'], - 'offset': !(0, runtime_1.exists)(json, 'offset') ? undefined : json['offset'], + 'filter': json['filter'] == null ? undefined : (0, TaskFilter_1.TaskFilterFromJSON)(json['filter']), + 'limit': json['limit'] == null ? undefined : json['limit'], + 'offset': json['offset'] == null ? undefined : json['offset'], }; } -exports.TaskListOptionsFromJSONTyped = TaskListOptionsFromJSONTyped; -function TaskListOptionsToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TaskListOptionsToJSON(json) { + return TaskListOptionsToJSONTyped(json, false); +} +function TaskListOptionsToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'filter': (0, TaskFilter_1.TaskFilterToJSON)(value.filter), - 'limit': value.limit, - 'offset': value.offset, + 'filter': (0, TaskFilter_1.TaskFilterToJSON)(value['filter']), + 'limit': value['limit'], + 'offset': value['offset'], }; } -exports.TaskListOptionsToJSON = TaskListOptionsToJSON; diff --git a/typescript/dist/models/TaskResponse.d.ts b/typescript/dist/models/TaskResponse.d.ts index 1ea10c47..9f6e96ee 100644 --- a/typescript/dist/models/TaskResponse.d.ts +++ b/typescript/dist/models/TaskResponse.d.ts @@ -25,7 +25,8 @@ export interface TaskResponse { /** * Check if a given object implements the TaskResponse interface. */ -export declare function instanceOfTaskResponse(value: object): boolean; +export declare function instanceOfTaskResponse(value: object): value is TaskResponse; export declare function TaskResponseFromJSON(json: any): TaskResponse; export declare function TaskResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskResponse; -export declare function TaskResponseToJSON(value?: TaskResponse | null): any; +export declare function TaskResponseToJSON(json: any): TaskResponse; +export declare function TaskResponseToJSONTyped(value?: TaskResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TaskResponse.js b/typescript/dist/models/TaskResponse.js index 954ffce2..9b77cfe5 100644 --- a/typescript/dist/models/TaskResponse.js +++ b/typescript/dist/models/TaskResponse.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TaskResponseToJSON = exports.TaskResponseFromJSONTyped = exports.TaskResponseFromJSON = exports.instanceOfTaskResponse = void 0; +exports.instanceOfTaskResponse = instanceOfTaskResponse; +exports.TaskResponseFromJSON = TaskResponseFromJSON; +exports.TaskResponseFromJSONTyped = TaskResponseFromJSONTyped; +exports.TaskResponseToJSON = TaskResponseToJSON; +exports.TaskResponseToJSONTyped = TaskResponseToJSONTyped; /** * Check if a given object implements the TaskResponse interface. */ function instanceOfTaskResponse(value) { - let isInstance = true; - isInstance = isInstance && "taskId" in value; - return isInstance; + if (!('taskId' in value) || value['taskId'] === undefined) + return false; + return true; } -exports.instanceOfTaskResponse = instanceOfTaskResponse; function TaskResponseFromJSON(json) { return TaskResponseFromJSONTyped(json, false); } -exports.TaskResponseFromJSON = TaskResponseFromJSON; function TaskResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'taskId': json['taskId'], }; } -exports.TaskResponseFromJSONTyped = TaskResponseFromJSONTyped; -function TaskResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TaskResponseToJSON(json) { + return TaskResponseToJSONTyped(json, false); +} +function TaskResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'taskId': value.taskId, + 'taskId': value['taskId'], }; } -exports.TaskResponseToJSON = TaskResponseToJSON; diff --git a/typescript/dist/models/TaskStatus.d.ts b/typescript/dist/models/TaskStatus.d.ts index cd0e0bd9..4ae69cb1 100644 --- a/typescript/dist/models/TaskStatus.d.ts +++ b/typescript/dist/models/TaskStatus.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { TaskStatusAborted } from './TaskStatusAborted'; -import { TaskStatusCompleted } from './TaskStatusCompleted'; -import { TaskStatusFailed } from './TaskStatusFailed'; -import { TaskStatusRunning } from './TaskStatusRunning'; +import type { TaskStatusAborted } from './TaskStatusAborted'; +import type { TaskStatusCompleted } from './TaskStatusCompleted'; +import type { TaskStatusFailed } from './TaskStatusFailed'; +import type { TaskStatusRunning } from './TaskStatusRunning'; /** * @type TaskStatus * @@ -29,4 +29,5 @@ export type TaskStatus = { } & TaskStatusRunning; export declare function TaskStatusFromJSON(json: any): TaskStatus; export declare function TaskStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatus; -export declare function TaskStatusToJSON(value?: TaskStatus | null): any; +export declare function TaskStatusToJSON(json: any): any; +export declare function TaskStatusToJSONTyped(value?: TaskStatus | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TaskStatus.js b/typescript/dist/models/TaskStatus.js index dd183212..620cece8 100644 --- a/typescript/dist/models/TaskStatus.js +++ b/typescript/dist/models/TaskStatus.js @@ -13,7 +13,10 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TaskStatusToJSON = exports.TaskStatusFromJSONTyped = exports.TaskStatusFromJSON = void 0; +exports.TaskStatusFromJSON = TaskStatusFromJSON; +exports.TaskStatusFromJSONTyped = TaskStatusFromJSONTyped; +exports.TaskStatusToJSON = TaskStatusToJSON; +exports.TaskStatusToJSONTyped = TaskStatusToJSONTyped; const TaskStatusAborted_1 = require("./TaskStatusAborted"); const TaskStatusCompleted_1 = require("./TaskStatusCompleted"); const TaskStatusFailed_1 = require("./TaskStatusFailed"); @@ -21,43 +24,40 @@ const TaskStatusRunning_1 = require("./TaskStatusRunning"); function TaskStatusFromJSON(json) { return TaskStatusFromJSONTyped(json, false); } -exports.TaskStatusFromJSON = TaskStatusFromJSON; function TaskStatusFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['status']) { case 'aborted': - return Object.assign(Object.assign({}, (0, TaskStatusAborted_1.TaskStatusAbortedFromJSONTyped)(json, true)), { status: 'aborted' }); + return Object.assign({}, (0, TaskStatusAborted_1.TaskStatusAbortedFromJSONTyped)(json, true), { status: 'aborted' }); case 'completed': - return Object.assign(Object.assign({}, (0, TaskStatusCompleted_1.TaskStatusCompletedFromJSONTyped)(json, true)), { status: 'completed' }); + return Object.assign({}, (0, TaskStatusCompleted_1.TaskStatusCompletedFromJSONTyped)(json, true), { status: 'completed' }); case 'failed': - return Object.assign(Object.assign({}, (0, TaskStatusFailed_1.TaskStatusFailedFromJSONTyped)(json, true)), { status: 'failed' }); + return Object.assign({}, (0, TaskStatusFailed_1.TaskStatusFailedFromJSONTyped)(json, true), { status: 'failed' }); case 'running': - return Object.assign(Object.assign({}, (0, TaskStatusRunning_1.TaskStatusRunningFromJSONTyped)(json, true)), { status: 'running' }); + return Object.assign({}, (0, TaskStatusRunning_1.TaskStatusRunningFromJSONTyped)(json, true), { status: 'running' }); default: throw new Error(`No variant of TaskStatus exists with 'status=${json['status']}'`); } } -exports.TaskStatusFromJSONTyped = TaskStatusFromJSONTyped; -function TaskStatusToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TaskStatusToJSON(json) { + return TaskStatusToJSONTyped(json, false); +} +function TaskStatusToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['status']) { case 'aborted': - return (0, TaskStatusAborted_1.TaskStatusAbortedToJSON)(value); + return Object.assign({}, (0, TaskStatusAborted_1.TaskStatusAbortedToJSON)(value), { status: 'aborted' }); case 'completed': - return (0, TaskStatusCompleted_1.TaskStatusCompletedToJSON)(value); + return Object.assign({}, (0, TaskStatusCompleted_1.TaskStatusCompletedToJSON)(value), { status: 'completed' }); case 'failed': - return (0, TaskStatusFailed_1.TaskStatusFailedToJSON)(value); + return Object.assign({}, (0, TaskStatusFailed_1.TaskStatusFailedToJSON)(value), { status: 'failed' }); case 'running': - return (0, TaskStatusRunning_1.TaskStatusRunningToJSON)(value); + return Object.assign({}, (0, TaskStatusRunning_1.TaskStatusRunningToJSON)(value), { status: 'running' }); default: throw new Error(`No variant of TaskStatus exists with 'status=${value['status']}'`); } } -exports.TaskStatusToJSON = TaskStatusToJSON; diff --git a/typescript/dist/models/TaskStatusAborted.d.ts b/typescript/dist/models/TaskStatusAborted.d.ts index ac5d9bb1..04f019ec 100644 --- a/typescript/dist/models/TaskStatusAborted.d.ts +++ b/typescript/dist/models/TaskStatusAborted.d.ts @@ -38,7 +38,8 @@ export type TaskStatusAbortedStatusEnum = typeof TaskStatusAbortedStatusEnum[key /** * Check if a given object implements the TaskStatusAborted interface. */ -export declare function instanceOfTaskStatusAborted(value: object): boolean; +export declare function instanceOfTaskStatusAborted(value: object): value is TaskStatusAborted; export declare function TaskStatusAbortedFromJSON(json: any): TaskStatusAborted; export declare function TaskStatusAbortedFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusAborted; -export declare function TaskStatusAbortedToJSON(value?: TaskStatusAborted | null): any; +export declare function TaskStatusAbortedToJSON(json: any): TaskStatusAborted; +export declare function TaskStatusAbortedToJSONTyped(value?: TaskStatusAborted | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TaskStatusAborted.js b/typescript/dist/models/TaskStatusAborted.js index cd0cb4bd..95841b19 100644 --- a/typescript/dist/models/TaskStatusAborted.js +++ b/typescript/dist/models/TaskStatusAborted.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TaskStatusAbortedToJSON = exports.TaskStatusAbortedFromJSONTyped = exports.TaskStatusAbortedFromJSON = exports.instanceOfTaskStatusAborted = exports.TaskStatusAbortedStatusEnum = void 0; +exports.TaskStatusAbortedStatusEnum = void 0; +exports.instanceOfTaskStatusAborted = instanceOfTaskStatusAborted; +exports.TaskStatusAbortedFromJSON = TaskStatusAbortedFromJSON; +exports.TaskStatusAbortedFromJSONTyped = TaskStatusAbortedFromJSONTyped; +exports.TaskStatusAbortedToJSON = TaskStatusAbortedToJSON; +exports.TaskStatusAbortedToJSONTyped = TaskStatusAbortedToJSONTyped; /** * @export */ @@ -24,18 +29,17 @@ exports.TaskStatusAbortedStatusEnum = { * Check if a given object implements the TaskStatusAborted interface. */ function instanceOfTaskStatusAborted(value) { - let isInstance = true; - isInstance = isInstance && "cleanUp" in value; - isInstance = isInstance && "status" in value; - return isInstance; + if (!('cleanUp' in value) || value['cleanUp'] === undefined) + return false; + if (!('status' in value) || value['status'] === undefined) + return false; + return true; } -exports.instanceOfTaskStatusAborted = instanceOfTaskStatusAborted; function TaskStatusAbortedFromJSON(json) { return TaskStatusAbortedFromJSONTyped(json, false); } -exports.TaskStatusAbortedFromJSON = TaskStatusAbortedFromJSON; function TaskStatusAbortedFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -43,17 +47,15 @@ function TaskStatusAbortedFromJSONTyped(json, ignoreDiscriminator) { 'status': json['status'], }; } -exports.TaskStatusAbortedFromJSONTyped = TaskStatusAbortedFromJSONTyped; -function TaskStatusAbortedToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TaskStatusAbortedToJSON(json) { + return TaskStatusAbortedToJSONTyped(json, false); +} +function TaskStatusAbortedToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'cleanUp': value.cleanUp, - 'status': value.status, + 'cleanUp': value['cleanUp'], + 'status': value['status'], }; } -exports.TaskStatusAbortedToJSON = TaskStatusAbortedToJSON; diff --git a/typescript/dist/models/TaskStatusCompleted.d.ts b/typescript/dist/models/TaskStatusCompleted.d.ts index 1798b6b9..0ebfa76d 100644 --- a/typescript/dist/models/TaskStatusCompleted.d.ts +++ b/typescript/dist/models/TaskStatusCompleted.d.ts @@ -62,7 +62,8 @@ export type TaskStatusCompletedStatusEnum = typeof TaskStatusCompletedStatusEnum /** * Check if a given object implements the TaskStatusCompleted interface. */ -export declare function instanceOfTaskStatusCompleted(value: object): boolean; +export declare function instanceOfTaskStatusCompleted(value: object): value is TaskStatusCompleted; export declare function TaskStatusCompletedFromJSON(json: any): TaskStatusCompleted; export declare function TaskStatusCompletedFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusCompleted; -export declare function TaskStatusCompletedToJSON(value?: TaskStatusCompleted | null): any; +export declare function TaskStatusCompletedToJSON(json: any): TaskStatusCompleted; +export declare function TaskStatusCompletedToJSONTyped(value?: TaskStatusCompleted | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TaskStatusCompleted.js b/typescript/dist/models/TaskStatusCompleted.js index af562e59..bfa8130c 100644 --- a/typescript/dist/models/TaskStatusCompleted.js +++ b/typescript/dist/models/TaskStatusCompleted.js @@ -13,8 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TaskStatusCompletedToJSON = exports.TaskStatusCompletedFromJSONTyped = exports.TaskStatusCompletedFromJSON = exports.instanceOfTaskStatusCompleted = exports.TaskStatusCompletedStatusEnum = void 0; -const runtime_1 = require("../runtime"); +exports.TaskStatusCompletedStatusEnum = void 0; +exports.instanceOfTaskStatusCompleted = instanceOfTaskStatusCompleted; +exports.TaskStatusCompletedFromJSON = TaskStatusCompletedFromJSON; +exports.TaskStatusCompletedFromJSONTyped = TaskStatusCompletedFromJSONTyped; +exports.TaskStatusCompletedToJSON = TaskStatusCompletedToJSON; +exports.TaskStatusCompletedToJSONTyped = TaskStatusCompletedToJSONTyped; /** * @export */ @@ -25,46 +29,45 @@ exports.TaskStatusCompletedStatusEnum = { * Check if a given object implements the TaskStatusCompleted interface. */ function instanceOfTaskStatusCompleted(value) { - let isInstance = true; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "taskType" in value; - isInstance = isInstance && "timeStarted" in value; - isInstance = isInstance && "timeTotal" in value; - return isInstance; + if (!('status' in value) || value['status'] === undefined) + return false; + if (!('taskType' in value) || value['taskType'] === undefined) + return false; + if (!('timeStarted' in value) || value['timeStarted'] === undefined) + return false; + if (!('timeTotal' in value) || value['timeTotal'] === undefined) + return false; + return true; } -exports.instanceOfTaskStatusCompleted = instanceOfTaskStatusCompleted; function TaskStatusCompletedFromJSON(json) { return TaskStatusCompletedFromJSONTyped(json, false); } -exports.TaskStatusCompletedFromJSON = TaskStatusCompletedFromJSON; function TaskStatusCompletedFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'description': !(0, runtime_1.exists)(json, 'description') ? undefined : json['description'], - 'info': !(0, runtime_1.exists)(json, 'info') ? undefined : json['info'], + 'description': json['description'] == null ? undefined : json['description'], + 'info': json['info'] == null ? undefined : json['info'], 'status': json['status'], 'taskType': json['taskType'], 'timeStarted': json['timeStarted'], 'timeTotal': json['timeTotal'], }; } -exports.TaskStatusCompletedFromJSONTyped = TaskStatusCompletedFromJSONTyped; -function TaskStatusCompletedToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TaskStatusCompletedToJSON(json) { + return TaskStatusCompletedToJSONTyped(json, false); +} +function TaskStatusCompletedToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'info': value.info, - 'status': value.status, - 'taskType': value.taskType, - 'timeStarted': value.timeStarted, - 'timeTotal': value.timeTotal, + 'description': value['description'], + 'info': value['info'], + 'status': value['status'], + 'taskType': value['taskType'], + 'timeStarted': value['timeStarted'], + 'timeTotal': value['timeTotal'], }; } -exports.TaskStatusCompletedToJSON = TaskStatusCompletedToJSON; diff --git a/typescript/dist/models/TaskStatusFailed.d.ts b/typescript/dist/models/TaskStatusFailed.d.ts index 504596a0..33463484 100644 --- a/typescript/dist/models/TaskStatusFailed.d.ts +++ b/typescript/dist/models/TaskStatusFailed.d.ts @@ -44,7 +44,8 @@ export type TaskStatusFailedStatusEnum = typeof TaskStatusFailedStatusEnum[keyof /** * Check if a given object implements the TaskStatusFailed interface. */ -export declare function instanceOfTaskStatusFailed(value: object): boolean; +export declare function instanceOfTaskStatusFailed(value: object): value is TaskStatusFailed; export declare function TaskStatusFailedFromJSON(json: any): TaskStatusFailed; export declare function TaskStatusFailedFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusFailed; -export declare function TaskStatusFailedToJSON(value?: TaskStatusFailed | null): any; +export declare function TaskStatusFailedToJSON(json: any): TaskStatusFailed; +export declare function TaskStatusFailedToJSONTyped(value?: TaskStatusFailed | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TaskStatusFailed.js b/typescript/dist/models/TaskStatusFailed.js index f3bc6eee..ba8842c3 100644 --- a/typescript/dist/models/TaskStatusFailed.js +++ b/typescript/dist/models/TaskStatusFailed.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TaskStatusFailedToJSON = exports.TaskStatusFailedFromJSONTyped = exports.TaskStatusFailedFromJSON = exports.instanceOfTaskStatusFailed = exports.TaskStatusFailedStatusEnum = void 0; +exports.TaskStatusFailedStatusEnum = void 0; +exports.instanceOfTaskStatusFailed = instanceOfTaskStatusFailed; +exports.TaskStatusFailedFromJSON = TaskStatusFailedFromJSON; +exports.TaskStatusFailedFromJSONTyped = TaskStatusFailedFromJSONTyped; +exports.TaskStatusFailedToJSON = TaskStatusFailedToJSON; +exports.TaskStatusFailedToJSONTyped = TaskStatusFailedToJSONTyped; /** * @export */ @@ -24,19 +29,19 @@ exports.TaskStatusFailedStatusEnum = { * Check if a given object implements the TaskStatusFailed interface. */ function instanceOfTaskStatusFailed(value) { - let isInstance = true; - isInstance = isInstance && "cleanUp" in value; - isInstance = isInstance && "error" in value; - isInstance = isInstance && "status" in value; - return isInstance; + if (!('cleanUp' in value) || value['cleanUp'] === undefined) + return false; + if (!('error' in value) || value['error'] === undefined) + return false; + if (!('status' in value) || value['status'] === undefined) + return false; + return true; } -exports.instanceOfTaskStatusFailed = instanceOfTaskStatusFailed; function TaskStatusFailedFromJSON(json) { return TaskStatusFailedFromJSONTyped(json, false); } -exports.TaskStatusFailedFromJSON = TaskStatusFailedFromJSON; function TaskStatusFailedFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -45,18 +50,16 @@ function TaskStatusFailedFromJSONTyped(json, ignoreDiscriminator) { 'status': json['status'], }; } -exports.TaskStatusFailedFromJSONTyped = TaskStatusFailedFromJSONTyped; -function TaskStatusFailedToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TaskStatusFailedToJSON(json) { + return TaskStatusFailedToJSONTyped(json, false); +} +function TaskStatusFailedToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'cleanUp': value.cleanUp, - 'error': value.error, - 'status': value.status, + 'cleanUp': value['cleanUp'], + 'error': value['error'], + 'status': value['status'], }; } -exports.TaskStatusFailedToJSON = TaskStatusFailedToJSON; diff --git a/typescript/dist/models/TaskStatusRunning.d.ts b/typescript/dist/models/TaskStatusRunning.d.ts index 8a344871..6c799474 100644 --- a/typescript/dist/models/TaskStatusRunning.d.ts +++ b/typescript/dist/models/TaskStatusRunning.d.ts @@ -68,7 +68,8 @@ export type TaskStatusRunningStatusEnum = typeof TaskStatusRunningStatusEnum[key /** * Check if a given object implements the TaskStatusRunning interface. */ -export declare function instanceOfTaskStatusRunning(value: object): boolean; +export declare function instanceOfTaskStatusRunning(value: object): value is TaskStatusRunning; export declare function TaskStatusRunningFromJSON(json: any): TaskStatusRunning; export declare function TaskStatusRunningFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusRunning; -export declare function TaskStatusRunningToJSON(value?: TaskStatusRunning | null): any; +export declare function TaskStatusRunningToJSON(json: any): TaskStatusRunning; +export declare function TaskStatusRunningToJSONTyped(value?: TaskStatusRunning | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TaskStatusRunning.js b/typescript/dist/models/TaskStatusRunning.js index 05ee00f0..735a8e01 100644 --- a/typescript/dist/models/TaskStatusRunning.js +++ b/typescript/dist/models/TaskStatusRunning.js @@ -13,8 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TaskStatusRunningToJSON = exports.TaskStatusRunningFromJSONTyped = exports.TaskStatusRunningFromJSON = exports.instanceOfTaskStatusRunning = exports.TaskStatusRunningStatusEnum = void 0; -const runtime_1 = require("../runtime"); +exports.TaskStatusRunningStatusEnum = void 0; +exports.instanceOfTaskStatusRunning = instanceOfTaskStatusRunning; +exports.TaskStatusRunningFromJSON = TaskStatusRunningFromJSON; +exports.TaskStatusRunningFromJSONTyped = TaskStatusRunningFromJSONTyped; +exports.TaskStatusRunningToJSON = TaskStatusRunningToJSON; +exports.TaskStatusRunningToJSONTyped = TaskStatusRunningToJSONTyped; /** * @export */ @@ -25,49 +29,49 @@ exports.TaskStatusRunningStatusEnum = { * Check if a given object implements the TaskStatusRunning interface. */ function instanceOfTaskStatusRunning(value) { - let isInstance = true; - isInstance = isInstance && "estimatedTimeRemaining" in value; - isInstance = isInstance && "pctComplete" in value; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "taskType" in value; - isInstance = isInstance && "timeStarted" in value; - return isInstance; + if (!('estimatedTimeRemaining' in value) || value['estimatedTimeRemaining'] === undefined) + return false; + if (!('pctComplete' in value) || value['pctComplete'] === undefined) + return false; + if (!('status' in value) || value['status'] === undefined) + return false; + if (!('taskType' in value) || value['taskType'] === undefined) + return false; + if (!('timeStarted' in value) || value['timeStarted'] === undefined) + return false; + return true; } -exports.instanceOfTaskStatusRunning = instanceOfTaskStatusRunning; function TaskStatusRunningFromJSON(json) { return TaskStatusRunningFromJSONTyped(json, false); } -exports.TaskStatusRunningFromJSON = TaskStatusRunningFromJSON; function TaskStatusRunningFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'description': !(0, runtime_1.exists)(json, 'description') ? undefined : json['description'], + 'description': json['description'] == null ? undefined : json['description'], 'estimatedTimeRemaining': json['estimatedTimeRemaining'], - 'info': !(0, runtime_1.exists)(json, 'info') ? undefined : json['info'], + 'info': json['info'] == null ? undefined : json['info'], 'pctComplete': json['pctComplete'], 'status': json['status'], 'taskType': json['taskType'], 'timeStarted': json['timeStarted'], }; } -exports.TaskStatusRunningFromJSONTyped = TaskStatusRunningFromJSONTyped; -function TaskStatusRunningToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TaskStatusRunningToJSON(json) { + return TaskStatusRunningToJSONTyped(json, false); +} +function TaskStatusRunningToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'estimatedTimeRemaining': value.estimatedTimeRemaining, - 'info': value.info, - 'pctComplete': value.pctComplete, - 'status': value.status, - 'taskType': value.taskType, - 'timeStarted': value.timeStarted, + 'description': value['description'], + 'estimatedTimeRemaining': value['estimatedTimeRemaining'], + 'info': value['info'], + 'pctComplete': value['pctComplete'], + 'status': value['status'], + 'taskType': value['taskType'], + 'timeStarted': value['timeStarted'], }; } -exports.TaskStatusRunningToJSON = TaskStatusRunningToJSON; diff --git a/typescript/dist/models/TaskStatusWithId.d.ts b/typescript/dist/models/TaskStatusWithId.d.ts index 1ec8a3d8..dd98a011 100644 --- a/typescript/dist/models/TaskStatusWithId.d.ts +++ b/typescript/dist/models/TaskStatusWithId.d.ts @@ -29,7 +29,8 @@ export interface _TaskStatusWithId { /** * Check if a given object implements the TaskStatusWithId interface. */ -export declare function instanceOfTaskStatusWithId(value: object): boolean; +export declare function instanceOfTaskStatusWithId(value: object): value is TaskStatusWithId; export declare function TaskStatusWithIdFromJSON(json: any): TaskStatusWithId; export declare function TaskStatusWithIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusWithId; -export declare function TaskStatusWithIdToJSON(value?: TaskStatusWithId | null): any; +export declare function TaskStatusWithIdToJSON(json: any): TaskStatusWithId; +export declare function TaskStatusWithIdToJSONTyped(value?: TaskStatusWithId | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TaskStatusWithId.js b/typescript/dist/models/TaskStatusWithId.js index d1fd1fe7..1890cb24 100644 --- a/typescript/dist/models/TaskStatusWithId.js +++ b/typescript/dist/models/TaskStatusWithId.js @@ -13,35 +13,35 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TaskStatusWithIdToJSON = exports.TaskStatusWithIdFromJSONTyped = exports.TaskStatusWithIdFromJSON = exports.instanceOfTaskStatusWithId = void 0; +exports.instanceOfTaskStatusWithId = instanceOfTaskStatusWithId; +exports.TaskStatusWithIdFromJSON = TaskStatusWithIdFromJSON; +exports.TaskStatusWithIdFromJSONTyped = TaskStatusWithIdFromJSONTyped; +exports.TaskStatusWithIdToJSON = TaskStatusWithIdToJSON; +exports.TaskStatusWithIdToJSONTyped = TaskStatusWithIdToJSONTyped; const TaskStatus_1 = require("./TaskStatus"); /** * Check if a given object implements the TaskStatusWithId interface. */ function instanceOfTaskStatusWithId(value) { - let isInstance = true; - isInstance = isInstance && "taskId" in value; - return isInstance; + if (!('taskId' in value) || value['taskId'] === undefined) + return false; + return true; } -exports.instanceOfTaskStatusWithId = instanceOfTaskStatusWithId; function TaskStatusWithIdFromJSON(json) { return TaskStatusWithIdFromJSONTyped(json, false); } -exports.TaskStatusWithIdFromJSON = TaskStatusWithIdFromJSON; function TaskStatusWithIdFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - return Object.assign(Object.assign({}, (0, TaskStatus_1.TaskStatusFromJSONTyped)(json, ignoreDiscriminator)), { 'taskId': json['taskId'] }); + return Object.assign(Object.assign({}, (0, TaskStatus_1.TaskStatusFromJSONTyped)(json, true)), { 'taskId': json['taskId'] }); } -exports.TaskStatusWithIdFromJSONTyped = TaskStatusWithIdFromJSONTyped; -function TaskStatusWithIdToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TaskStatusWithIdToJSON(json) { + return TaskStatusWithIdToJSONTyped(json, false); +} +function TaskStatusWithIdToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } - return Object.assign(Object.assign({}, (0, TaskStatus_1.TaskStatusToJSON)(value)), { 'taskId': value.taskId }); + return Object.assign(Object.assign({}, (0, TaskStatus_1.TaskStatusToJSONTyped)(value, true)), { 'taskId': value['taskId'] }); } -exports.TaskStatusWithIdToJSON = TaskStatusWithIdToJSON; diff --git a/typescript/dist/models/TextSymbology.d.ts b/typescript/dist/models/TextSymbology.d.ts index f991cf0a..56347cce 100644 --- a/typescript/dist/models/TextSymbology.d.ts +++ b/typescript/dist/models/TextSymbology.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { ColorParam } from './ColorParam'; import type { StrokeParam } from './StrokeParam'; +import type { ColorParam } from './ColorParam'; /** * * @export @@ -39,7 +39,8 @@ export interface TextSymbology { /** * Check if a given object implements the TextSymbology interface. */ -export declare function instanceOfTextSymbology(value: object): boolean; +export declare function instanceOfTextSymbology(value: object): value is TextSymbology; export declare function TextSymbologyFromJSON(json: any): TextSymbology; export declare function TextSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): TextSymbology; -export declare function TextSymbologyToJSON(value?: TextSymbology | null): any; +export declare function TextSymbologyToJSON(json: any): TextSymbology; +export declare function TextSymbologyToJSONTyped(value?: TextSymbology | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TextSymbology.js b/typescript/dist/models/TextSymbology.js index 7cdab580..85540289 100644 --- a/typescript/dist/models/TextSymbology.js +++ b/typescript/dist/models/TextSymbology.js @@ -13,26 +13,30 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TextSymbologyToJSON = exports.TextSymbologyFromJSONTyped = exports.TextSymbologyFromJSON = exports.instanceOfTextSymbology = void 0; -const ColorParam_1 = require("./ColorParam"); +exports.instanceOfTextSymbology = instanceOfTextSymbology; +exports.TextSymbologyFromJSON = TextSymbologyFromJSON; +exports.TextSymbologyFromJSONTyped = TextSymbologyFromJSONTyped; +exports.TextSymbologyToJSON = TextSymbologyToJSON; +exports.TextSymbologyToJSONTyped = TextSymbologyToJSONTyped; const StrokeParam_1 = require("./StrokeParam"); +const ColorParam_1 = require("./ColorParam"); /** * Check if a given object implements the TextSymbology interface. */ function instanceOfTextSymbology(value) { - let isInstance = true; - isInstance = isInstance && "attribute" in value; - isInstance = isInstance && "fillColor" in value; - isInstance = isInstance && "stroke" in value; - return isInstance; + if (!('attribute' in value) || value['attribute'] === undefined) + return false; + if (!('fillColor' in value) || value['fillColor'] === undefined) + return false; + if (!('stroke' in value) || value['stroke'] === undefined) + return false; + return true; } -exports.instanceOfTextSymbology = instanceOfTextSymbology; function TextSymbologyFromJSON(json) { return TextSymbologyFromJSONTyped(json, false); } -exports.TextSymbologyFromJSON = TextSymbologyFromJSON; function TextSymbologyFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,18 +45,16 @@ function TextSymbologyFromJSONTyped(json, ignoreDiscriminator) { 'stroke': (0, StrokeParam_1.StrokeParamFromJSON)(json['stroke']), }; } -exports.TextSymbologyFromJSONTyped = TextSymbologyFromJSONTyped; -function TextSymbologyToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TextSymbologyToJSON(json) { + return TextSymbologyToJSONTyped(json, false); +} +function TextSymbologyToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'attribute': value.attribute, - 'fillColor': (0, ColorParam_1.ColorParamToJSON)(value.fillColor), - 'stroke': (0, StrokeParam_1.StrokeParamToJSON)(value.stroke), + 'attribute': value['attribute'], + 'fillColor': (0, ColorParam_1.ColorParamToJSON)(value['fillColor']), + 'stroke': (0, StrokeParam_1.StrokeParamToJSON)(value['stroke']), }; } -exports.TextSymbologyToJSON = TextSymbologyToJSON; diff --git a/typescript/dist/models/TimeGranularity.d.ts b/typescript/dist/models/TimeGranularity.d.ts index 4844814e..eaad282a 100644 --- a/typescript/dist/models/TimeGranularity.d.ts +++ b/typescript/dist/models/TimeGranularity.d.ts @@ -23,6 +23,8 @@ export declare const TimeGranularity: { readonly Years: "years"; }; export type TimeGranularity = typeof TimeGranularity[keyof typeof TimeGranularity]; +export declare function instanceOfTimeGranularity(value: any): boolean; export declare function TimeGranularityFromJSON(json: any): TimeGranularity; export declare function TimeGranularityFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeGranularity; export declare function TimeGranularityToJSON(value?: TimeGranularity | null): any; +export declare function TimeGranularityToJSONTyped(value: any, ignoreDiscriminator: boolean): TimeGranularity; diff --git a/typescript/dist/models/TimeGranularity.js b/typescript/dist/models/TimeGranularity.js index 6dd7f2b8..c623bf49 100644 --- a/typescript/dist/models/TimeGranularity.js +++ b/typescript/dist/models/TimeGranularity.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TimeGranularityToJSON = exports.TimeGranularityFromJSONTyped = exports.TimeGranularityFromJSON = exports.TimeGranularity = void 0; +exports.TimeGranularity = void 0; +exports.instanceOfTimeGranularity = instanceOfTimeGranularity; +exports.TimeGranularityFromJSON = TimeGranularityFromJSON; +exports.TimeGranularityFromJSONTyped = TimeGranularityFromJSONTyped; +exports.TimeGranularityToJSON = TimeGranularityToJSON; +exports.TimeGranularityToJSONTyped = TimeGranularityToJSONTyped; /** * A time granularity. * @export @@ -27,15 +32,25 @@ exports.TimeGranularity = { Months: 'months', Years: 'years' }; +function instanceOfTimeGranularity(value) { + for (const key in exports.TimeGranularity) { + if (Object.prototype.hasOwnProperty.call(exports.TimeGranularity, key)) { + if (exports.TimeGranularity[key] === value) { + return true; + } + } + } + return false; +} function TimeGranularityFromJSON(json) { return TimeGranularityFromJSONTyped(json, false); } -exports.TimeGranularityFromJSON = TimeGranularityFromJSON; function TimeGranularityFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.TimeGranularityFromJSONTyped = TimeGranularityFromJSONTyped; function TimeGranularityToJSON(value) { return value; } -exports.TimeGranularityToJSON = TimeGranularityToJSON; +function TimeGranularityToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/TimeInterval.d.ts b/typescript/dist/models/TimeInterval.d.ts index a438b433..668a939c 100644 --- a/typescript/dist/models/TimeInterval.d.ts +++ b/typescript/dist/models/TimeInterval.d.ts @@ -31,7 +31,8 @@ export interface TimeInterval { /** * Check if a given object implements the TimeInterval interface. */ -export declare function instanceOfTimeInterval(value: object): boolean; +export declare function instanceOfTimeInterval(value: object): value is TimeInterval; export declare function TimeIntervalFromJSON(json: any): TimeInterval; export declare function TimeIntervalFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeInterval; -export declare function TimeIntervalToJSON(value?: TimeInterval | null): any; +export declare function TimeIntervalToJSON(json: any): TimeInterval; +export declare function TimeIntervalToJSONTyped(value?: TimeInterval | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TimeInterval.js b/typescript/dist/models/TimeInterval.js index 0e63d6f0..4ccbc34c 100644 --- a/typescript/dist/models/TimeInterval.js +++ b/typescript/dist/models/TimeInterval.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TimeIntervalToJSON = exports.TimeIntervalFromJSONTyped = exports.TimeIntervalFromJSON = exports.instanceOfTimeInterval = void 0; +exports.instanceOfTimeInterval = instanceOfTimeInterval; +exports.TimeIntervalFromJSON = TimeIntervalFromJSON; +exports.TimeIntervalFromJSONTyped = TimeIntervalFromJSONTyped; +exports.TimeIntervalToJSON = TimeIntervalToJSON; +exports.TimeIntervalToJSONTyped = TimeIntervalToJSONTyped; /** * Check if a given object implements the TimeInterval interface. */ function instanceOfTimeInterval(value) { - let isInstance = true; - isInstance = isInstance && "end" in value; - isInstance = isInstance && "start" in value; - return isInstance; + if (!('end' in value) || value['end'] === undefined) + return false; + if (!('start' in value) || value['start'] === undefined) + return false; + return true; } -exports.instanceOfTimeInterval = instanceOfTimeInterval; function TimeIntervalFromJSON(json) { return TimeIntervalFromJSONTyped(json, false); } -exports.TimeIntervalFromJSON = TimeIntervalFromJSON; function TimeIntervalFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function TimeIntervalFromJSONTyped(json, ignoreDiscriminator) { 'start': json['start'], }; } -exports.TimeIntervalFromJSONTyped = TimeIntervalFromJSONTyped; -function TimeIntervalToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TimeIntervalToJSON(json) { + return TimeIntervalToJSONTyped(json, false); +} +function TimeIntervalToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'end': value.end, - 'start': value.start, + 'end': value['end'], + 'start': value['start'], }; } -exports.TimeIntervalToJSON = TimeIntervalToJSON; diff --git a/typescript/dist/models/TimeReference.d.ts b/typescript/dist/models/TimeReference.d.ts index 95a1a237..f90bcb73 100644 --- a/typescript/dist/models/TimeReference.d.ts +++ b/typescript/dist/models/TimeReference.d.ts @@ -18,6 +18,8 @@ export declare const TimeReference: { readonly End: "end"; }; export type TimeReference = typeof TimeReference[keyof typeof TimeReference]; +export declare function instanceOfTimeReference(value: any): boolean; export declare function TimeReferenceFromJSON(json: any): TimeReference; export declare function TimeReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeReference; export declare function TimeReferenceToJSON(value?: TimeReference | null): any; +export declare function TimeReferenceToJSONTyped(value: any, ignoreDiscriminator: boolean): TimeReference; diff --git a/typescript/dist/models/TimeReference.js b/typescript/dist/models/TimeReference.js index 566483f0..fb597a8a 100644 --- a/typescript/dist/models/TimeReference.js +++ b/typescript/dist/models/TimeReference.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TimeReferenceToJSON = exports.TimeReferenceFromJSONTyped = exports.TimeReferenceFromJSON = exports.TimeReference = void 0; +exports.TimeReference = void 0; +exports.instanceOfTimeReference = instanceOfTimeReference; +exports.TimeReferenceFromJSON = TimeReferenceFromJSON; +exports.TimeReferenceFromJSONTyped = TimeReferenceFromJSONTyped; +exports.TimeReferenceToJSON = TimeReferenceToJSON; +exports.TimeReferenceToJSONTyped = TimeReferenceToJSONTyped; /** * * @export @@ -22,15 +27,25 @@ exports.TimeReference = { Start: 'start', End: 'end' }; +function instanceOfTimeReference(value) { + for (const key in exports.TimeReference) { + if (Object.prototype.hasOwnProperty.call(exports.TimeReference, key)) { + if (exports.TimeReference[key] === value) { + return true; + } + } + } + return false; +} function TimeReferenceFromJSON(json) { return TimeReferenceFromJSONTyped(json, false); } -exports.TimeReferenceFromJSON = TimeReferenceFromJSON; function TimeReferenceFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.TimeReferenceFromJSONTyped = TimeReferenceFromJSONTyped; function TimeReferenceToJSON(value) { return value; } -exports.TimeReferenceToJSON = TimeReferenceToJSON; +function TimeReferenceToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/TimeStep.d.ts b/typescript/dist/models/TimeStep.d.ts index a3e6fd56..68191961 100644 --- a/typescript/dist/models/TimeStep.d.ts +++ b/typescript/dist/models/TimeStep.d.ts @@ -32,7 +32,8 @@ export interface TimeStep { /** * Check if a given object implements the TimeStep interface. */ -export declare function instanceOfTimeStep(value: object): boolean; +export declare function instanceOfTimeStep(value: object): value is TimeStep; export declare function TimeStepFromJSON(json: any): TimeStep; export declare function TimeStepFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeStep; -export declare function TimeStepToJSON(value?: TimeStep | null): any; +export declare function TimeStepToJSON(json: any): TimeStep; +export declare function TimeStepToJSONTyped(value?: TimeStep | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TimeStep.js b/typescript/dist/models/TimeStep.js index d56bac4d..ba38d687 100644 --- a/typescript/dist/models/TimeStep.js +++ b/typescript/dist/models/TimeStep.js @@ -13,24 +13,27 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TimeStepToJSON = exports.TimeStepFromJSONTyped = exports.TimeStepFromJSON = exports.instanceOfTimeStep = void 0; +exports.instanceOfTimeStep = instanceOfTimeStep; +exports.TimeStepFromJSON = TimeStepFromJSON; +exports.TimeStepFromJSONTyped = TimeStepFromJSONTyped; +exports.TimeStepToJSON = TimeStepToJSON; +exports.TimeStepToJSONTyped = TimeStepToJSONTyped; const TimeGranularity_1 = require("./TimeGranularity"); /** * Check if a given object implements the TimeStep interface. */ function instanceOfTimeStep(value) { - let isInstance = true; - isInstance = isInstance && "granularity" in value; - isInstance = isInstance && "step" in value; - return isInstance; + if (!('granularity' in value) || value['granularity'] === undefined) + return false; + if (!('step' in value) || value['step'] === undefined) + return false; + return true; } -exports.instanceOfTimeStep = instanceOfTimeStep; function TimeStepFromJSON(json) { return TimeStepFromJSONTyped(json, false); } -exports.TimeStepFromJSON = TimeStepFromJSON; function TimeStepFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -38,17 +41,15 @@ function TimeStepFromJSONTyped(json, ignoreDiscriminator) { 'step': json['step'], }; } -exports.TimeStepFromJSONTyped = TimeStepFromJSONTyped; -function TimeStepToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TimeStepToJSON(json) { + return TimeStepToJSONTyped(json, false); +} +function TimeStepToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'granularity': (0, TimeGranularity_1.TimeGranularityToJSON)(value.granularity), - 'step': value.step, + 'granularity': (0, TimeGranularity_1.TimeGranularityToJSON)(value['granularity']), + 'step': value['step'], }; } -exports.TimeStepToJSON = TimeStepToJSON; diff --git a/typescript/dist/models/TypedGeometry.d.ts b/typescript/dist/models/TypedGeometry.d.ts index 8fb9a5aa..387d5570 100644 --- a/typescript/dist/models/TypedGeometry.d.ts +++ b/typescript/dist/models/TypedGeometry.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { TypedGeometryOneOf } from './TypedGeometryOneOf'; -import { TypedGeometryOneOf1 } from './TypedGeometryOneOf1'; -import { TypedGeometryOneOf2 } from './TypedGeometryOneOf2'; -import { TypedGeometryOneOf3 } from './TypedGeometryOneOf3'; +import type { TypedGeometryOneOf } from './TypedGeometryOneOf'; +import type { TypedGeometryOneOf1 } from './TypedGeometryOneOf1'; +import type { TypedGeometryOneOf2 } from './TypedGeometryOneOf2'; +import type { TypedGeometryOneOf3 } from './TypedGeometryOneOf3'; /** * @type TypedGeometry * @@ -21,4 +21,5 @@ import { TypedGeometryOneOf3 } from './TypedGeometryOneOf3'; export type TypedGeometry = TypedGeometryOneOf | TypedGeometryOneOf1 | TypedGeometryOneOf2 | TypedGeometryOneOf3; export declare function TypedGeometryFromJSON(json: any): TypedGeometry; export declare function TypedGeometryFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometry; -export declare function TypedGeometryToJSON(value?: TypedGeometry | null): any; +export declare function TypedGeometryToJSON(json: any): any; +export declare function TypedGeometryToJSONTyped(value?: TypedGeometry | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TypedGeometry.js b/typescript/dist/models/TypedGeometry.js index 3ef4975f..bef25025 100644 --- a/typescript/dist/models/TypedGeometry.js +++ b/typescript/dist/models/TypedGeometry.js @@ -13,7 +13,10 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypedGeometryToJSON = exports.TypedGeometryFromJSONTyped = exports.TypedGeometryFromJSON = void 0; +exports.TypedGeometryFromJSON = TypedGeometryFromJSON; +exports.TypedGeometryFromJSONTyped = TypedGeometryFromJSONTyped; +exports.TypedGeometryToJSON = TypedGeometryToJSON; +exports.TypedGeometryToJSONTyped = TypedGeometryToJSONTyped; const TypedGeometryOneOf_1 = require("./TypedGeometryOneOf"); const TypedGeometryOneOf1_1 = require("./TypedGeometryOneOf1"); const TypedGeometryOneOf2_1 = require("./TypedGeometryOneOf2"); @@ -21,20 +24,30 @@ const TypedGeometryOneOf3_1 = require("./TypedGeometryOneOf3"); function TypedGeometryFromJSON(json) { return TypedGeometryFromJSONTyped(json, false); } -exports.TypedGeometryFromJSON = TypedGeometryFromJSON; function TypedGeometryFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - return Object.assign(Object.assign(Object.assign(Object.assign({}, (0, TypedGeometryOneOf_1.TypedGeometryOneOfFromJSONTyped)(json, true)), (0, TypedGeometryOneOf1_1.TypedGeometryOneOf1FromJSONTyped)(json, true)), (0, TypedGeometryOneOf2_1.TypedGeometryOneOf2FromJSONTyped)(json, true)), (0, TypedGeometryOneOf3_1.TypedGeometryOneOf3FromJSONTyped)(json, true)); -} -exports.TypedGeometryFromJSONTyped = TypedGeometryFromJSONTyped; -function TypedGeometryToJSON(value) { - if (value === undefined) { - return undefined; + if ((0, TypedGeometryOneOf_1.instanceOfTypedGeometryOneOf)(json)) { + return (0, TypedGeometryOneOf_1.TypedGeometryOneOfFromJSONTyped)(json, true); + } + if ((0, TypedGeometryOneOf1_1.instanceOfTypedGeometryOneOf1)(json)) { + return (0, TypedGeometryOneOf1_1.TypedGeometryOneOf1FromJSONTyped)(json, true); } - if (value === null) { - return null; + if ((0, TypedGeometryOneOf2_1.instanceOfTypedGeometryOneOf2)(json)) { + return (0, TypedGeometryOneOf2_1.TypedGeometryOneOf2FromJSONTyped)(json, true); + } + if ((0, TypedGeometryOneOf3_1.instanceOfTypedGeometryOneOf3)(json)) { + return (0, TypedGeometryOneOf3_1.TypedGeometryOneOf3FromJSONTyped)(json, true); + } + return {}; +} +function TypedGeometryToJSON(json) { + return TypedGeometryToJSONTyped(json, false); +} +function TypedGeometryToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } if ((0, TypedGeometryOneOf_1.instanceOfTypedGeometryOneOf)(value)) { return (0, TypedGeometryOneOf_1.TypedGeometryOneOfToJSON)(value); @@ -50,4 +63,3 @@ function TypedGeometryToJSON(value) { } return {}; } -exports.TypedGeometryToJSON = TypedGeometryToJSON; diff --git a/typescript/dist/models/TypedGeometryOneOf.d.ts b/typescript/dist/models/TypedGeometryOneOf.d.ts index 144d3260..22849c21 100644 --- a/typescript/dist/models/TypedGeometryOneOf.d.ts +++ b/typescript/dist/models/TypedGeometryOneOf.d.ts @@ -25,7 +25,8 @@ export interface TypedGeometryOneOf { /** * Check if a given object implements the TypedGeometryOneOf interface. */ -export declare function instanceOfTypedGeometryOneOf(value: object): boolean; +export declare function instanceOfTypedGeometryOneOf(value: object): value is TypedGeometryOneOf; export declare function TypedGeometryOneOfFromJSON(json: any): TypedGeometryOneOf; export declare function TypedGeometryOneOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf; -export declare function TypedGeometryOneOfToJSON(value?: TypedGeometryOneOf | null): any; +export declare function TypedGeometryOneOfToJSON(json: any): TypedGeometryOneOf; +export declare function TypedGeometryOneOfToJSONTyped(value?: TypedGeometryOneOf | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TypedGeometryOneOf.js b/typescript/dist/models/TypedGeometryOneOf.js index ad2d375a..1c22fcfa 100644 --- a/typescript/dist/models/TypedGeometryOneOf.js +++ b/typescript/dist/models/TypedGeometryOneOf.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypedGeometryOneOfToJSON = exports.TypedGeometryOneOfFromJSONTyped = exports.TypedGeometryOneOfFromJSON = exports.instanceOfTypedGeometryOneOf = void 0; +exports.instanceOfTypedGeometryOneOf = instanceOfTypedGeometryOneOf; +exports.TypedGeometryOneOfFromJSON = TypedGeometryOneOfFromJSON; +exports.TypedGeometryOneOfFromJSONTyped = TypedGeometryOneOfFromJSONTyped; +exports.TypedGeometryOneOfToJSON = TypedGeometryOneOfToJSON; +exports.TypedGeometryOneOfToJSONTyped = TypedGeometryOneOfToJSONTyped; /** * Check if a given object implements the TypedGeometryOneOf interface. */ function instanceOfTypedGeometryOneOf(value) { - let isInstance = true; - isInstance = isInstance && "data" in value; - return isInstance; + if (!('data' in value) || value['data'] === undefined) + return false; + return true; } -exports.instanceOfTypedGeometryOneOf = instanceOfTypedGeometryOneOf; function TypedGeometryOneOfFromJSON(json) { return TypedGeometryOneOfFromJSONTyped(json, false); } -exports.TypedGeometryOneOfFromJSON = TypedGeometryOneOfFromJSON; function TypedGeometryOneOfFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'data': json['Data'], }; } -exports.TypedGeometryOneOfFromJSONTyped = TypedGeometryOneOfFromJSONTyped; -function TypedGeometryOneOfToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TypedGeometryOneOfToJSON(json) { + return TypedGeometryOneOfToJSONTyped(json, false); +} +function TypedGeometryOneOfToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'Data': value.data, + 'Data': value['data'], }; } -exports.TypedGeometryOneOfToJSON = TypedGeometryOneOfToJSON; diff --git a/typescript/dist/models/TypedGeometryOneOf1.d.ts b/typescript/dist/models/TypedGeometryOneOf1.d.ts index c0f65753..42f044e1 100644 --- a/typescript/dist/models/TypedGeometryOneOf1.d.ts +++ b/typescript/dist/models/TypedGeometryOneOf1.d.ts @@ -26,7 +26,8 @@ export interface TypedGeometryOneOf1 { /** * Check if a given object implements the TypedGeometryOneOf1 interface. */ -export declare function instanceOfTypedGeometryOneOf1(value: object): boolean; +export declare function instanceOfTypedGeometryOneOf1(value: object): value is TypedGeometryOneOf1; export declare function TypedGeometryOneOf1FromJSON(json: any): TypedGeometryOneOf1; export declare function TypedGeometryOneOf1FromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf1; -export declare function TypedGeometryOneOf1ToJSON(value?: TypedGeometryOneOf1 | null): any; +export declare function TypedGeometryOneOf1ToJSON(json: any): TypedGeometryOneOf1; +export declare function TypedGeometryOneOf1ToJSONTyped(value?: TypedGeometryOneOf1 | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TypedGeometryOneOf1.js b/typescript/dist/models/TypedGeometryOneOf1.js index 5da85afd..cc68f7cf 100644 --- a/typescript/dist/models/TypedGeometryOneOf1.js +++ b/typescript/dist/models/TypedGeometryOneOf1.js @@ -13,39 +13,39 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypedGeometryOneOf1ToJSON = exports.TypedGeometryOneOf1FromJSONTyped = exports.TypedGeometryOneOf1FromJSON = exports.instanceOfTypedGeometryOneOf1 = void 0; +exports.instanceOfTypedGeometryOneOf1 = instanceOfTypedGeometryOneOf1; +exports.TypedGeometryOneOf1FromJSON = TypedGeometryOneOf1FromJSON; +exports.TypedGeometryOneOf1FromJSONTyped = TypedGeometryOneOf1FromJSONTyped; +exports.TypedGeometryOneOf1ToJSON = TypedGeometryOneOf1ToJSON; +exports.TypedGeometryOneOf1ToJSONTyped = TypedGeometryOneOf1ToJSONTyped; const MultiPoint_1 = require("./MultiPoint"); /** * Check if a given object implements the TypedGeometryOneOf1 interface. */ function instanceOfTypedGeometryOneOf1(value) { - let isInstance = true; - isInstance = isInstance && "multiPoint" in value; - return isInstance; + if (!('multiPoint' in value) || value['multiPoint'] === undefined) + return false; + return true; } -exports.instanceOfTypedGeometryOneOf1 = instanceOfTypedGeometryOneOf1; function TypedGeometryOneOf1FromJSON(json) { return TypedGeometryOneOf1FromJSONTyped(json, false); } -exports.TypedGeometryOneOf1FromJSON = TypedGeometryOneOf1FromJSON; function TypedGeometryOneOf1FromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'multiPoint': (0, MultiPoint_1.MultiPointFromJSON)(json['MultiPoint']), }; } -exports.TypedGeometryOneOf1FromJSONTyped = TypedGeometryOneOf1FromJSONTyped; -function TypedGeometryOneOf1ToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TypedGeometryOneOf1ToJSON(json) { + return TypedGeometryOneOf1ToJSONTyped(json, false); +} +function TypedGeometryOneOf1ToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'MultiPoint': (0, MultiPoint_1.MultiPointToJSON)(value.multiPoint), + 'MultiPoint': (0, MultiPoint_1.MultiPointToJSON)(value['multiPoint']), }; } -exports.TypedGeometryOneOf1ToJSON = TypedGeometryOneOf1ToJSON; diff --git a/typescript/dist/models/TypedGeometryOneOf2.d.ts b/typescript/dist/models/TypedGeometryOneOf2.d.ts index bb17369f..afcd53a3 100644 --- a/typescript/dist/models/TypedGeometryOneOf2.d.ts +++ b/typescript/dist/models/TypedGeometryOneOf2.d.ts @@ -26,7 +26,8 @@ export interface TypedGeometryOneOf2 { /** * Check if a given object implements the TypedGeometryOneOf2 interface. */ -export declare function instanceOfTypedGeometryOneOf2(value: object): boolean; +export declare function instanceOfTypedGeometryOneOf2(value: object): value is TypedGeometryOneOf2; export declare function TypedGeometryOneOf2FromJSON(json: any): TypedGeometryOneOf2; export declare function TypedGeometryOneOf2FromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf2; -export declare function TypedGeometryOneOf2ToJSON(value?: TypedGeometryOneOf2 | null): any; +export declare function TypedGeometryOneOf2ToJSON(json: any): TypedGeometryOneOf2; +export declare function TypedGeometryOneOf2ToJSONTyped(value?: TypedGeometryOneOf2 | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TypedGeometryOneOf2.js b/typescript/dist/models/TypedGeometryOneOf2.js index db54e7a2..7b931c2b 100644 --- a/typescript/dist/models/TypedGeometryOneOf2.js +++ b/typescript/dist/models/TypedGeometryOneOf2.js @@ -13,39 +13,39 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypedGeometryOneOf2ToJSON = exports.TypedGeometryOneOf2FromJSONTyped = exports.TypedGeometryOneOf2FromJSON = exports.instanceOfTypedGeometryOneOf2 = void 0; +exports.instanceOfTypedGeometryOneOf2 = instanceOfTypedGeometryOneOf2; +exports.TypedGeometryOneOf2FromJSON = TypedGeometryOneOf2FromJSON; +exports.TypedGeometryOneOf2FromJSONTyped = TypedGeometryOneOf2FromJSONTyped; +exports.TypedGeometryOneOf2ToJSON = TypedGeometryOneOf2ToJSON; +exports.TypedGeometryOneOf2ToJSONTyped = TypedGeometryOneOf2ToJSONTyped; const MultiLineString_1 = require("./MultiLineString"); /** * Check if a given object implements the TypedGeometryOneOf2 interface. */ function instanceOfTypedGeometryOneOf2(value) { - let isInstance = true; - isInstance = isInstance && "multiLineString" in value; - return isInstance; + if (!('multiLineString' in value) || value['multiLineString'] === undefined) + return false; + return true; } -exports.instanceOfTypedGeometryOneOf2 = instanceOfTypedGeometryOneOf2; function TypedGeometryOneOf2FromJSON(json) { return TypedGeometryOneOf2FromJSONTyped(json, false); } -exports.TypedGeometryOneOf2FromJSON = TypedGeometryOneOf2FromJSON; function TypedGeometryOneOf2FromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'multiLineString': (0, MultiLineString_1.MultiLineStringFromJSON)(json['MultiLineString']), }; } -exports.TypedGeometryOneOf2FromJSONTyped = TypedGeometryOneOf2FromJSONTyped; -function TypedGeometryOneOf2ToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TypedGeometryOneOf2ToJSON(json) { + return TypedGeometryOneOf2ToJSONTyped(json, false); +} +function TypedGeometryOneOf2ToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'MultiLineString': (0, MultiLineString_1.MultiLineStringToJSON)(value.multiLineString), + 'MultiLineString': (0, MultiLineString_1.MultiLineStringToJSON)(value['multiLineString']), }; } -exports.TypedGeometryOneOf2ToJSON = TypedGeometryOneOf2ToJSON; diff --git a/typescript/dist/models/TypedGeometryOneOf3.d.ts b/typescript/dist/models/TypedGeometryOneOf3.d.ts index 10252452..6f34e815 100644 --- a/typescript/dist/models/TypedGeometryOneOf3.d.ts +++ b/typescript/dist/models/TypedGeometryOneOf3.d.ts @@ -26,7 +26,8 @@ export interface TypedGeometryOneOf3 { /** * Check if a given object implements the TypedGeometryOneOf3 interface. */ -export declare function instanceOfTypedGeometryOneOf3(value: object): boolean; +export declare function instanceOfTypedGeometryOneOf3(value: object): value is TypedGeometryOneOf3; export declare function TypedGeometryOneOf3FromJSON(json: any): TypedGeometryOneOf3; export declare function TypedGeometryOneOf3FromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf3; -export declare function TypedGeometryOneOf3ToJSON(value?: TypedGeometryOneOf3 | null): any; +export declare function TypedGeometryOneOf3ToJSON(json: any): TypedGeometryOneOf3; +export declare function TypedGeometryOneOf3ToJSONTyped(value?: TypedGeometryOneOf3 | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TypedGeometryOneOf3.js b/typescript/dist/models/TypedGeometryOneOf3.js index 2433f0e2..50a45e57 100644 --- a/typescript/dist/models/TypedGeometryOneOf3.js +++ b/typescript/dist/models/TypedGeometryOneOf3.js @@ -13,39 +13,39 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypedGeometryOneOf3ToJSON = exports.TypedGeometryOneOf3FromJSONTyped = exports.TypedGeometryOneOf3FromJSON = exports.instanceOfTypedGeometryOneOf3 = void 0; +exports.instanceOfTypedGeometryOneOf3 = instanceOfTypedGeometryOneOf3; +exports.TypedGeometryOneOf3FromJSON = TypedGeometryOneOf3FromJSON; +exports.TypedGeometryOneOf3FromJSONTyped = TypedGeometryOneOf3FromJSONTyped; +exports.TypedGeometryOneOf3ToJSON = TypedGeometryOneOf3ToJSON; +exports.TypedGeometryOneOf3ToJSONTyped = TypedGeometryOneOf3ToJSONTyped; const MultiPolygon_1 = require("./MultiPolygon"); /** * Check if a given object implements the TypedGeometryOneOf3 interface. */ function instanceOfTypedGeometryOneOf3(value) { - let isInstance = true; - isInstance = isInstance && "multiPolygon" in value; - return isInstance; + if (!('multiPolygon' in value) || value['multiPolygon'] === undefined) + return false; + return true; } -exports.instanceOfTypedGeometryOneOf3 = instanceOfTypedGeometryOneOf3; function TypedGeometryOneOf3FromJSON(json) { return TypedGeometryOneOf3FromJSONTyped(json, false); } -exports.TypedGeometryOneOf3FromJSON = TypedGeometryOneOf3FromJSON; function TypedGeometryOneOf3FromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'multiPolygon': (0, MultiPolygon_1.MultiPolygonFromJSON)(json['MultiPolygon']), }; } -exports.TypedGeometryOneOf3FromJSONTyped = TypedGeometryOneOf3FromJSONTyped; -function TypedGeometryOneOf3ToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TypedGeometryOneOf3ToJSON(json) { + return TypedGeometryOneOf3ToJSONTyped(json, false); +} +function TypedGeometryOneOf3ToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'MultiPolygon': (0, MultiPolygon_1.MultiPolygonToJSON)(value.multiPolygon), + 'MultiPolygon': (0, MultiPolygon_1.MultiPolygonToJSON)(value['multiPolygon']), }; } -exports.TypedGeometryOneOf3ToJSON = TypedGeometryOneOf3ToJSON; diff --git a/typescript/dist/models/TypedOperator.d.ts b/typescript/dist/models/TypedOperator.d.ts index 7da0150b..64b8dda6 100644 --- a/typescript/dist/models/TypedOperator.d.ts +++ b/typescript/dist/models/TypedOperator.d.ts @@ -41,7 +41,8 @@ export type TypedOperatorTypeEnum = typeof TypedOperatorTypeEnum[keyof typeof Ty /** * Check if a given object implements the TypedOperator interface. */ -export declare function instanceOfTypedOperator(value: object): boolean; +export declare function instanceOfTypedOperator(value: object): value is TypedOperator; export declare function TypedOperatorFromJSON(json: any): TypedOperator; export declare function TypedOperatorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedOperator; -export declare function TypedOperatorToJSON(value?: TypedOperator | null): any; +export declare function TypedOperatorToJSON(json: any): TypedOperator; +export declare function TypedOperatorToJSONTyped(value?: TypedOperator | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TypedOperator.js b/typescript/dist/models/TypedOperator.js index 31f1a135..5fe12994 100644 --- a/typescript/dist/models/TypedOperator.js +++ b/typescript/dist/models/TypedOperator.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypedOperatorToJSON = exports.TypedOperatorFromJSONTyped = exports.TypedOperatorFromJSON = exports.instanceOfTypedOperator = exports.TypedOperatorTypeEnum = void 0; +exports.TypedOperatorTypeEnum = void 0; +exports.instanceOfTypedOperator = instanceOfTypedOperator; +exports.TypedOperatorFromJSON = TypedOperatorFromJSON; +exports.TypedOperatorFromJSONTyped = TypedOperatorFromJSONTyped; +exports.TypedOperatorToJSON = TypedOperatorToJSON; +exports.TypedOperatorToJSONTyped = TypedOperatorToJSONTyped; const TypedOperatorOperator_1 = require("./TypedOperatorOperator"); /** * @export @@ -27,18 +32,17 @@ exports.TypedOperatorTypeEnum = { * Check if a given object implements the TypedOperator interface. */ function instanceOfTypedOperator(value) { - let isInstance = true; - isInstance = isInstance && "operator" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('operator' in value) || value['operator'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfTypedOperator = instanceOfTypedOperator; function TypedOperatorFromJSON(json) { return TypedOperatorFromJSONTyped(json, false); } -exports.TypedOperatorFromJSON = TypedOperatorFromJSON; function TypedOperatorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -46,17 +50,15 @@ function TypedOperatorFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.TypedOperatorFromJSONTyped = TypedOperatorFromJSONTyped; -function TypedOperatorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TypedOperatorToJSON(json) { + return TypedOperatorToJSONTyped(json, false); +} +function TypedOperatorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'operator': (0, TypedOperatorOperator_1.TypedOperatorOperatorToJSON)(value.operator), - 'type': value.type, + 'operator': (0, TypedOperatorOperator_1.TypedOperatorOperatorToJSON)(value['operator']), + 'type': value['type'], }; } -exports.TypedOperatorToJSON = TypedOperatorToJSON; diff --git a/typescript/dist/models/TypedOperatorOperator.d.ts b/typescript/dist/models/TypedOperatorOperator.d.ts index f963ebb2..a7bf1a64 100644 --- a/typescript/dist/models/TypedOperatorOperator.d.ts +++ b/typescript/dist/models/TypedOperatorOperator.d.ts @@ -37,7 +37,8 @@ export interface TypedOperatorOperator { /** * Check if a given object implements the TypedOperatorOperator interface. */ -export declare function instanceOfTypedOperatorOperator(value: object): boolean; +export declare function instanceOfTypedOperatorOperator(value: object): value is TypedOperatorOperator; export declare function TypedOperatorOperatorFromJSON(json: any): TypedOperatorOperator; export declare function TypedOperatorOperatorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedOperatorOperator; -export declare function TypedOperatorOperatorToJSON(value?: TypedOperatorOperator | null): any; +export declare function TypedOperatorOperatorToJSON(json: any): TypedOperatorOperator; +export declare function TypedOperatorOperatorToJSONTyped(value?: TypedOperatorOperator | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TypedOperatorOperator.js b/typescript/dist/models/TypedOperatorOperator.js index 6d9b1744..d077cbde 100644 --- a/typescript/dist/models/TypedOperatorOperator.js +++ b/typescript/dist/models/TypedOperatorOperator.js @@ -13,43 +13,42 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypedOperatorOperatorToJSON = exports.TypedOperatorOperatorFromJSONTyped = exports.TypedOperatorOperatorFromJSON = exports.instanceOfTypedOperatorOperator = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfTypedOperatorOperator = instanceOfTypedOperatorOperator; +exports.TypedOperatorOperatorFromJSON = TypedOperatorOperatorFromJSON; +exports.TypedOperatorOperatorFromJSONTyped = TypedOperatorOperatorFromJSONTyped; +exports.TypedOperatorOperatorToJSON = TypedOperatorOperatorToJSON; +exports.TypedOperatorOperatorToJSONTyped = TypedOperatorOperatorToJSONTyped; /** * Check if a given object implements the TypedOperatorOperator interface. */ function instanceOfTypedOperatorOperator(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfTypedOperatorOperator = instanceOfTypedOperatorOperator; function TypedOperatorOperatorFromJSON(json) { return TypedOperatorOperatorFromJSONTyped(json, false); } -exports.TypedOperatorOperatorFromJSON = TypedOperatorOperatorFromJSON; function TypedOperatorOperatorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'params': !(0, runtime_1.exists)(json, 'params') ? undefined : json['params'], - 'sources': !(0, runtime_1.exists)(json, 'sources') ? undefined : json['sources'], + 'params': json['params'] == null ? undefined : json['params'], + 'sources': json['sources'] == null ? undefined : json['sources'], 'type': json['type'], }; } -exports.TypedOperatorOperatorFromJSONTyped = TypedOperatorOperatorFromJSONTyped; -function TypedOperatorOperatorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TypedOperatorOperatorToJSON(json) { + return TypedOperatorOperatorToJSONTyped(json, false); +} +function TypedOperatorOperatorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'params': value.params, - 'sources': value.sources, - 'type': value.type, + 'params': value['params'], + 'sources': value['sources'], + 'type': value['type'], }; } -exports.TypedOperatorOperatorToJSON = TypedOperatorOperatorToJSON; diff --git a/typescript/dist/models/TypedPlotResultDescriptor.d.ts b/typescript/dist/models/TypedPlotResultDescriptor.d.ts index 4c2d4c1e..f98a5e4e 100644 --- a/typescript/dist/models/TypedPlotResultDescriptor.d.ts +++ b/typescript/dist/models/TypedPlotResultDescriptor.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; import type { TimeInterval } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * A `ResultDescriptor` for plot queries * @export @@ -52,7 +52,8 @@ export type TypedPlotResultDescriptorTypeEnum = typeof TypedPlotResultDescriptor /** * Check if a given object implements the TypedPlotResultDescriptor interface. */ -export declare function instanceOfTypedPlotResultDescriptor(value: object): boolean; +export declare function instanceOfTypedPlotResultDescriptor(value: object): value is TypedPlotResultDescriptor; export declare function TypedPlotResultDescriptorFromJSON(json: any): TypedPlotResultDescriptor; export declare function TypedPlotResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedPlotResultDescriptor; -export declare function TypedPlotResultDescriptorToJSON(value?: TypedPlotResultDescriptor | null): any; +export declare function TypedPlotResultDescriptorToJSON(json: any): TypedPlotResultDescriptor; +export declare function TypedPlotResultDescriptorToJSONTyped(value?: TypedPlotResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TypedPlotResultDescriptor.js b/typescript/dist/models/TypedPlotResultDescriptor.js index a2a22eb4..a48f88d5 100644 --- a/typescript/dist/models/TypedPlotResultDescriptor.js +++ b/typescript/dist/models/TypedPlotResultDescriptor.js @@ -13,10 +13,14 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypedPlotResultDescriptorToJSON = exports.TypedPlotResultDescriptorFromJSONTyped = exports.TypedPlotResultDescriptorFromJSON = exports.instanceOfTypedPlotResultDescriptor = exports.TypedPlotResultDescriptorTypeEnum = void 0; -const runtime_1 = require("../runtime"); -const BoundingBox2D_1 = require("./BoundingBox2D"); +exports.TypedPlotResultDescriptorTypeEnum = void 0; +exports.instanceOfTypedPlotResultDescriptor = instanceOfTypedPlotResultDescriptor; +exports.TypedPlotResultDescriptorFromJSON = TypedPlotResultDescriptorFromJSON; +exports.TypedPlotResultDescriptorFromJSONTyped = TypedPlotResultDescriptorFromJSONTyped; +exports.TypedPlotResultDescriptorToJSON = TypedPlotResultDescriptorToJSON; +exports.TypedPlotResultDescriptorToJSONTyped = TypedPlotResultDescriptorToJSONTyped; const TimeInterval_1 = require("./TimeInterval"); +const BoundingBox2D_1 = require("./BoundingBox2D"); /** * @export */ @@ -27,40 +31,37 @@ exports.TypedPlotResultDescriptorTypeEnum = { * Check if a given object implements the TypedPlotResultDescriptor interface. */ function instanceOfTypedPlotResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfTypedPlotResultDescriptor = instanceOfTypedPlotResultDescriptor; function TypedPlotResultDescriptorFromJSON(json) { return TypedPlotResultDescriptorFromJSONTyped(json, false); } -exports.TypedPlotResultDescriptorFromJSON = TypedPlotResultDescriptorFromJSON; function TypedPlotResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !(0, runtime_1.exists)(json, 'bbox') ? undefined : (0, BoundingBox2D_1.BoundingBox2DFromJSON)(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : (0, BoundingBox2D_1.BoundingBox2DFromJSON)(json['bbox']), 'spatialReference': json['spatialReference'], - 'time': !(0, runtime_1.exists)(json, 'time') ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), + 'time': json['time'] == null ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), 'type': json['type'], }; } -exports.TypedPlotResultDescriptorFromJSONTyped = TypedPlotResultDescriptorFromJSONTyped; -function TypedPlotResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TypedPlotResultDescriptorToJSON(json) { + return TypedPlotResultDescriptorToJSONTyped(json, false); +} +function TypedPlotResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bbox': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value.bbox), - 'spatialReference': value.spatialReference, - 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value.time), - 'type': value.type, + 'bbox': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value['bbox']), + 'spatialReference': value['spatialReference'], + 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value['time']), + 'type': value['type'], }; } -exports.TypedPlotResultDescriptorToJSON = TypedPlotResultDescriptorToJSON; diff --git a/typescript/dist/models/TypedRasterResultDescriptor.d.ts b/typescript/dist/models/TypedRasterResultDescriptor.d.ts index 582712a7..b1b7d737 100644 --- a/typescript/dist/models/TypedRasterResultDescriptor.d.ts +++ b/typescript/dist/models/TypedRasterResultDescriptor.d.ts @@ -9,11 +9,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import type { SpatialResolution } from './SpatialResolution'; +import type { TimeInterval } from './TimeInterval'; import type { RasterBandDescriptor } from './RasterBandDescriptor'; import type { RasterDataType } from './RasterDataType'; import type { SpatialPartition2D } from './SpatialPartition2D'; -import type { SpatialResolution } from './SpatialResolution'; -import type { TimeInterval } from './TimeInterval'; /** * A `ResultDescriptor` for raster queries * @export @@ -73,7 +73,8 @@ export type TypedRasterResultDescriptorTypeEnum = typeof TypedRasterResultDescri /** * Check if a given object implements the TypedRasterResultDescriptor interface. */ -export declare function instanceOfTypedRasterResultDescriptor(value: object): boolean; +export declare function instanceOfTypedRasterResultDescriptor(value: object): value is TypedRasterResultDescriptor; export declare function TypedRasterResultDescriptorFromJSON(json: any): TypedRasterResultDescriptor; export declare function TypedRasterResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedRasterResultDescriptor; -export declare function TypedRasterResultDescriptorToJSON(value?: TypedRasterResultDescriptor | null): any; +export declare function TypedRasterResultDescriptorToJSON(json: any): TypedRasterResultDescriptor; +export declare function TypedRasterResultDescriptorToJSONTyped(value?: TypedRasterResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TypedRasterResultDescriptor.js b/typescript/dist/models/TypedRasterResultDescriptor.js index b402725b..e00f6ca7 100644 --- a/typescript/dist/models/TypedRasterResultDescriptor.js +++ b/typescript/dist/models/TypedRasterResultDescriptor.js @@ -13,13 +13,17 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypedRasterResultDescriptorToJSON = exports.TypedRasterResultDescriptorFromJSONTyped = exports.TypedRasterResultDescriptorFromJSON = exports.instanceOfTypedRasterResultDescriptor = exports.TypedRasterResultDescriptorTypeEnum = void 0; -const runtime_1 = require("../runtime"); +exports.TypedRasterResultDescriptorTypeEnum = void 0; +exports.instanceOfTypedRasterResultDescriptor = instanceOfTypedRasterResultDescriptor; +exports.TypedRasterResultDescriptorFromJSON = TypedRasterResultDescriptorFromJSON; +exports.TypedRasterResultDescriptorFromJSONTyped = TypedRasterResultDescriptorFromJSONTyped; +exports.TypedRasterResultDescriptorToJSON = TypedRasterResultDescriptorToJSON; +exports.TypedRasterResultDescriptorToJSONTyped = TypedRasterResultDescriptorToJSONTyped; +const SpatialResolution_1 = require("./SpatialResolution"); +const TimeInterval_1 = require("./TimeInterval"); const RasterBandDescriptor_1 = require("./RasterBandDescriptor"); const RasterDataType_1 = require("./RasterDataType"); const SpatialPartition2D_1 = require("./SpatialPartition2D"); -const SpatialResolution_1 = require("./SpatialResolution"); -const TimeInterval_1 = require("./TimeInterval"); /** * @export */ @@ -30,48 +34,47 @@ exports.TypedRasterResultDescriptorTypeEnum = { * Check if a given object implements the TypedRasterResultDescriptor interface. */ function instanceOfTypedRasterResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "bands" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('bands' in value) || value['bands'] === undefined) + return false; + if (!('dataType' in value) || value['dataType'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfTypedRasterResultDescriptor = instanceOfTypedRasterResultDescriptor; function TypedRasterResultDescriptorFromJSON(json) { return TypedRasterResultDescriptorFromJSONTyped(json, false); } -exports.TypedRasterResultDescriptorFromJSON = TypedRasterResultDescriptorFromJSON; function TypedRasterResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bands': (json['bands'].map(RasterBandDescriptor_1.RasterBandDescriptorFromJSON)), - 'bbox': !(0, runtime_1.exists)(json, 'bbox') ? undefined : (0, SpatialPartition2D_1.SpatialPartition2DFromJSON)(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : (0, SpatialPartition2D_1.SpatialPartition2DFromJSON)(json['bbox']), 'dataType': (0, RasterDataType_1.RasterDataTypeFromJSON)(json['dataType']), - 'resolution': !(0, runtime_1.exists)(json, 'resolution') ? undefined : (0, SpatialResolution_1.SpatialResolutionFromJSON)(json['resolution']), + 'resolution': json['resolution'] == null ? undefined : (0, SpatialResolution_1.SpatialResolutionFromJSON)(json['resolution']), 'spatialReference': json['spatialReference'], - 'time': !(0, runtime_1.exists)(json, 'time') ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), + 'time': json['time'] == null ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), 'type': json['type'], }; } -exports.TypedRasterResultDescriptorFromJSONTyped = TypedRasterResultDescriptorFromJSONTyped; -function TypedRasterResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TypedRasterResultDescriptorToJSON(json) { + return TypedRasterResultDescriptorToJSONTyped(json, false); +} +function TypedRasterResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bands': (value.bands.map(RasterBandDescriptor_1.RasterBandDescriptorToJSON)), - 'bbox': (0, SpatialPartition2D_1.SpatialPartition2DToJSON)(value.bbox), - 'dataType': (0, RasterDataType_1.RasterDataTypeToJSON)(value.dataType), - 'resolution': (0, SpatialResolution_1.SpatialResolutionToJSON)(value.resolution), - 'spatialReference': value.spatialReference, - 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value.time), - 'type': value.type, + 'bands': (value['bands'].map(RasterBandDescriptor_1.RasterBandDescriptorToJSON)), + 'bbox': (0, SpatialPartition2D_1.SpatialPartition2DToJSON)(value['bbox']), + 'dataType': (0, RasterDataType_1.RasterDataTypeToJSON)(value['dataType']), + 'resolution': (0, SpatialResolution_1.SpatialResolutionToJSON)(value['resolution']), + 'spatialReference': value['spatialReference'], + 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value['time']), + 'type': value['type'], }; } -exports.TypedRasterResultDescriptorToJSON = TypedRasterResultDescriptorToJSON; diff --git a/typescript/dist/models/TypedResultDescriptor.d.ts b/typescript/dist/models/TypedResultDescriptor.d.ts index dfae9e11..2a12b53e 100644 --- a/typescript/dist/models/TypedResultDescriptor.d.ts +++ b/typescript/dist/models/TypedResultDescriptor.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { TypedPlotResultDescriptor } from './TypedPlotResultDescriptor'; -import { TypedRasterResultDescriptor } from './TypedRasterResultDescriptor'; -import { TypedVectorResultDescriptor } from './TypedVectorResultDescriptor'; +import type { TypedPlotResultDescriptor } from './TypedPlotResultDescriptor'; +import type { TypedRasterResultDescriptor } from './TypedRasterResultDescriptor'; +import type { TypedVectorResultDescriptor } from './TypedVectorResultDescriptor'; /** * @type TypedResultDescriptor * @@ -26,4 +26,5 @@ export type TypedResultDescriptor = { } & TypedVectorResultDescriptor; export declare function TypedResultDescriptorFromJSON(json: any): TypedResultDescriptor; export declare function TypedResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedResultDescriptor; -export declare function TypedResultDescriptorToJSON(value?: TypedResultDescriptor | null): any; +export declare function TypedResultDescriptorToJSON(json: any): any; +export declare function TypedResultDescriptorToJSONTyped(value?: TypedResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TypedResultDescriptor.js b/typescript/dist/models/TypedResultDescriptor.js index 3657755b..e10d1391 100644 --- a/typescript/dist/models/TypedResultDescriptor.js +++ b/typescript/dist/models/TypedResultDescriptor.js @@ -13,46 +13,46 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypedResultDescriptorToJSON = exports.TypedResultDescriptorFromJSONTyped = exports.TypedResultDescriptorFromJSON = void 0; +exports.TypedResultDescriptorFromJSON = TypedResultDescriptorFromJSON; +exports.TypedResultDescriptorFromJSONTyped = TypedResultDescriptorFromJSONTyped; +exports.TypedResultDescriptorToJSON = TypedResultDescriptorToJSON; +exports.TypedResultDescriptorToJSONTyped = TypedResultDescriptorToJSONTyped; const TypedPlotResultDescriptor_1 = require("./TypedPlotResultDescriptor"); const TypedRasterResultDescriptor_1 = require("./TypedRasterResultDescriptor"); const TypedVectorResultDescriptor_1 = require("./TypedVectorResultDescriptor"); function TypedResultDescriptorFromJSON(json) { return TypedResultDescriptorFromJSONTyped(json, false); } -exports.TypedResultDescriptorFromJSON = TypedResultDescriptorFromJSON; function TypedResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'plot': - return Object.assign(Object.assign({}, (0, TypedPlotResultDescriptor_1.TypedPlotResultDescriptorFromJSONTyped)(json, true)), { type: 'plot' }); + return Object.assign({}, (0, TypedPlotResultDescriptor_1.TypedPlotResultDescriptorFromJSONTyped)(json, true), { type: 'plot' }); case 'raster': - return Object.assign(Object.assign({}, (0, TypedRasterResultDescriptor_1.TypedRasterResultDescriptorFromJSONTyped)(json, true)), { type: 'raster' }); + return Object.assign({}, (0, TypedRasterResultDescriptor_1.TypedRasterResultDescriptorFromJSONTyped)(json, true), { type: 'raster' }); case 'vector': - return Object.assign(Object.assign({}, (0, TypedVectorResultDescriptor_1.TypedVectorResultDescriptorFromJSONTyped)(json, true)), { type: 'vector' }); + return Object.assign({}, (0, TypedVectorResultDescriptor_1.TypedVectorResultDescriptorFromJSONTyped)(json, true), { type: 'vector' }); default: throw new Error(`No variant of TypedResultDescriptor exists with 'type=${json['type']}'`); } } -exports.TypedResultDescriptorFromJSONTyped = TypedResultDescriptorFromJSONTyped; -function TypedResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TypedResultDescriptorToJSON(json) { + return TypedResultDescriptorToJSONTyped(json, false); +} +function TypedResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } switch (value['type']) { case 'plot': - return (0, TypedPlotResultDescriptor_1.TypedPlotResultDescriptorToJSON)(value); + return Object.assign({}, (0, TypedPlotResultDescriptor_1.TypedPlotResultDescriptorToJSON)(value), { type: 'plot' }); case 'raster': - return (0, TypedRasterResultDescriptor_1.TypedRasterResultDescriptorToJSON)(value); + return Object.assign({}, (0, TypedRasterResultDescriptor_1.TypedRasterResultDescriptorToJSON)(value), { type: 'raster' }); case 'vector': - return (0, TypedVectorResultDescriptor_1.TypedVectorResultDescriptorToJSON)(value); + return Object.assign({}, (0, TypedVectorResultDescriptor_1.TypedVectorResultDescriptorToJSON)(value), { type: 'vector' }); default: throw new Error(`No variant of TypedResultDescriptor exists with 'type=${value['type']}'`); } } -exports.TypedResultDescriptorToJSON = TypedResultDescriptorToJSON; diff --git a/typescript/dist/models/TypedVectorResultDescriptor.d.ts b/typescript/dist/models/TypedVectorResultDescriptor.d.ts index ca993dac..a72f8495 100644 --- a/typescript/dist/models/TypedVectorResultDescriptor.d.ts +++ b/typescript/dist/models/TypedVectorResultDescriptor.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; +import type { VectorDataType } from './VectorDataType'; import type { TimeInterval } from './TimeInterval'; import type { VectorColumnInfo } from './VectorColumnInfo'; -import type { VectorDataType } from './VectorDataType'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * * @export @@ -68,7 +68,8 @@ export type TypedVectorResultDescriptorTypeEnum = typeof TypedVectorResultDescri /** * Check if a given object implements the TypedVectorResultDescriptor interface. */ -export declare function instanceOfTypedVectorResultDescriptor(value: object): boolean; +export declare function instanceOfTypedVectorResultDescriptor(value: object): value is TypedVectorResultDescriptor; export declare function TypedVectorResultDescriptorFromJSON(json: any): TypedVectorResultDescriptor; export declare function TypedVectorResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedVectorResultDescriptor; -export declare function TypedVectorResultDescriptorToJSON(value?: TypedVectorResultDescriptor | null): any; +export declare function TypedVectorResultDescriptorToJSON(json: any): TypedVectorResultDescriptor; +export declare function TypedVectorResultDescriptorToJSONTyped(value?: TypedVectorResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/TypedVectorResultDescriptor.js b/typescript/dist/models/TypedVectorResultDescriptor.js index 0e343c46..e63c3b6e 100644 --- a/typescript/dist/models/TypedVectorResultDescriptor.js +++ b/typescript/dist/models/TypedVectorResultDescriptor.js @@ -13,12 +13,17 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.TypedVectorResultDescriptorToJSON = exports.TypedVectorResultDescriptorFromJSONTyped = exports.TypedVectorResultDescriptorFromJSON = exports.instanceOfTypedVectorResultDescriptor = exports.TypedVectorResultDescriptorTypeEnum = void 0; +exports.TypedVectorResultDescriptorTypeEnum = void 0; +exports.instanceOfTypedVectorResultDescriptor = instanceOfTypedVectorResultDescriptor; +exports.TypedVectorResultDescriptorFromJSON = TypedVectorResultDescriptorFromJSON; +exports.TypedVectorResultDescriptorFromJSONTyped = TypedVectorResultDescriptorFromJSONTyped; +exports.TypedVectorResultDescriptorToJSON = TypedVectorResultDescriptorToJSON; +exports.TypedVectorResultDescriptorToJSONTyped = TypedVectorResultDescriptorToJSONTyped; const runtime_1 = require("../runtime"); -const BoundingBox2D_1 = require("./BoundingBox2D"); +const VectorDataType_1 = require("./VectorDataType"); const TimeInterval_1 = require("./TimeInterval"); const VectorColumnInfo_1 = require("./VectorColumnInfo"); -const VectorDataType_1 = require("./VectorDataType"); +const BoundingBox2D_1 = require("./BoundingBox2D"); /** * @export */ @@ -29,46 +34,45 @@ exports.TypedVectorResultDescriptorTypeEnum = { * Check if a given object implements the TypedVectorResultDescriptor interface. */ function instanceOfTypedVectorResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "columns" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('columns' in value) || value['columns'] === undefined) + return false; + if (!('dataType' in value) || value['dataType'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfTypedVectorResultDescriptor = instanceOfTypedVectorResultDescriptor; function TypedVectorResultDescriptorFromJSON(json) { return TypedVectorResultDescriptorFromJSONTyped(json, false); } -exports.TypedVectorResultDescriptorFromJSON = TypedVectorResultDescriptorFromJSON; function TypedVectorResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !(0, runtime_1.exists)(json, 'bbox') ? undefined : (0, BoundingBox2D_1.BoundingBox2DFromJSON)(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : (0, BoundingBox2D_1.BoundingBox2DFromJSON)(json['bbox']), 'columns': ((0, runtime_1.mapValues)(json['columns'], VectorColumnInfo_1.VectorColumnInfoFromJSON)), 'dataType': (0, VectorDataType_1.VectorDataTypeFromJSON)(json['dataType']), 'spatialReference': json['spatialReference'], - 'time': !(0, runtime_1.exists)(json, 'time') ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), + 'time': json['time'] == null ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), 'type': json['type'], }; } -exports.TypedVectorResultDescriptorFromJSONTyped = TypedVectorResultDescriptorFromJSONTyped; -function TypedVectorResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function TypedVectorResultDescriptorToJSON(json) { + return TypedVectorResultDescriptorToJSONTyped(json, false); +} +function TypedVectorResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bbox': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value.bbox), - 'columns': ((0, runtime_1.mapValues)(value.columns, VectorColumnInfo_1.VectorColumnInfoToJSON)), - 'dataType': (0, VectorDataType_1.VectorDataTypeToJSON)(value.dataType), - 'spatialReference': value.spatialReference, - 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value.time), - 'type': value.type, + 'bbox': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value['bbox']), + 'columns': ((0, runtime_1.mapValues)(value['columns'], VectorColumnInfo_1.VectorColumnInfoToJSON)), + 'dataType': (0, VectorDataType_1.VectorDataTypeToJSON)(value['dataType']), + 'spatialReference': value['spatialReference'], + 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value['time']), + 'type': value['type'], }; } -exports.TypedVectorResultDescriptorToJSON = TypedVectorResultDescriptorToJSON; diff --git a/typescript/dist/models/UnitlessMeasurement.d.ts b/typescript/dist/models/UnitlessMeasurement.d.ts index 47b244dc..1fcd56d4 100644 --- a/typescript/dist/models/UnitlessMeasurement.d.ts +++ b/typescript/dist/models/UnitlessMeasurement.d.ts @@ -27,14 +27,13 @@ export interface UnitlessMeasurement { */ export declare const UnitlessMeasurementTypeEnum: { readonly Unitless: "unitless"; - readonly Continuous: "continuous"; - readonly Classification: "classification"; }; export type UnitlessMeasurementTypeEnum = typeof UnitlessMeasurementTypeEnum[keyof typeof UnitlessMeasurementTypeEnum]; /** * Check if a given object implements the UnitlessMeasurement interface. */ -export declare function instanceOfUnitlessMeasurement(value: object): boolean; +export declare function instanceOfUnitlessMeasurement(value: object): value is UnitlessMeasurement; export declare function UnitlessMeasurementFromJSON(json: any): UnitlessMeasurement; export declare function UnitlessMeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnitlessMeasurement; -export declare function UnitlessMeasurementToJSON(value?: UnitlessMeasurement | null): any; +export declare function UnitlessMeasurementToJSON(json: any): UnitlessMeasurement; +export declare function UnitlessMeasurementToJSONTyped(value?: UnitlessMeasurement | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UnitlessMeasurement.js b/typescript/dist/models/UnitlessMeasurement.js index 966ae014..8136e9f6 100644 --- a/typescript/dist/models/UnitlessMeasurement.js +++ b/typescript/dist/models/UnitlessMeasurement.js @@ -13,46 +13,45 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UnitlessMeasurementToJSON = exports.UnitlessMeasurementFromJSONTyped = exports.UnitlessMeasurementFromJSON = exports.instanceOfUnitlessMeasurement = exports.UnitlessMeasurementTypeEnum = void 0; +exports.UnitlessMeasurementTypeEnum = void 0; +exports.instanceOfUnitlessMeasurement = instanceOfUnitlessMeasurement; +exports.UnitlessMeasurementFromJSON = UnitlessMeasurementFromJSON; +exports.UnitlessMeasurementFromJSONTyped = UnitlessMeasurementFromJSONTyped; +exports.UnitlessMeasurementToJSON = UnitlessMeasurementToJSON; +exports.UnitlessMeasurementToJSONTyped = UnitlessMeasurementToJSONTyped; /** * @export */ exports.UnitlessMeasurementTypeEnum = { - Unitless: 'unitless', - Continuous: 'continuous', - Classification: 'classification' + Unitless: 'unitless' }; /** * Check if a given object implements the UnitlessMeasurement interface. */ function instanceOfUnitlessMeasurement(value) { - let isInstance = true; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfUnitlessMeasurement = instanceOfUnitlessMeasurement; function UnitlessMeasurementFromJSON(json) { return UnitlessMeasurementFromJSONTyped(json, false); } -exports.UnitlessMeasurementFromJSON = UnitlessMeasurementFromJSON; function UnitlessMeasurementFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'type': json['type'], }; } -exports.UnitlessMeasurementFromJSONTyped = UnitlessMeasurementFromJSONTyped; -function UnitlessMeasurementToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UnitlessMeasurementToJSON(json) { + return UnitlessMeasurementToJSONTyped(json, false); +} +function UnitlessMeasurementToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'type': value.type, + 'type': value['type'], }; } -exports.UnitlessMeasurementToJSON = UnitlessMeasurementToJSON; diff --git a/typescript/dist/models/UnixTimeStampType.d.ts b/typescript/dist/models/UnixTimeStampType.d.ts index 60a36181..72201b6f 100644 --- a/typescript/dist/models/UnixTimeStampType.d.ts +++ b/typescript/dist/models/UnixTimeStampType.d.ts @@ -18,6 +18,8 @@ export declare const UnixTimeStampType: { readonly EpochMilliseconds: "epochMilliseconds"; }; export type UnixTimeStampType = typeof UnixTimeStampType[keyof typeof UnixTimeStampType]; +export declare function instanceOfUnixTimeStampType(value: any): boolean; export declare function UnixTimeStampTypeFromJSON(json: any): UnixTimeStampType; export declare function UnixTimeStampTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnixTimeStampType; export declare function UnixTimeStampTypeToJSON(value?: UnixTimeStampType | null): any; +export declare function UnixTimeStampTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): UnixTimeStampType; diff --git a/typescript/dist/models/UnixTimeStampType.js b/typescript/dist/models/UnixTimeStampType.js index da09977a..1e83626e 100644 --- a/typescript/dist/models/UnixTimeStampType.js +++ b/typescript/dist/models/UnixTimeStampType.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UnixTimeStampTypeToJSON = exports.UnixTimeStampTypeFromJSONTyped = exports.UnixTimeStampTypeFromJSON = exports.UnixTimeStampType = void 0; +exports.UnixTimeStampType = void 0; +exports.instanceOfUnixTimeStampType = instanceOfUnixTimeStampType; +exports.UnixTimeStampTypeFromJSON = UnixTimeStampTypeFromJSON; +exports.UnixTimeStampTypeFromJSONTyped = UnixTimeStampTypeFromJSONTyped; +exports.UnixTimeStampTypeToJSON = UnixTimeStampTypeToJSON; +exports.UnixTimeStampTypeToJSONTyped = UnixTimeStampTypeToJSONTyped; /** * * @export @@ -22,15 +27,25 @@ exports.UnixTimeStampType = { EpochSeconds: 'epochSeconds', EpochMilliseconds: 'epochMilliseconds' }; +function instanceOfUnixTimeStampType(value) { + for (const key in exports.UnixTimeStampType) { + if (Object.prototype.hasOwnProperty.call(exports.UnixTimeStampType, key)) { + if (exports.UnixTimeStampType[key] === value) { + return true; + } + } + } + return false; +} function UnixTimeStampTypeFromJSON(json) { return UnixTimeStampTypeFromJSONTyped(json, false); } -exports.UnixTimeStampTypeFromJSON = UnixTimeStampTypeFromJSON; function UnixTimeStampTypeFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.UnixTimeStampTypeFromJSONTyped = UnixTimeStampTypeFromJSONTyped; function UnixTimeStampTypeToJSON(value) { return value; } -exports.UnixTimeStampTypeToJSON = UnixTimeStampTypeToJSON; +function UnixTimeStampTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/UpdateDataset.d.ts b/typescript/dist/models/UpdateDataset.d.ts index 5b25bb01..4199c6dc 100644 --- a/typescript/dist/models/UpdateDataset.d.ts +++ b/typescript/dist/models/UpdateDataset.d.ts @@ -43,7 +43,8 @@ export interface UpdateDataset { /** * Check if a given object implements the UpdateDataset interface. */ -export declare function instanceOfUpdateDataset(value: object): boolean; +export declare function instanceOfUpdateDataset(value: object): value is UpdateDataset; export declare function UpdateDatasetFromJSON(json: any): UpdateDataset; export declare function UpdateDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateDataset; -export declare function UpdateDatasetToJSON(value?: UpdateDataset | null): any; +export declare function UpdateDatasetToJSON(json: any): UpdateDataset; +export declare function UpdateDatasetToJSONTyped(value?: UpdateDataset | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UpdateDataset.js b/typescript/dist/models/UpdateDataset.js index 04c04036..b9d67681 100644 --- a/typescript/dist/models/UpdateDataset.js +++ b/typescript/dist/models/UpdateDataset.js @@ -13,25 +13,30 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdateDatasetToJSON = exports.UpdateDatasetFromJSONTyped = exports.UpdateDatasetFromJSON = exports.instanceOfUpdateDataset = void 0; +exports.instanceOfUpdateDataset = instanceOfUpdateDataset; +exports.UpdateDatasetFromJSON = UpdateDatasetFromJSON; +exports.UpdateDatasetFromJSONTyped = UpdateDatasetFromJSONTyped; +exports.UpdateDatasetToJSON = UpdateDatasetToJSON; +exports.UpdateDatasetToJSONTyped = UpdateDatasetToJSONTyped; /** * Check if a given object implements the UpdateDataset interface. */ function instanceOfUpdateDataset(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "tags" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('displayName' in value) || value['displayName'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('tags' in value) || value['tags'] === undefined) + return false; + return true; } -exports.instanceOfUpdateDataset = instanceOfUpdateDataset; function UpdateDatasetFromJSON(json) { return UpdateDatasetFromJSONTyped(json, false); } -exports.UpdateDatasetFromJSON = UpdateDatasetFromJSON; function UpdateDatasetFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -41,19 +46,17 @@ function UpdateDatasetFromJSONTyped(json, ignoreDiscriminator) { 'tags': json['tags'], }; } -exports.UpdateDatasetFromJSONTyped = UpdateDatasetFromJSONTyped; -function UpdateDatasetToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UpdateDatasetToJSON(json) { + return UpdateDatasetToJSONTyped(json, false); +} +function UpdateDatasetToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'display_name': value.displayName, - 'name': value.name, - 'tags': value.tags, + 'description': value['description'], + 'display_name': value['displayName'], + 'name': value['name'], + 'tags': value['tags'], }; } -exports.UpdateDatasetToJSON = UpdateDatasetToJSON; diff --git a/typescript/dist/models/UpdateLayer.d.ts b/typescript/dist/models/UpdateLayer.d.ts index 6a59ada2..978b8f76 100644 --- a/typescript/dist/models/UpdateLayer.d.ts +++ b/typescript/dist/models/UpdateLayer.d.ts @@ -59,7 +59,8 @@ export interface UpdateLayer { /** * Check if a given object implements the UpdateLayer interface. */ -export declare function instanceOfUpdateLayer(value: object): boolean; +export declare function instanceOfUpdateLayer(value: object): value is UpdateLayer; export declare function UpdateLayerFromJSON(json: any): UpdateLayer; export declare function UpdateLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateLayer; -export declare function UpdateLayerToJSON(value?: UpdateLayer | null): any; +export declare function UpdateLayerToJSON(json: any): UpdateLayer; +export declare function UpdateLayerToJSONTyped(value?: UpdateLayer | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UpdateLayer.js b/typescript/dist/models/UpdateLayer.js index 9523e107..6591afb5 100644 --- a/typescript/dist/models/UpdateLayer.js +++ b/typescript/dist/models/UpdateLayer.js @@ -13,53 +13,54 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdateLayerToJSON = exports.UpdateLayerFromJSONTyped = exports.UpdateLayerFromJSON = exports.instanceOfUpdateLayer = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfUpdateLayer = instanceOfUpdateLayer; +exports.UpdateLayerFromJSON = UpdateLayerFromJSON; +exports.UpdateLayerFromJSONTyped = UpdateLayerFromJSONTyped; +exports.UpdateLayerToJSON = UpdateLayerToJSON; +exports.UpdateLayerToJSONTyped = UpdateLayerToJSONTyped; const Symbology_1 = require("./Symbology"); const Workflow_1 = require("./Workflow"); /** * Check if a given object implements the UpdateLayer interface. */ function instanceOfUpdateLayer(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + if (!('workflow' in value) || value['workflow'] === undefined) + return false; + return true; } -exports.instanceOfUpdateLayer = instanceOfUpdateLayer; function UpdateLayerFromJSON(json) { return UpdateLayerFromJSONTyped(json, false); } -exports.UpdateLayerFromJSON = UpdateLayerFromJSON; function UpdateLayerFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], - 'metadata': !(0, runtime_1.exists)(json, 'metadata') ? undefined : json['metadata'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], 'name': json['name'], - 'properties': !(0, runtime_1.exists)(json, 'properties') ? undefined : json['properties'], - 'symbology': !(0, runtime_1.exists)(json, 'symbology') ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), + 'properties': json['properties'] == null ? undefined : json['properties'], + 'symbology': json['symbology'] == null ? undefined : (0, Symbology_1.SymbologyFromJSON)(json['symbology']), 'workflow': (0, Workflow_1.WorkflowFromJSON)(json['workflow']), }; } -exports.UpdateLayerFromJSONTyped = UpdateLayerFromJSONTyped; -function UpdateLayerToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UpdateLayerToJSON(json) { + return UpdateLayerToJSONTyped(json, false); +} +function UpdateLayerToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'metadata': value.metadata, - 'name': value.name, - 'properties': value.properties, - 'symbology': (0, Symbology_1.SymbologyToJSON)(value.symbology), - 'workflow': (0, Workflow_1.WorkflowToJSON)(value.workflow), + 'description': value['description'], + 'metadata': value['metadata'], + 'name': value['name'], + 'properties': value['properties'], + 'symbology': (0, Symbology_1.SymbologyToJSON)(value['symbology']), + 'workflow': (0, Workflow_1.WorkflowToJSON)(value['workflow']), }; } -exports.UpdateLayerToJSON = UpdateLayerToJSON; diff --git a/typescript/dist/models/UpdateLayerCollection.d.ts b/typescript/dist/models/UpdateLayerCollection.d.ts index 7af58d48..7ffcc3b2 100644 --- a/typescript/dist/models/UpdateLayerCollection.d.ts +++ b/typescript/dist/models/UpdateLayerCollection.d.ts @@ -37,7 +37,8 @@ export interface UpdateLayerCollection { /** * Check if a given object implements the UpdateLayerCollection interface. */ -export declare function instanceOfUpdateLayerCollection(value: object): boolean; +export declare function instanceOfUpdateLayerCollection(value: object): value is UpdateLayerCollection; export declare function UpdateLayerCollectionFromJSON(json: any): UpdateLayerCollection; export declare function UpdateLayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateLayerCollection; -export declare function UpdateLayerCollectionToJSON(value?: UpdateLayerCollection | null): any; +export declare function UpdateLayerCollectionToJSON(json: any): UpdateLayerCollection; +export declare function UpdateLayerCollectionToJSONTyped(value?: UpdateLayerCollection | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UpdateLayerCollection.js b/typescript/dist/models/UpdateLayerCollection.js index 871cd079..cc35edee 100644 --- a/typescript/dist/models/UpdateLayerCollection.js +++ b/typescript/dist/models/UpdateLayerCollection.js @@ -13,44 +13,44 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdateLayerCollectionToJSON = exports.UpdateLayerCollectionFromJSONTyped = exports.UpdateLayerCollectionFromJSON = exports.instanceOfUpdateLayerCollection = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfUpdateLayerCollection = instanceOfUpdateLayerCollection; +exports.UpdateLayerCollectionFromJSON = UpdateLayerCollectionFromJSON; +exports.UpdateLayerCollectionFromJSONTyped = UpdateLayerCollectionFromJSONTyped; +exports.UpdateLayerCollectionToJSON = UpdateLayerCollectionToJSON; +exports.UpdateLayerCollectionToJSONTyped = UpdateLayerCollectionToJSONTyped; /** * Check if a given object implements the UpdateLayerCollection interface. */ function instanceOfUpdateLayerCollection(value) { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('description' in value) || value['description'] === undefined) + return false; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } -exports.instanceOfUpdateLayerCollection = instanceOfUpdateLayerCollection; function UpdateLayerCollectionFromJSON(json) { return UpdateLayerCollectionFromJSONTyped(json, false); } -exports.UpdateLayerCollectionFromJSON = UpdateLayerCollectionFromJSON; function UpdateLayerCollectionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'name': json['name'], - 'properties': !(0, runtime_1.exists)(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], }; } -exports.UpdateLayerCollectionFromJSONTyped = UpdateLayerCollectionFromJSONTyped; -function UpdateLayerCollectionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UpdateLayerCollectionToJSON(json) { + return UpdateLayerCollectionToJSONTyped(json, false); +} +function UpdateLayerCollectionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'description': value.description, - 'name': value.name, - 'properties': value.properties, + 'description': value['description'], + 'name': value['name'], + 'properties': value['properties'], }; } -exports.UpdateLayerCollectionToJSON = UpdateLayerCollectionToJSON; diff --git a/typescript/dist/models/UpdateProject.d.ts b/typescript/dist/models/UpdateProject.d.ts index 011b258b..53a9a8c8 100644 --- a/typescript/dist/models/UpdateProject.d.ts +++ b/typescript/dist/models/UpdateProject.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { LayerUpdate } from './LayerUpdate'; +import type { TimeStep } from './TimeStep'; import type { PlotUpdate } from './PlotUpdate'; import type { STRectangle } from './STRectangle'; -import type { TimeStep } from './TimeStep'; +import type { LayerUpdate } from './LayerUpdate'; /** * * @export @@ -65,7 +65,8 @@ export interface UpdateProject { /** * Check if a given object implements the UpdateProject interface. */ -export declare function instanceOfUpdateProject(value: object): boolean; +export declare function instanceOfUpdateProject(value: object): value is UpdateProject; export declare function UpdateProjectFromJSON(json: any): UpdateProject; export declare function UpdateProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateProject; -export declare function UpdateProjectToJSON(value?: UpdateProject | null): any; +export declare function UpdateProjectToJSON(json: any): UpdateProject; +export declare function UpdateProjectToJSONTyped(value?: UpdateProject | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UpdateProject.js b/typescript/dist/models/UpdateProject.js index 41e255ca..63a0f8c8 100644 --- a/typescript/dist/models/UpdateProject.js +++ b/typescript/dist/models/UpdateProject.js @@ -13,55 +13,54 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdateProjectToJSON = exports.UpdateProjectFromJSONTyped = exports.UpdateProjectFromJSON = exports.instanceOfUpdateProject = void 0; -const runtime_1 = require("../runtime"); -const LayerUpdate_1 = require("./LayerUpdate"); +exports.instanceOfUpdateProject = instanceOfUpdateProject; +exports.UpdateProjectFromJSON = UpdateProjectFromJSON; +exports.UpdateProjectFromJSONTyped = UpdateProjectFromJSONTyped; +exports.UpdateProjectToJSON = UpdateProjectToJSON; +exports.UpdateProjectToJSONTyped = UpdateProjectToJSONTyped; +const TimeStep_1 = require("./TimeStep"); const PlotUpdate_1 = require("./PlotUpdate"); const STRectangle_1 = require("./STRectangle"); -const TimeStep_1 = require("./TimeStep"); +const LayerUpdate_1 = require("./LayerUpdate"); /** * Check if a given object implements the UpdateProject interface. */ function instanceOfUpdateProject(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + return true; } -exports.instanceOfUpdateProject = instanceOfUpdateProject; function UpdateProjectFromJSON(json) { return UpdateProjectFromJSONTyped(json, false); } -exports.UpdateProjectFromJSON = UpdateProjectFromJSON; function UpdateProjectFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bounds': !(0, runtime_1.exists)(json, 'bounds') ? undefined : (0, STRectangle_1.STRectangleFromJSON)(json['bounds']), - 'description': !(0, runtime_1.exists)(json, 'description') ? undefined : json['description'], + 'bounds': json['bounds'] == null ? undefined : (0, STRectangle_1.STRectangleFromJSON)(json['bounds']), + 'description': json['description'] == null ? undefined : json['description'], 'id': json['id'], - 'layers': !(0, runtime_1.exists)(json, 'layers') ? undefined : (json['layers'] === null ? null : json['layers'].map(LayerUpdate_1.LayerUpdateFromJSON)), - 'name': !(0, runtime_1.exists)(json, 'name') ? undefined : json['name'], - 'plots': !(0, runtime_1.exists)(json, 'plots') ? undefined : (json['plots'] === null ? null : json['plots'].map(PlotUpdate_1.PlotUpdateFromJSON)), - 'timeStep': !(0, runtime_1.exists)(json, 'timeStep') ? undefined : (0, TimeStep_1.TimeStepFromJSON)(json['timeStep']), + 'layers': json['layers'] == null ? undefined : (json['layers'].map(LayerUpdate_1.LayerUpdateFromJSON)), + 'name': json['name'] == null ? undefined : json['name'], + 'plots': json['plots'] == null ? undefined : (json['plots'].map(PlotUpdate_1.PlotUpdateFromJSON)), + 'timeStep': json['timeStep'] == null ? undefined : (0, TimeStep_1.TimeStepFromJSON)(json['timeStep']), }; } -exports.UpdateProjectFromJSONTyped = UpdateProjectFromJSONTyped; -function UpdateProjectToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UpdateProjectToJSON(json) { + return UpdateProjectToJSONTyped(json, false); +} +function UpdateProjectToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bounds': (0, STRectangle_1.STRectangleToJSON)(value.bounds), - 'description': value.description, - 'id': value.id, - 'layers': value.layers === undefined ? undefined : (value.layers === null ? null : value.layers.map(LayerUpdate_1.LayerUpdateToJSON)), - 'name': value.name, - 'plots': value.plots === undefined ? undefined : (value.plots === null ? null : value.plots.map(PlotUpdate_1.PlotUpdateToJSON)), - 'timeStep': (0, TimeStep_1.TimeStepToJSON)(value.timeStep), + 'bounds': (0, STRectangle_1.STRectangleToJSON)(value['bounds']), + 'description': value['description'], + 'id': value['id'], + 'layers': value['layers'] == null ? undefined : (value['layers'].map(LayerUpdate_1.LayerUpdateToJSON)), + 'name': value['name'], + 'plots': value['plots'] == null ? undefined : (value['plots'].map(PlotUpdate_1.PlotUpdateToJSON)), + 'timeStep': (0, TimeStep_1.TimeStepToJSON)(value['timeStep']), }; } -exports.UpdateProjectToJSON = UpdateProjectToJSON; diff --git a/typescript/dist/models/UpdateQuota.d.ts b/typescript/dist/models/UpdateQuota.d.ts index fa6a8c7a..070b6ebd 100644 --- a/typescript/dist/models/UpdateQuota.d.ts +++ b/typescript/dist/models/UpdateQuota.d.ts @@ -25,7 +25,8 @@ export interface UpdateQuota { /** * Check if a given object implements the UpdateQuota interface. */ -export declare function instanceOfUpdateQuota(value: object): boolean; +export declare function instanceOfUpdateQuota(value: object): value is UpdateQuota; export declare function UpdateQuotaFromJSON(json: any): UpdateQuota; export declare function UpdateQuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateQuota; -export declare function UpdateQuotaToJSON(value?: UpdateQuota | null): any; +export declare function UpdateQuotaToJSON(json: any): UpdateQuota; +export declare function UpdateQuotaToJSONTyped(value?: UpdateQuota | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UpdateQuota.js b/typescript/dist/models/UpdateQuota.js index a4cca011..d658c6c4 100644 --- a/typescript/dist/models/UpdateQuota.js +++ b/typescript/dist/models/UpdateQuota.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdateQuotaToJSON = exports.UpdateQuotaFromJSONTyped = exports.UpdateQuotaFromJSON = exports.instanceOfUpdateQuota = void 0; +exports.instanceOfUpdateQuota = instanceOfUpdateQuota; +exports.UpdateQuotaFromJSON = UpdateQuotaFromJSON; +exports.UpdateQuotaFromJSONTyped = UpdateQuotaFromJSONTyped; +exports.UpdateQuotaToJSON = UpdateQuotaToJSON; +exports.UpdateQuotaToJSONTyped = UpdateQuotaToJSONTyped; /** * Check if a given object implements the UpdateQuota interface. */ function instanceOfUpdateQuota(value) { - let isInstance = true; - isInstance = isInstance && "available" in value; - return isInstance; + if (!('available' in value) || value['available'] === undefined) + return false; + return true; } -exports.instanceOfUpdateQuota = instanceOfUpdateQuota; function UpdateQuotaFromJSON(json) { return UpdateQuotaFromJSONTyped(json, false); } -exports.UpdateQuotaFromJSON = UpdateQuotaFromJSON; function UpdateQuotaFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'available': json['available'], }; } -exports.UpdateQuotaFromJSONTyped = UpdateQuotaFromJSONTyped; -function UpdateQuotaToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UpdateQuotaToJSON(json) { + return UpdateQuotaToJSONTyped(json, false); +} +function UpdateQuotaToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'available': value.available, + 'available': value['available'], }; } -exports.UpdateQuotaToJSON = UpdateQuotaToJSON; diff --git a/typescript/dist/models/UploadFileLayersResponse.d.ts b/typescript/dist/models/UploadFileLayersResponse.d.ts index d0f22470..5e860b7b 100644 --- a/typescript/dist/models/UploadFileLayersResponse.d.ts +++ b/typescript/dist/models/UploadFileLayersResponse.d.ts @@ -25,7 +25,8 @@ export interface UploadFileLayersResponse { /** * Check if a given object implements the UploadFileLayersResponse interface. */ -export declare function instanceOfUploadFileLayersResponse(value: object): boolean; +export declare function instanceOfUploadFileLayersResponse(value: object): value is UploadFileLayersResponse; export declare function UploadFileLayersResponseFromJSON(json: any): UploadFileLayersResponse; export declare function UploadFileLayersResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UploadFileLayersResponse; -export declare function UploadFileLayersResponseToJSON(value?: UploadFileLayersResponse | null): any; +export declare function UploadFileLayersResponseToJSON(json: any): UploadFileLayersResponse; +export declare function UploadFileLayersResponseToJSONTyped(value?: UploadFileLayersResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UploadFileLayersResponse.js b/typescript/dist/models/UploadFileLayersResponse.js index 52c41f12..541ac6dc 100644 --- a/typescript/dist/models/UploadFileLayersResponse.js +++ b/typescript/dist/models/UploadFileLayersResponse.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UploadFileLayersResponseToJSON = exports.UploadFileLayersResponseFromJSONTyped = exports.UploadFileLayersResponseFromJSON = exports.instanceOfUploadFileLayersResponse = void 0; +exports.instanceOfUploadFileLayersResponse = instanceOfUploadFileLayersResponse; +exports.UploadFileLayersResponseFromJSON = UploadFileLayersResponseFromJSON; +exports.UploadFileLayersResponseFromJSONTyped = UploadFileLayersResponseFromJSONTyped; +exports.UploadFileLayersResponseToJSON = UploadFileLayersResponseToJSON; +exports.UploadFileLayersResponseToJSONTyped = UploadFileLayersResponseToJSONTyped; /** * Check if a given object implements the UploadFileLayersResponse interface. */ function instanceOfUploadFileLayersResponse(value) { - let isInstance = true; - isInstance = isInstance && "layers" in value; - return isInstance; + if (!('layers' in value) || value['layers'] === undefined) + return false; + return true; } -exports.instanceOfUploadFileLayersResponse = instanceOfUploadFileLayersResponse; function UploadFileLayersResponseFromJSON(json) { return UploadFileLayersResponseFromJSONTyped(json, false); } -exports.UploadFileLayersResponseFromJSON = UploadFileLayersResponseFromJSON; function UploadFileLayersResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'layers': json['layers'], }; } -exports.UploadFileLayersResponseFromJSONTyped = UploadFileLayersResponseFromJSONTyped; -function UploadFileLayersResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UploadFileLayersResponseToJSON(json) { + return UploadFileLayersResponseToJSONTyped(json, false); +} +function UploadFileLayersResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'layers': value.layers, + 'layers': value['layers'], }; } -exports.UploadFileLayersResponseToJSON = UploadFileLayersResponseToJSON; diff --git a/typescript/dist/models/UploadFilesResponse.d.ts b/typescript/dist/models/UploadFilesResponse.d.ts index 73676cfc..a3936387 100644 --- a/typescript/dist/models/UploadFilesResponse.d.ts +++ b/typescript/dist/models/UploadFilesResponse.d.ts @@ -25,7 +25,8 @@ export interface UploadFilesResponse { /** * Check if a given object implements the UploadFilesResponse interface. */ -export declare function instanceOfUploadFilesResponse(value: object): boolean; +export declare function instanceOfUploadFilesResponse(value: object): value is UploadFilesResponse; export declare function UploadFilesResponseFromJSON(json: any): UploadFilesResponse; export declare function UploadFilesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UploadFilesResponse; -export declare function UploadFilesResponseToJSON(value?: UploadFilesResponse | null): any; +export declare function UploadFilesResponseToJSON(json: any): UploadFilesResponse; +export declare function UploadFilesResponseToJSONTyped(value?: UploadFilesResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UploadFilesResponse.js b/typescript/dist/models/UploadFilesResponse.js index 7ed4bd3c..0356ac63 100644 --- a/typescript/dist/models/UploadFilesResponse.js +++ b/typescript/dist/models/UploadFilesResponse.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UploadFilesResponseToJSON = exports.UploadFilesResponseFromJSONTyped = exports.UploadFilesResponseFromJSON = exports.instanceOfUploadFilesResponse = void 0; +exports.instanceOfUploadFilesResponse = instanceOfUploadFilesResponse; +exports.UploadFilesResponseFromJSON = UploadFilesResponseFromJSON; +exports.UploadFilesResponseFromJSONTyped = UploadFilesResponseFromJSONTyped; +exports.UploadFilesResponseToJSON = UploadFilesResponseToJSON; +exports.UploadFilesResponseToJSONTyped = UploadFilesResponseToJSONTyped; /** * Check if a given object implements the UploadFilesResponse interface. */ function instanceOfUploadFilesResponse(value) { - let isInstance = true; - isInstance = isInstance && "files" in value; - return isInstance; + if (!('files' in value) || value['files'] === undefined) + return false; + return true; } -exports.instanceOfUploadFilesResponse = instanceOfUploadFilesResponse; function UploadFilesResponseFromJSON(json) { return UploadFilesResponseFromJSONTyped(json, false); } -exports.UploadFilesResponseFromJSON = UploadFilesResponseFromJSON; function UploadFilesResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'files': json['files'], }; } -exports.UploadFilesResponseFromJSONTyped = UploadFilesResponseFromJSONTyped; -function UploadFilesResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UploadFilesResponseToJSON(json) { + return UploadFilesResponseToJSONTyped(json, false); +} +function UploadFilesResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'files': value.files, + 'files': value['files'], }; } -exports.UploadFilesResponseToJSON = UploadFilesResponseToJSON; diff --git a/typescript/dist/models/UsageSummaryGranularity.d.ts b/typescript/dist/models/UsageSummaryGranularity.d.ts index ff762ef8..654be8db 100644 --- a/typescript/dist/models/UsageSummaryGranularity.d.ts +++ b/typescript/dist/models/UsageSummaryGranularity.d.ts @@ -21,6 +21,8 @@ export declare const UsageSummaryGranularity: { readonly Years: "years"; }; export type UsageSummaryGranularity = typeof UsageSummaryGranularity[keyof typeof UsageSummaryGranularity]; +export declare function instanceOfUsageSummaryGranularity(value: any): boolean; export declare function UsageSummaryGranularityFromJSON(json: any): UsageSummaryGranularity; export declare function UsageSummaryGranularityFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsageSummaryGranularity; export declare function UsageSummaryGranularityToJSON(value?: UsageSummaryGranularity | null): any; +export declare function UsageSummaryGranularityToJSONTyped(value: any, ignoreDiscriminator: boolean): UsageSummaryGranularity; diff --git a/typescript/dist/models/UsageSummaryGranularity.js b/typescript/dist/models/UsageSummaryGranularity.js index 3230a92e..769c5bba 100644 --- a/typescript/dist/models/UsageSummaryGranularity.js +++ b/typescript/dist/models/UsageSummaryGranularity.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UsageSummaryGranularityToJSON = exports.UsageSummaryGranularityFromJSONTyped = exports.UsageSummaryGranularityFromJSON = exports.UsageSummaryGranularity = void 0; +exports.UsageSummaryGranularity = void 0; +exports.instanceOfUsageSummaryGranularity = instanceOfUsageSummaryGranularity; +exports.UsageSummaryGranularityFromJSON = UsageSummaryGranularityFromJSON; +exports.UsageSummaryGranularityFromJSONTyped = UsageSummaryGranularityFromJSONTyped; +exports.UsageSummaryGranularityToJSON = UsageSummaryGranularityToJSON; +exports.UsageSummaryGranularityToJSONTyped = UsageSummaryGranularityToJSONTyped; /** * * @export @@ -25,15 +30,25 @@ exports.UsageSummaryGranularity = { Months: 'months', Years: 'years' }; +function instanceOfUsageSummaryGranularity(value) { + for (const key in exports.UsageSummaryGranularity) { + if (Object.prototype.hasOwnProperty.call(exports.UsageSummaryGranularity, key)) { + if (exports.UsageSummaryGranularity[key] === value) { + return true; + } + } + } + return false; +} function UsageSummaryGranularityFromJSON(json) { return UsageSummaryGranularityFromJSONTyped(json, false); } -exports.UsageSummaryGranularityFromJSON = UsageSummaryGranularityFromJSON; function UsageSummaryGranularityFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.UsageSummaryGranularityFromJSONTyped = UsageSummaryGranularityFromJSONTyped; function UsageSummaryGranularityToJSON(value) { return value; } -exports.UsageSummaryGranularityToJSON = UsageSummaryGranularityToJSON; +function UsageSummaryGranularityToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/UserCredentials.d.ts b/typescript/dist/models/UserCredentials.d.ts index f1f68f1b..9ba16621 100644 --- a/typescript/dist/models/UserCredentials.d.ts +++ b/typescript/dist/models/UserCredentials.d.ts @@ -31,7 +31,8 @@ export interface UserCredentials { /** * Check if a given object implements the UserCredentials interface. */ -export declare function instanceOfUserCredentials(value: object): boolean; +export declare function instanceOfUserCredentials(value: object): value is UserCredentials; export declare function UserCredentialsFromJSON(json: any): UserCredentials; export declare function UserCredentialsFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserCredentials; -export declare function UserCredentialsToJSON(value?: UserCredentials | null): any; +export declare function UserCredentialsToJSON(json: any): UserCredentials; +export declare function UserCredentialsToJSONTyped(value?: UserCredentials | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UserCredentials.js b/typescript/dist/models/UserCredentials.js index fcb01d3f..6a7a4ffd 100644 --- a/typescript/dist/models/UserCredentials.js +++ b/typescript/dist/models/UserCredentials.js @@ -13,23 +13,26 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UserCredentialsToJSON = exports.UserCredentialsFromJSONTyped = exports.UserCredentialsFromJSON = exports.instanceOfUserCredentials = void 0; +exports.instanceOfUserCredentials = instanceOfUserCredentials; +exports.UserCredentialsFromJSON = UserCredentialsFromJSON; +exports.UserCredentialsFromJSONTyped = UserCredentialsFromJSONTyped; +exports.UserCredentialsToJSON = UserCredentialsToJSON; +exports.UserCredentialsToJSONTyped = UserCredentialsToJSONTyped; /** * Check if a given object implements the UserCredentials interface. */ function instanceOfUserCredentials(value) { - let isInstance = true; - isInstance = isInstance && "email" in value; - isInstance = isInstance && "password" in value; - return isInstance; + if (!('email' in value) || value['email'] === undefined) + return false; + if (!('password' in value) || value['password'] === undefined) + return false; + return true; } -exports.instanceOfUserCredentials = instanceOfUserCredentials; function UserCredentialsFromJSON(json) { return UserCredentialsFromJSONTyped(json, false); } -exports.UserCredentialsFromJSON = UserCredentialsFromJSON; function UserCredentialsFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -37,17 +40,15 @@ function UserCredentialsFromJSONTyped(json, ignoreDiscriminator) { 'password': json['password'], }; } -exports.UserCredentialsFromJSONTyped = UserCredentialsFromJSONTyped; -function UserCredentialsToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UserCredentialsToJSON(json) { + return UserCredentialsToJSONTyped(json, false); +} +function UserCredentialsToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'email': value.email, - 'password': value.password, + 'email': value['email'], + 'password': value['password'], }; } -exports.UserCredentialsToJSON = UserCredentialsToJSON; diff --git a/typescript/dist/models/UserInfo.d.ts b/typescript/dist/models/UserInfo.d.ts index 3df6b91f..3e23772e 100644 --- a/typescript/dist/models/UserInfo.d.ts +++ b/typescript/dist/models/UserInfo.d.ts @@ -37,7 +37,8 @@ export interface UserInfo { /** * Check if a given object implements the UserInfo interface. */ -export declare function instanceOfUserInfo(value: object): boolean; +export declare function instanceOfUserInfo(value: object): value is UserInfo; export declare function UserInfoFromJSON(json: any): UserInfo; export declare function UserInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserInfo; -export declare function UserInfoToJSON(value?: UserInfo | null): any; +export declare function UserInfoToJSON(json: any): UserInfo; +export declare function UserInfoToJSONTyped(value?: UserInfo | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UserInfo.js b/typescript/dist/models/UserInfo.js index fcbba95a..e9821e4f 100644 --- a/typescript/dist/models/UserInfo.js +++ b/typescript/dist/models/UserInfo.js @@ -13,43 +13,42 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UserInfoToJSON = exports.UserInfoFromJSONTyped = exports.UserInfoFromJSON = exports.instanceOfUserInfo = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfUserInfo = instanceOfUserInfo; +exports.UserInfoFromJSON = UserInfoFromJSON; +exports.UserInfoFromJSONTyped = UserInfoFromJSONTyped; +exports.UserInfoToJSON = UserInfoToJSON; +exports.UserInfoToJSONTyped = UserInfoToJSONTyped; /** * Check if a given object implements the UserInfo interface. */ function instanceOfUserInfo(value) { - let isInstance = true; - isInstance = isInstance && "id" in value; - return isInstance; + if (!('id' in value) || value['id'] === undefined) + return false; + return true; } -exports.instanceOfUserInfo = instanceOfUserInfo; function UserInfoFromJSON(json) { return UserInfoFromJSONTyped(json, false); } -exports.UserInfoFromJSON = UserInfoFromJSON; function UserInfoFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'email': !(0, runtime_1.exists)(json, 'email') ? undefined : json['email'], + 'email': json['email'] == null ? undefined : json['email'], 'id': json['id'], - 'realName': !(0, runtime_1.exists)(json, 'realName') ? undefined : json['realName'], + 'realName': json['realName'] == null ? undefined : json['realName'], }; } -exports.UserInfoFromJSONTyped = UserInfoFromJSONTyped; -function UserInfoToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UserInfoToJSON(json) { + return UserInfoToJSONTyped(json, false); +} +function UserInfoToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'email': value.email, - 'id': value.id, - 'realName': value.realName, + 'email': value['email'], + 'id': value['id'], + 'realName': value['realName'], }; } -exports.UserInfoToJSON = UserInfoToJSON; diff --git a/typescript/dist/models/UserRegistration.d.ts b/typescript/dist/models/UserRegistration.d.ts index 895ff879..08f44f8e 100644 --- a/typescript/dist/models/UserRegistration.d.ts +++ b/typescript/dist/models/UserRegistration.d.ts @@ -37,7 +37,8 @@ export interface UserRegistration { /** * Check if a given object implements the UserRegistration interface. */ -export declare function instanceOfUserRegistration(value: object): boolean; +export declare function instanceOfUserRegistration(value: object): value is UserRegistration; export declare function UserRegistrationFromJSON(json: any): UserRegistration; export declare function UserRegistrationFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserRegistration; -export declare function UserRegistrationToJSON(value?: UserRegistration | null): any; +export declare function UserRegistrationToJSON(json: any): UserRegistration; +export declare function UserRegistrationToJSONTyped(value?: UserRegistration | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UserRegistration.js b/typescript/dist/models/UserRegistration.js index e5f8ff6b..6a4da676 100644 --- a/typescript/dist/models/UserRegistration.js +++ b/typescript/dist/models/UserRegistration.js @@ -13,24 +13,28 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UserRegistrationToJSON = exports.UserRegistrationFromJSONTyped = exports.UserRegistrationFromJSON = exports.instanceOfUserRegistration = void 0; +exports.instanceOfUserRegistration = instanceOfUserRegistration; +exports.UserRegistrationFromJSON = UserRegistrationFromJSON; +exports.UserRegistrationFromJSONTyped = UserRegistrationFromJSONTyped; +exports.UserRegistrationToJSON = UserRegistrationToJSON; +exports.UserRegistrationToJSONTyped = UserRegistrationToJSONTyped; /** * Check if a given object implements the UserRegistration interface. */ function instanceOfUserRegistration(value) { - let isInstance = true; - isInstance = isInstance && "email" in value; - isInstance = isInstance && "password" in value; - isInstance = isInstance && "realName" in value; - return isInstance; + if (!('email' in value) || value['email'] === undefined) + return false; + if (!('password' in value) || value['password'] === undefined) + return false; + if (!('realName' in value) || value['realName'] === undefined) + return false; + return true; } -exports.instanceOfUserRegistration = instanceOfUserRegistration; function UserRegistrationFromJSON(json) { return UserRegistrationFromJSONTyped(json, false); } -exports.UserRegistrationFromJSON = UserRegistrationFromJSON; function UserRegistrationFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,18 +43,16 @@ function UserRegistrationFromJSONTyped(json, ignoreDiscriminator) { 'realName': json['realName'], }; } -exports.UserRegistrationFromJSONTyped = UserRegistrationFromJSONTyped; -function UserRegistrationToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UserRegistrationToJSON(json) { + return UserRegistrationToJSONTyped(json, false); +} +function UserRegistrationToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'email': value.email, - 'password': value.password, - 'realName': value.realName, + 'email': value['email'], + 'password': value['password'], + 'realName': value['realName'], }; } -exports.UserRegistrationToJSON = UserRegistrationToJSON; diff --git a/typescript/dist/models/UserSession.d.ts b/typescript/dist/models/UserSession.d.ts index f24076af..17e32e54 100644 --- a/typescript/dist/models/UserSession.d.ts +++ b/typescript/dist/models/UserSession.d.ts @@ -63,7 +63,8 @@ export interface UserSession { /** * Check if a given object implements the UserSession interface. */ -export declare function instanceOfUserSession(value: object): boolean; +export declare function instanceOfUserSession(value: object): value is UserSession; export declare function UserSessionFromJSON(json: any): UserSession; export declare function UserSessionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserSession; -export declare function UserSessionToJSON(value?: UserSession | null): any; +export declare function UserSessionToJSON(json: any): UserSession; +export declare function UserSessionToJSONTyped(value?: UserSession | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/UserSession.js b/typescript/dist/models/UserSession.js index 82398831..3c1ce613 100644 --- a/typescript/dist/models/UserSession.js +++ b/typescript/dist/models/UserSession.js @@ -13,57 +13,60 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UserSessionToJSON = exports.UserSessionFromJSONTyped = exports.UserSessionFromJSON = exports.instanceOfUserSession = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfUserSession = instanceOfUserSession; +exports.UserSessionFromJSON = UserSessionFromJSON; +exports.UserSessionFromJSONTyped = UserSessionFromJSONTyped; +exports.UserSessionToJSON = UserSessionToJSON; +exports.UserSessionToJSONTyped = UserSessionToJSONTyped; const STRectangle_1 = require("./STRectangle"); const UserInfo_1 = require("./UserInfo"); /** * Check if a given object implements the UserSession interface. */ function instanceOfUserSession(value) { - let isInstance = true; - isInstance = isInstance && "created" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "roles" in value; - isInstance = isInstance && "user" in value; - isInstance = isInstance && "validUntil" in value; - return isInstance; + if (!('created' in value) || value['created'] === undefined) + return false; + if (!('id' in value) || value['id'] === undefined) + return false; + if (!('roles' in value) || value['roles'] === undefined) + return false; + if (!('user' in value) || value['user'] === undefined) + return false; + if (!('validUntil' in value) || value['validUntil'] === undefined) + return false; + return true; } -exports.instanceOfUserSession = instanceOfUserSession; function UserSessionFromJSON(json) { return UserSessionFromJSONTyped(json, false); } -exports.UserSessionFromJSON = UserSessionFromJSON; function UserSessionFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'created': (new Date(json['created'])), 'id': json['id'], - 'project': !(0, runtime_1.exists)(json, 'project') ? undefined : json['project'], + 'project': json['project'] == null ? undefined : json['project'], 'roles': json['roles'], 'user': (0, UserInfo_1.UserInfoFromJSON)(json['user']), 'validUntil': (new Date(json['validUntil'])), - 'view': !(0, runtime_1.exists)(json, 'view') ? undefined : (0, STRectangle_1.STRectangleFromJSON)(json['view']), + 'view': json['view'] == null ? undefined : (0, STRectangle_1.STRectangleFromJSON)(json['view']), }; } -exports.UserSessionFromJSONTyped = UserSessionFromJSONTyped; -function UserSessionToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function UserSessionToJSON(json) { + return UserSessionToJSONTyped(json, false); +} +function UserSessionToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'created': (value.created.toISOString()), - 'id': value.id, - 'project': value.project, - 'roles': value.roles, - 'user': (0, UserInfo_1.UserInfoToJSON)(value.user), - 'validUntil': (value.validUntil.toISOString()), - 'view': (0, STRectangle_1.STRectangleToJSON)(value.view), + 'created': ((value['created']).toISOString()), + 'id': value['id'], + 'project': value['project'], + 'roles': value['roles'], + 'user': (0, UserInfo_1.UserInfoToJSON)(value['user']), + 'validUntil': ((value['validUntil']).toISOString()), + 'view': (0, STRectangle_1.STRectangleToJSON)(value['view']), }; } -exports.UserSessionToJSON = UserSessionToJSON; diff --git a/typescript/dist/models/VectorColumnInfo.d.ts b/typescript/dist/models/VectorColumnInfo.d.ts index 4a7538d5..02ab0892 100644 --- a/typescript/dist/models/VectorColumnInfo.d.ts +++ b/typescript/dist/models/VectorColumnInfo.d.ts @@ -9,8 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { FeatureDataType } from './FeatureDataType'; import type { Measurement } from './Measurement'; +import type { FeatureDataType } from './FeatureDataType'; /** * * @export @@ -33,7 +33,8 @@ export interface VectorColumnInfo { /** * Check if a given object implements the VectorColumnInfo interface. */ -export declare function instanceOfVectorColumnInfo(value: object): boolean; +export declare function instanceOfVectorColumnInfo(value: object): value is VectorColumnInfo; export declare function VectorColumnInfoFromJSON(json: any): VectorColumnInfo; export declare function VectorColumnInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): VectorColumnInfo; -export declare function VectorColumnInfoToJSON(value?: VectorColumnInfo | null): any; +export declare function VectorColumnInfoToJSON(json: any): VectorColumnInfo; +export declare function VectorColumnInfoToJSONTyped(value?: VectorColumnInfo | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/VectorColumnInfo.js b/typescript/dist/models/VectorColumnInfo.js index 14f9e225..46ae3d35 100644 --- a/typescript/dist/models/VectorColumnInfo.js +++ b/typescript/dist/models/VectorColumnInfo.js @@ -13,25 +13,28 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.VectorColumnInfoToJSON = exports.VectorColumnInfoFromJSONTyped = exports.VectorColumnInfoFromJSON = exports.instanceOfVectorColumnInfo = void 0; -const FeatureDataType_1 = require("./FeatureDataType"); +exports.instanceOfVectorColumnInfo = instanceOfVectorColumnInfo; +exports.VectorColumnInfoFromJSON = VectorColumnInfoFromJSON; +exports.VectorColumnInfoFromJSONTyped = VectorColumnInfoFromJSONTyped; +exports.VectorColumnInfoToJSON = VectorColumnInfoToJSON; +exports.VectorColumnInfoToJSONTyped = VectorColumnInfoToJSONTyped; const Measurement_1 = require("./Measurement"); +const FeatureDataType_1 = require("./FeatureDataType"); /** * Check if a given object implements the VectorColumnInfo interface. */ function instanceOfVectorColumnInfo(value) { - let isInstance = true; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "measurement" in value; - return isInstance; + if (!('dataType' in value) || value['dataType'] === undefined) + return false; + if (!('measurement' in value) || value['measurement'] === undefined) + return false; + return true; } -exports.instanceOfVectorColumnInfo = instanceOfVectorColumnInfo; function VectorColumnInfoFromJSON(json) { return VectorColumnInfoFromJSONTyped(json, false); } -exports.VectorColumnInfoFromJSON = VectorColumnInfoFromJSON; function VectorColumnInfoFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -39,17 +42,15 @@ function VectorColumnInfoFromJSONTyped(json, ignoreDiscriminator) { 'measurement': (0, Measurement_1.MeasurementFromJSON)(json['measurement']), }; } -exports.VectorColumnInfoFromJSONTyped = VectorColumnInfoFromJSONTyped; -function VectorColumnInfoToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function VectorColumnInfoToJSON(json) { + return VectorColumnInfoToJSONTyped(json, false); +} +function VectorColumnInfoToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'dataType': (0, FeatureDataType_1.FeatureDataTypeToJSON)(value.dataType), - 'measurement': (0, Measurement_1.MeasurementToJSON)(value.measurement), + 'dataType': (0, FeatureDataType_1.FeatureDataTypeToJSON)(value['dataType']), + 'measurement': (0, Measurement_1.MeasurementToJSON)(value['measurement']), }; } -exports.VectorColumnInfoToJSON = VectorColumnInfoToJSON; diff --git a/typescript/dist/models/VectorDataType.d.ts b/typescript/dist/models/VectorDataType.d.ts index 90d65659..f3ce8f10 100644 --- a/typescript/dist/models/VectorDataType.d.ts +++ b/typescript/dist/models/VectorDataType.d.ts @@ -20,6 +20,8 @@ export declare const VectorDataType: { readonly MultiPolygon: "MultiPolygon"; }; export type VectorDataType = typeof VectorDataType[keyof typeof VectorDataType]; +export declare function instanceOfVectorDataType(value: any): boolean; export declare function VectorDataTypeFromJSON(json: any): VectorDataType; export declare function VectorDataTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): VectorDataType; export declare function VectorDataTypeToJSON(value?: VectorDataType | null): any; +export declare function VectorDataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): VectorDataType; diff --git a/typescript/dist/models/VectorDataType.js b/typescript/dist/models/VectorDataType.js index 183fae01..ffbaf6e0 100644 --- a/typescript/dist/models/VectorDataType.js +++ b/typescript/dist/models/VectorDataType.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.VectorDataTypeToJSON = exports.VectorDataTypeFromJSONTyped = exports.VectorDataTypeFromJSON = exports.VectorDataType = void 0; +exports.VectorDataType = void 0; +exports.instanceOfVectorDataType = instanceOfVectorDataType; +exports.VectorDataTypeFromJSON = VectorDataTypeFromJSON; +exports.VectorDataTypeFromJSONTyped = VectorDataTypeFromJSONTyped; +exports.VectorDataTypeToJSON = VectorDataTypeToJSON; +exports.VectorDataTypeToJSONTyped = VectorDataTypeToJSONTyped; /** * An enum that contains all possible vector data types * @export @@ -24,15 +29,25 @@ exports.VectorDataType = { MultiLineString: 'MultiLineString', MultiPolygon: 'MultiPolygon' }; +function instanceOfVectorDataType(value) { + for (const key in exports.VectorDataType) { + if (Object.prototype.hasOwnProperty.call(exports.VectorDataType, key)) { + if (exports.VectorDataType[key] === value) { + return true; + } + } + } + return false; +} function VectorDataTypeFromJSON(json) { return VectorDataTypeFromJSONTyped(json, false); } -exports.VectorDataTypeFromJSON = VectorDataTypeFromJSON; function VectorDataTypeFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.VectorDataTypeFromJSONTyped = VectorDataTypeFromJSONTyped; function VectorDataTypeToJSON(value) { return value; } -exports.VectorDataTypeToJSON = VectorDataTypeToJSON; +function VectorDataTypeToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/VectorQueryRectangle.d.ts b/typescript/dist/models/VectorQueryRectangle.d.ts index d2cb9126..6b878b63 100644 --- a/typescript/dist/models/VectorQueryRectangle.d.ts +++ b/typescript/dist/models/VectorQueryRectangle.d.ts @@ -9,9 +9,9 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; import type { SpatialResolution } from './SpatialResolution'; import type { TimeInterval } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * A spatio-temporal rectangle with a specified resolution * @export @@ -40,7 +40,8 @@ export interface VectorQueryRectangle { /** * Check if a given object implements the VectorQueryRectangle interface. */ -export declare function instanceOfVectorQueryRectangle(value: object): boolean; +export declare function instanceOfVectorQueryRectangle(value: object): value is VectorQueryRectangle; export declare function VectorQueryRectangleFromJSON(json: any): VectorQueryRectangle; export declare function VectorQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): VectorQueryRectangle; -export declare function VectorQueryRectangleToJSON(value?: VectorQueryRectangle | null): any; +export declare function VectorQueryRectangleToJSON(json: any): VectorQueryRectangle; +export declare function VectorQueryRectangleToJSONTyped(value?: VectorQueryRectangle | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/VectorQueryRectangle.js b/typescript/dist/models/VectorQueryRectangle.js index 9b18e8b8..9d2f700e 100644 --- a/typescript/dist/models/VectorQueryRectangle.js +++ b/typescript/dist/models/VectorQueryRectangle.js @@ -13,27 +13,31 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.VectorQueryRectangleToJSON = exports.VectorQueryRectangleFromJSONTyped = exports.VectorQueryRectangleFromJSON = exports.instanceOfVectorQueryRectangle = void 0; -const BoundingBox2D_1 = require("./BoundingBox2D"); +exports.instanceOfVectorQueryRectangle = instanceOfVectorQueryRectangle; +exports.VectorQueryRectangleFromJSON = VectorQueryRectangleFromJSON; +exports.VectorQueryRectangleFromJSONTyped = VectorQueryRectangleFromJSONTyped; +exports.VectorQueryRectangleToJSON = VectorQueryRectangleToJSON; +exports.VectorQueryRectangleToJSONTyped = VectorQueryRectangleToJSONTyped; const SpatialResolution_1 = require("./SpatialResolution"); const TimeInterval_1 = require("./TimeInterval"); +const BoundingBox2D_1 = require("./BoundingBox2D"); /** * Check if a given object implements the VectorQueryRectangle interface. */ function instanceOfVectorQueryRectangle(value) { - let isInstance = true; - isInstance = isInstance && "spatialBounds" in value; - isInstance = isInstance && "spatialResolution" in value; - isInstance = isInstance && "timeInterval" in value; - return isInstance; + if (!('spatialBounds' in value) || value['spatialBounds'] === undefined) + return false; + if (!('spatialResolution' in value) || value['spatialResolution'] === undefined) + return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) + return false; + return true; } -exports.instanceOfVectorQueryRectangle = instanceOfVectorQueryRectangle; function VectorQueryRectangleFromJSON(json) { return VectorQueryRectangleFromJSONTyped(json, false); } -exports.VectorQueryRectangleFromJSON = VectorQueryRectangleFromJSON; function VectorQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -42,18 +46,16 @@ function VectorQueryRectangleFromJSONTyped(json, ignoreDiscriminator) { 'timeInterval': (0, TimeInterval_1.TimeIntervalFromJSON)(json['timeInterval']), }; } -exports.VectorQueryRectangleFromJSONTyped = VectorQueryRectangleFromJSONTyped; -function VectorQueryRectangleToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function VectorQueryRectangleToJSON(json) { + return VectorQueryRectangleToJSONTyped(json, false); +} +function VectorQueryRectangleToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'spatialBounds': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value.spatialBounds), - 'spatialResolution': (0, SpatialResolution_1.SpatialResolutionToJSON)(value.spatialResolution), - 'timeInterval': (0, TimeInterval_1.TimeIntervalToJSON)(value.timeInterval), + 'spatialBounds': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value['spatialBounds']), + 'spatialResolution': (0, SpatialResolution_1.SpatialResolutionToJSON)(value['spatialResolution']), + 'timeInterval': (0, TimeInterval_1.TimeIntervalToJSON)(value['timeInterval']), }; } -exports.VectorQueryRectangleToJSON = VectorQueryRectangleToJSON; diff --git a/typescript/dist/models/VectorResultDescriptor.d.ts b/typescript/dist/models/VectorResultDescriptor.d.ts index 4170742f..65071ac9 100644 --- a/typescript/dist/models/VectorResultDescriptor.d.ts +++ b/typescript/dist/models/VectorResultDescriptor.d.ts @@ -9,10 +9,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import type { BoundingBox2D } from './BoundingBox2D'; +import type { VectorDataType } from './VectorDataType'; import type { TimeInterval } from './TimeInterval'; import type { VectorColumnInfo } from './VectorColumnInfo'; -import type { VectorDataType } from './VectorDataType'; +import type { BoundingBox2D } from './BoundingBox2D'; /** * * @export @@ -55,7 +55,8 @@ export interface VectorResultDescriptor { /** * Check if a given object implements the VectorResultDescriptor interface. */ -export declare function instanceOfVectorResultDescriptor(value: object): boolean; +export declare function instanceOfVectorResultDescriptor(value: object): value is VectorResultDescriptor; export declare function VectorResultDescriptorFromJSON(json: any): VectorResultDescriptor; export declare function VectorResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): VectorResultDescriptor; -export declare function VectorResultDescriptorToJSON(value?: VectorResultDescriptor | null): any; +export declare function VectorResultDescriptorToJSON(json: any): VectorResultDescriptor; +export declare function VectorResultDescriptorToJSONTyped(value?: VectorResultDescriptor | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/VectorResultDescriptor.js b/typescript/dist/models/VectorResultDescriptor.js index ad56d452..65633e14 100644 --- a/typescript/dist/models/VectorResultDescriptor.js +++ b/typescript/dist/models/VectorResultDescriptor.js @@ -13,53 +13,55 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.VectorResultDescriptorToJSON = exports.VectorResultDescriptorFromJSONTyped = exports.VectorResultDescriptorFromJSON = exports.instanceOfVectorResultDescriptor = void 0; +exports.instanceOfVectorResultDescriptor = instanceOfVectorResultDescriptor; +exports.VectorResultDescriptorFromJSON = VectorResultDescriptorFromJSON; +exports.VectorResultDescriptorFromJSONTyped = VectorResultDescriptorFromJSONTyped; +exports.VectorResultDescriptorToJSON = VectorResultDescriptorToJSON; +exports.VectorResultDescriptorToJSONTyped = VectorResultDescriptorToJSONTyped; const runtime_1 = require("../runtime"); -const BoundingBox2D_1 = require("./BoundingBox2D"); +const VectorDataType_1 = require("./VectorDataType"); const TimeInterval_1 = require("./TimeInterval"); const VectorColumnInfo_1 = require("./VectorColumnInfo"); -const VectorDataType_1 = require("./VectorDataType"); +const BoundingBox2D_1 = require("./BoundingBox2D"); /** * Check if a given object implements the VectorResultDescriptor interface. */ function instanceOfVectorResultDescriptor(value) { - let isInstance = true; - isInstance = isInstance && "columns" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - return isInstance; + if (!('columns' in value) || value['columns'] === undefined) + return false; + if (!('dataType' in value) || value['dataType'] === undefined) + return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) + return false; + return true; } -exports.instanceOfVectorResultDescriptor = instanceOfVectorResultDescriptor; function VectorResultDescriptorFromJSON(json) { return VectorResultDescriptorFromJSONTyped(json, false); } -exports.VectorResultDescriptorFromJSON = VectorResultDescriptorFromJSON; function VectorResultDescriptorFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !(0, runtime_1.exists)(json, 'bbox') ? undefined : (0, BoundingBox2D_1.BoundingBox2DFromJSON)(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : (0, BoundingBox2D_1.BoundingBox2DFromJSON)(json['bbox']), 'columns': ((0, runtime_1.mapValues)(json['columns'], VectorColumnInfo_1.VectorColumnInfoFromJSON)), 'dataType': (0, VectorDataType_1.VectorDataTypeFromJSON)(json['dataType']), 'spatialReference': json['spatialReference'], - 'time': !(0, runtime_1.exists)(json, 'time') ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), + 'time': json['time'] == null ? undefined : (0, TimeInterval_1.TimeIntervalFromJSON)(json['time']), }; } -exports.VectorResultDescriptorFromJSONTyped = VectorResultDescriptorFromJSONTyped; -function VectorResultDescriptorToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function VectorResultDescriptorToJSON(json) { + return VectorResultDescriptorToJSONTyped(json, false); +} +function VectorResultDescriptorToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bbox': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value.bbox), - 'columns': ((0, runtime_1.mapValues)(value.columns, VectorColumnInfo_1.VectorColumnInfoToJSON)), - 'dataType': (0, VectorDataType_1.VectorDataTypeToJSON)(value.dataType), - 'spatialReference': value.spatialReference, - 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value.time), + 'bbox': (0, BoundingBox2D_1.BoundingBox2DToJSON)(value['bbox']), + 'columns': ((0, runtime_1.mapValues)(value['columns'], VectorColumnInfo_1.VectorColumnInfoToJSON)), + 'dataType': (0, VectorDataType_1.VectorDataTypeToJSON)(value['dataType']), + 'spatialReference': value['spatialReference'], + 'time': (0, TimeInterval_1.TimeIntervalToJSON)(value['time']), }; } -exports.VectorResultDescriptorToJSON = VectorResultDescriptorToJSON; diff --git a/typescript/dist/models/Volume.d.ts b/typescript/dist/models/Volume.d.ts index 597f4625..c17f17f7 100644 --- a/typescript/dist/models/Volume.d.ts +++ b/typescript/dist/models/Volume.d.ts @@ -31,7 +31,8 @@ export interface Volume { /** * Check if a given object implements the Volume interface. */ -export declare function instanceOfVolume(value: object): boolean; +export declare function instanceOfVolume(value: object): value is Volume; export declare function VolumeFromJSON(json: any): Volume; export declare function VolumeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Volume; -export declare function VolumeToJSON(value?: Volume | null): any; +export declare function VolumeToJSON(json: any): Volume; +export declare function VolumeToJSONTyped(value?: Volume | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Volume.js b/typescript/dist/models/Volume.js index 497b58bc..29e7d0fd 100644 --- a/typescript/dist/models/Volume.js +++ b/typescript/dist/models/Volume.js @@ -13,41 +13,40 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.VolumeToJSON = exports.VolumeFromJSONTyped = exports.VolumeFromJSON = exports.instanceOfVolume = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfVolume = instanceOfVolume; +exports.VolumeFromJSON = VolumeFromJSON; +exports.VolumeFromJSONTyped = VolumeFromJSONTyped; +exports.VolumeToJSON = VolumeToJSON; +exports.VolumeToJSONTyped = VolumeToJSONTyped; /** * Check if a given object implements the Volume interface. */ function instanceOfVolume(value) { - let isInstance = true; - isInstance = isInstance && "name" in value; - return isInstance; + if (!('name' in value) || value['name'] === undefined) + return false; + return true; } -exports.instanceOfVolume = instanceOfVolume; function VolumeFromJSON(json) { return VolumeFromJSONTyped(json, false); } -exports.VolumeFromJSON = VolumeFromJSON; function VolumeFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'name': json['name'], - 'path': !(0, runtime_1.exists)(json, 'path') ? undefined : json['path'], + 'path': json['path'] == null ? undefined : json['path'], }; } -exports.VolumeFromJSONTyped = VolumeFromJSONTyped; -function VolumeToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function VolumeToJSON(json) { + return VolumeToJSONTyped(json, false); +} +function VolumeToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'name': value.name, - 'path': value.path, + 'name': value['name'], + 'path': value['path'], }; } -exports.VolumeToJSON = VolumeToJSON; diff --git a/typescript/dist/models/VolumeFileLayersResponse.d.ts b/typescript/dist/models/VolumeFileLayersResponse.d.ts index 77be37b3..d1e97fc9 100644 --- a/typescript/dist/models/VolumeFileLayersResponse.d.ts +++ b/typescript/dist/models/VolumeFileLayersResponse.d.ts @@ -25,7 +25,8 @@ export interface VolumeFileLayersResponse { /** * Check if a given object implements the VolumeFileLayersResponse interface. */ -export declare function instanceOfVolumeFileLayersResponse(value: object): boolean; +export declare function instanceOfVolumeFileLayersResponse(value: object): value is VolumeFileLayersResponse; export declare function VolumeFileLayersResponseFromJSON(json: any): VolumeFileLayersResponse; export declare function VolumeFileLayersResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): VolumeFileLayersResponse; -export declare function VolumeFileLayersResponseToJSON(value?: VolumeFileLayersResponse | null): any; +export declare function VolumeFileLayersResponseToJSON(json: any): VolumeFileLayersResponse; +export declare function VolumeFileLayersResponseToJSONTyped(value?: VolumeFileLayersResponse | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/VolumeFileLayersResponse.js b/typescript/dist/models/VolumeFileLayersResponse.js index e5761070..2adc48e9 100644 --- a/typescript/dist/models/VolumeFileLayersResponse.js +++ b/typescript/dist/models/VolumeFileLayersResponse.js @@ -13,38 +13,38 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.VolumeFileLayersResponseToJSON = exports.VolumeFileLayersResponseFromJSONTyped = exports.VolumeFileLayersResponseFromJSON = exports.instanceOfVolumeFileLayersResponse = void 0; +exports.instanceOfVolumeFileLayersResponse = instanceOfVolumeFileLayersResponse; +exports.VolumeFileLayersResponseFromJSON = VolumeFileLayersResponseFromJSON; +exports.VolumeFileLayersResponseFromJSONTyped = VolumeFileLayersResponseFromJSONTyped; +exports.VolumeFileLayersResponseToJSON = VolumeFileLayersResponseToJSON; +exports.VolumeFileLayersResponseToJSONTyped = VolumeFileLayersResponseToJSONTyped; /** * Check if a given object implements the VolumeFileLayersResponse interface. */ function instanceOfVolumeFileLayersResponse(value) { - let isInstance = true; - isInstance = isInstance && "layers" in value; - return isInstance; + if (!('layers' in value) || value['layers'] === undefined) + return false; + return true; } -exports.instanceOfVolumeFileLayersResponse = instanceOfVolumeFileLayersResponse; function VolumeFileLayersResponseFromJSON(json) { return VolumeFileLayersResponseFromJSONTyped(json, false); } -exports.VolumeFileLayersResponseFromJSON = VolumeFileLayersResponseFromJSON; function VolumeFileLayersResponseFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'layers': json['layers'], }; } -exports.VolumeFileLayersResponseFromJSONTyped = VolumeFileLayersResponseFromJSONTyped; -function VolumeFileLayersResponseToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function VolumeFileLayersResponseToJSON(json) { + return VolumeFileLayersResponseToJSONTyped(json, false); +} +function VolumeFileLayersResponseToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'layers': value.layers, + 'layers': value['layers'], }; } -exports.VolumeFileLayersResponseToJSON = VolumeFileLayersResponseToJSON; diff --git a/typescript/dist/models/WcsBoundingbox.d.ts b/typescript/dist/models/WcsBoundingbox.d.ts index 3ddd2f6e..9967f822 100644 --- a/typescript/dist/models/WcsBoundingbox.d.ts +++ b/typescript/dist/models/WcsBoundingbox.d.ts @@ -31,7 +31,8 @@ export interface WcsBoundingbox { /** * Check if a given object implements the WcsBoundingbox interface. */ -export declare function instanceOfWcsBoundingbox(value: object): boolean; +export declare function instanceOfWcsBoundingbox(value: object): value is WcsBoundingbox; export declare function WcsBoundingboxFromJSON(json: any): WcsBoundingbox; export declare function WcsBoundingboxFromJSONTyped(json: any, ignoreDiscriminator: boolean): WcsBoundingbox; -export declare function WcsBoundingboxToJSON(value?: WcsBoundingbox | null): any; +export declare function WcsBoundingboxToJSON(json: any): WcsBoundingbox; +export declare function WcsBoundingboxToJSONTyped(value?: WcsBoundingbox | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/WcsBoundingbox.js b/typescript/dist/models/WcsBoundingbox.js index 90199245..e49f5133 100644 --- a/typescript/dist/models/WcsBoundingbox.js +++ b/typescript/dist/models/WcsBoundingbox.js @@ -13,41 +13,40 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.WcsBoundingboxToJSON = exports.WcsBoundingboxFromJSONTyped = exports.WcsBoundingboxFromJSON = exports.instanceOfWcsBoundingbox = void 0; -const runtime_1 = require("../runtime"); +exports.instanceOfWcsBoundingbox = instanceOfWcsBoundingbox; +exports.WcsBoundingboxFromJSON = WcsBoundingboxFromJSON; +exports.WcsBoundingboxFromJSONTyped = WcsBoundingboxFromJSONTyped; +exports.WcsBoundingboxToJSON = WcsBoundingboxToJSON; +exports.WcsBoundingboxToJSONTyped = WcsBoundingboxToJSONTyped; /** * Check if a given object implements the WcsBoundingbox interface. */ function instanceOfWcsBoundingbox(value) { - let isInstance = true; - isInstance = isInstance && "bbox" in value; - return isInstance; + if (!('bbox' in value) || value['bbox'] === undefined) + return false; + return true; } -exports.instanceOfWcsBoundingbox = instanceOfWcsBoundingbox; function WcsBoundingboxFromJSON(json) { return WcsBoundingboxFromJSONTyped(json, false); } -exports.WcsBoundingboxFromJSON = WcsBoundingboxFromJSON; function WcsBoundingboxFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bbox': json['bbox'], - 'spatialReference': !(0, runtime_1.exists)(json, 'spatial_reference') ? undefined : json['spatial_reference'], + 'spatialReference': json['spatial_reference'] == null ? undefined : json['spatial_reference'], }; } -exports.WcsBoundingboxFromJSONTyped = WcsBoundingboxFromJSONTyped; -function WcsBoundingboxToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function WcsBoundingboxToJSON(json) { + return WcsBoundingboxToJSONTyped(json, false); +} +function WcsBoundingboxToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'bbox': value.bbox, - 'spatial_reference': value.spatialReference, + 'bbox': value['bbox'], + 'spatial_reference': value['spatialReference'], }; } -exports.WcsBoundingboxToJSON = WcsBoundingboxToJSON; diff --git a/typescript/dist/models/WcsService.d.ts b/typescript/dist/models/WcsService.d.ts index 3893f5d8..399c7a2e 100644 --- a/typescript/dist/models/WcsService.d.ts +++ b/typescript/dist/models/WcsService.d.ts @@ -17,6 +17,8 @@ export declare const WcsService: { readonly Wcs: "WCS"; }; export type WcsService = typeof WcsService[keyof typeof WcsService]; +export declare function instanceOfWcsService(value: any): boolean; export declare function WcsServiceFromJSON(json: any): WcsService; export declare function WcsServiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): WcsService; export declare function WcsServiceToJSON(value?: WcsService | null): any; +export declare function WcsServiceToJSONTyped(value: any, ignoreDiscriminator: boolean): WcsService; diff --git a/typescript/dist/models/WcsService.js b/typescript/dist/models/WcsService.js index e287db69..9926aaba 100644 --- a/typescript/dist/models/WcsService.js +++ b/typescript/dist/models/WcsService.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.WcsServiceToJSON = exports.WcsServiceFromJSONTyped = exports.WcsServiceFromJSON = exports.WcsService = void 0; +exports.WcsService = void 0; +exports.instanceOfWcsService = instanceOfWcsService; +exports.WcsServiceFromJSON = WcsServiceFromJSON; +exports.WcsServiceFromJSONTyped = WcsServiceFromJSONTyped; +exports.WcsServiceToJSON = WcsServiceToJSON; +exports.WcsServiceToJSONTyped = WcsServiceToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.WcsServiceToJSON = exports.WcsServiceFromJSONTyped = exports.WcsServiceF exports.WcsService = { Wcs: 'WCS' }; +function instanceOfWcsService(value) { + for (const key in exports.WcsService) { + if (Object.prototype.hasOwnProperty.call(exports.WcsService, key)) { + if (exports.WcsService[key] === value) { + return true; + } + } + } + return false; +} function WcsServiceFromJSON(json) { return WcsServiceFromJSONTyped(json, false); } -exports.WcsServiceFromJSON = WcsServiceFromJSON; function WcsServiceFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.WcsServiceFromJSONTyped = WcsServiceFromJSONTyped; function WcsServiceToJSON(value) { return value; } -exports.WcsServiceToJSON = WcsServiceToJSON; +function WcsServiceToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/WcsVersion.d.ts b/typescript/dist/models/WcsVersion.d.ts index de362b0f..3b172fe5 100644 --- a/typescript/dist/models/WcsVersion.d.ts +++ b/typescript/dist/models/WcsVersion.d.ts @@ -14,10 +14,12 @@ * @export */ export declare const WcsVersion: { - readonly _0: "1.1.0"; - readonly _1: "1.1.1"; + readonly _110: "1.1.0"; + readonly _111: "1.1.1"; }; export type WcsVersion = typeof WcsVersion[keyof typeof WcsVersion]; +export declare function instanceOfWcsVersion(value: any): boolean; export declare function WcsVersionFromJSON(json: any): WcsVersion; export declare function WcsVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): WcsVersion; export declare function WcsVersionToJSON(value?: WcsVersion | null): any; +export declare function WcsVersionToJSONTyped(value: any, ignoreDiscriminator: boolean): WcsVersion; diff --git a/typescript/dist/models/WcsVersion.js b/typescript/dist/models/WcsVersion.js index 72413be2..b158d585 100644 --- a/typescript/dist/models/WcsVersion.js +++ b/typescript/dist/models/WcsVersion.js @@ -13,24 +13,39 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.WcsVersionToJSON = exports.WcsVersionFromJSONTyped = exports.WcsVersionFromJSON = exports.WcsVersion = void 0; +exports.WcsVersion = void 0; +exports.instanceOfWcsVersion = instanceOfWcsVersion; +exports.WcsVersionFromJSON = WcsVersionFromJSON; +exports.WcsVersionFromJSONTyped = WcsVersionFromJSONTyped; +exports.WcsVersionToJSON = WcsVersionToJSON; +exports.WcsVersionToJSONTyped = WcsVersionToJSONTyped; /** * * @export */ exports.WcsVersion = { - _0: '1.1.0', - _1: '1.1.1' + _110: '1.1.0', + _111: '1.1.1' }; +function instanceOfWcsVersion(value) { + for (const key in exports.WcsVersion) { + if (Object.prototype.hasOwnProperty.call(exports.WcsVersion, key)) { + if (exports.WcsVersion[key] === value) { + return true; + } + } + } + return false; +} function WcsVersionFromJSON(json) { return WcsVersionFromJSONTyped(json, false); } -exports.WcsVersionFromJSON = WcsVersionFromJSON; function WcsVersionFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.WcsVersionFromJSONTyped = WcsVersionFromJSONTyped; function WcsVersionToJSON(value) { return value; } -exports.WcsVersionToJSON = WcsVersionToJSON; +function WcsVersionToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/WfsService.d.ts b/typescript/dist/models/WfsService.d.ts index 9f8070d3..a503050f 100644 --- a/typescript/dist/models/WfsService.d.ts +++ b/typescript/dist/models/WfsService.d.ts @@ -17,6 +17,8 @@ export declare const WfsService: { readonly Wfs: "WFS"; }; export type WfsService = typeof WfsService[keyof typeof WfsService]; +export declare function instanceOfWfsService(value: any): boolean; export declare function WfsServiceFromJSON(json: any): WfsService; export declare function WfsServiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): WfsService; export declare function WfsServiceToJSON(value?: WfsService | null): any; +export declare function WfsServiceToJSONTyped(value: any, ignoreDiscriminator: boolean): WfsService; diff --git a/typescript/dist/models/WfsService.js b/typescript/dist/models/WfsService.js index b6be229b..6a1d73cd 100644 --- a/typescript/dist/models/WfsService.js +++ b/typescript/dist/models/WfsService.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.WfsServiceToJSON = exports.WfsServiceFromJSONTyped = exports.WfsServiceFromJSON = exports.WfsService = void 0; +exports.WfsService = void 0; +exports.instanceOfWfsService = instanceOfWfsService; +exports.WfsServiceFromJSON = WfsServiceFromJSON; +exports.WfsServiceFromJSONTyped = WfsServiceFromJSONTyped; +exports.WfsServiceToJSON = WfsServiceToJSON; +exports.WfsServiceToJSONTyped = WfsServiceToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.WfsServiceToJSON = exports.WfsServiceFromJSONTyped = exports.WfsServiceF exports.WfsService = { Wfs: 'WFS' }; +function instanceOfWfsService(value) { + for (const key in exports.WfsService) { + if (Object.prototype.hasOwnProperty.call(exports.WfsService, key)) { + if (exports.WfsService[key] === value) { + return true; + } + } + } + return false; +} function WfsServiceFromJSON(json) { return WfsServiceFromJSONTyped(json, false); } -exports.WfsServiceFromJSON = WfsServiceFromJSON; function WfsServiceFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.WfsServiceFromJSONTyped = WfsServiceFromJSONTyped; function WfsServiceToJSON(value) { return value; } -exports.WfsServiceToJSON = WfsServiceToJSON; +function WfsServiceToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/WfsVersion.d.ts b/typescript/dist/models/WfsVersion.d.ts index 9d1d2e9f..2291a77a 100644 --- a/typescript/dist/models/WfsVersion.d.ts +++ b/typescript/dist/models/WfsVersion.d.ts @@ -17,6 +17,8 @@ export declare const WfsVersion: { readonly _200: "2.0.0"; }; export type WfsVersion = typeof WfsVersion[keyof typeof WfsVersion]; +export declare function instanceOfWfsVersion(value: any): boolean; export declare function WfsVersionFromJSON(json: any): WfsVersion; export declare function WfsVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): WfsVersion; export declare function WfsVersionToJSON(value?: WfsVersion | null): any; +export declare function WfsVersionToJSONTyped(value: any, ignoreDiscriminator: boolean): WfsVersion; diff --git a/typescript/dist/models/WfsVersion.js b/typescript/dist/models/WfsVersion.js index 908354cd..17ffa1dd 100644 --- a/typescript/dist/models/WfsVersion.js +++ b/typescript/dist/models/WfsVersion.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.WfsVersionToJSON = exports.WfsVersionFromJSONTyped = exports.WfsVersionFromJSON = exports.WfsVersion = void 0; +exports.WfsVersion = void 0; +exports.instanceOfWfsVersion = instanceOfWfsVersion; +exports.WfsVersionFromJSON = WfsVersionFromJSON; +exports.WfsVersionFromJSONTyped = WfsVersionFromJSONTyped; +exports.WfsVersionToJSON = WfsVersionToJSON; +exports.WfsVersionToJSONTyped = WfsVersionToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.WfsVersionToJSON = exports.WfsVersionFromJSONTyped = exports.WfsVersionF exports.WfsVersion = { _200: '2.0.0' }; +function instanceOfWfsVersion(value) { + for (const key in exports.WfsVersion) { + if (Object.prototype.hasOwnProperty.call(exports.WfsVersion, key)) { + if (exports.WfsVersion[key] === value) { + return true; + } + } + } + return false; +} function WfsVersionFromJSON(json) { return WfsVersionFromJSONTyped(json, false); } -exports.WfsVersionFromJSON = WfsVersionFromJSON; function WfsVersionFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.WfsVersionFromJSONTyped = WfsVersionFromJSONTyped; function WfsVersionToJSON(value) { return value; } -exports.WfsVersionToJSON = WfsVersionToJSON; +function WfsVersionToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/WmsService.d.ts b/typescript/dist/models/WmsService.d.ts index 8038d8f6..dfc2b3db 100644 --- a/typescript/dist/models/WmsService.d.ts +++ b/typescript/dist/models/WmsService.d.ts @@ -17,6 +17,8 @@ export declare const WmsService: { readonly Wms: "WMS"; }; export type WmsService = typeof WmsService[keyof typeof WmsService]; +export declare function instanceOfWmsService(value: any): boolean; export declare function WmsServiceFromJSON(json: any): WmsService; export declare function WmsServiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): WmsService; export declare function WmsServiceToJSON(value?: WmsService | null): any; +export declare function WmsServiceToJSONTyped(value: any, ignoreDiscriminator: boolean): WmsService; diff --git a/typescript/dist/models/WmsService.js b/typescript/dist/models/WmsService.js index 9b101fa1..9a94e352 100644 --- a/typescript/dist/models/WmsService.js +++ b/typescript/dist/models/WmsService.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.WmsServiceToJSON = exports.WmsServiceFromJSONTyped = exports.WmsServiceFromJSON = exports.WmsService = void 0; +exports.WmsService = void 0; +exports.instanceOfWmsService = instanceOfWmsService; +exports.WmsServiceFromJSON = WmsServiceFromJSON; +exports.WmsServiceFromJSONTyped = WmsServiceFromJSONTyped; +exports.WmsServiceToJSON = WmsServiceToJSON; +exports.WmsServiceToJSONTyped = WmsServiceToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.WmsServiceToJSON = exports.WmsServiceFromJSONTyped = exports.WmsServiceF exports.WmsService = { Wms: 'WMS' }; +function instanceOfWmsService(value) { + for (const key in exports.WmsService) { + if (Object.prototype.hasOwnProperty.call(exports.WmsService, key)) { + if (exports.WmsService[key] === value) { + return true; + } + } + } + return false; +} function WmsServiceFromJSON(json) { return WmsServiceFromJSONTyped(json, false); } -exports.WmsServiceFromJSON = WmsServiceFromJSON; function WmsServiceFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.WmsServiceFromJSONTyped = WmsServiceFromJSONTyped; function WmsServiceToJSON(value) { return value; } -exports.WmsServiceToJSON = WmsServiceToJSON; +function WmsServiceToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/WmsVersion.d.ts b/typescript/dist/models/WmsVersion.d.ts index b30c4c79..06f9bdc8 100644 --- a/typescript/dist/models/WmsVersion.d.ts +++ b/typescript/dist/models/WmsVersion.d.ts @@ -17,6 +17,8 @@ export declare const WmsVersion: { readonly _130: "1.3.0"; }; export type WmsVersion = typeof WmsVersion[keyof typeof WmsVersion]; +export declare function instanceOfWmsVersion(value: any): boolean; export declare function WmsVersionFromJSON(json: any): WmsVersion; export declare function WmsVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): WmsVersion; export declare function WmsVersionToJSON(value?: WmsVersion | null): any; +export declare function WmsVersionToJSONTyped(value: any, ignoreDiscriminator: boolean): WmsVersion; diff --git a/typescript/dist/models/WmsVersion.js b/typescript/dist/models/WmsVersion.js index 026c5580..c5f1c0cc 100644 --- a/typescript/dist/models/WmsVersion.js +++ b/typescript/dist/models/WmsVersion.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.WmsVersionToJSON = exports.WmsVersionFromJSONTyped = exports.WmsVersionFromJSON = exports.WmsVersion = void 0; +exports.WmsVersion = void 0; +exports.instanceOfWmsVersion = instanceOfWmsVersion; +exports.WmsVersionFromJSON = WmsVersionFromJSON; +exports.WmsVersionFromJSONTyped = WmsVersionFromJSONTyped; +exports.WmsVersionToJSON = WmsVersionToJSON; +exports.WmsVersionToJSONTyped = WmsVersionToJSONTyped; /** * * @export @@ -21,15 +26,25 @@ exports.WmsVersionToJSON = exports.WmsVersionFromJSONTyped = exports.WmsVersionF exports.WmsVersion = { _130: '1.3.0' }; +function instanceOfWmsVersion(value) { + for (const key in exports.WmsVersion) { + if (Object.prototype.hasOwnProperty.call(exports.WmsVersion, key)) { + if (exports.WmsVersion[key] === value) { + return true; + } + } + } + return false; +} function WmsVersionFromJSON(json) { return WmsVersionFromJSONTyped(json, false); } -exports.WmsVersionFromJSON = WmsVersionFromJSON; function WmsVersionFromJSONTyped(json, ignoreDiscriminator) { return json; } -exports.WmsVersionFromJSONTyped = WmsVersionFromJSONTyped; function WmsVersionToJSON(value) { return value; } -exports.WmsVersionToJSON = WmsVersionToJSON; +function WmsVersionToJSONTyped(value, ignoreDiscriminator) { + return value; +} diff --git a/typescript/dist/models/Workflow.d.ts b/typescript/dist/models/Workflow.d.ts index 277ea139..8b12f05d 100644 --- a/typescript/dist/models/Workflow.d.ts +++ b/typescript/dist/models/Workflow.d.ts @@ -41,7 +41,8 @@ export type WorkflowTypeEnum = typeof WorkflowTypeEnum[keyof typeof WorkflowType /** * Check if a given object implements the Workflow interface. */ -export declare function instanceOfWorkflow(value: object): boolean; +export declare function instanceOfWorkflow(value: object): value is Workflow; export declare function WorkflowFromJSON(json: any): Workflow; export declare function WorkflowFromJSONTyped(json: any, ignoreDiscriminator: boolean): Workflow; -export declare function WorkflowToJSON(value?: Workflow | null): any; +export declare function WorkflowToJSON(json: any): Workflow; +export declare function WorkflowToJSONTyped(value?: Workflow | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/Workflow.js b/typescript/dist/models/Workflow.js index 448410c9..2beb8716 100644 --- a/typescript/dist/models/Workflow.js +++ b/typescript/dist/models/Workflow.js @@ -13,7 +13,12 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.WorkflowToJSON = exports.WorkflowFromJSONTyped = exports.WorkflowFromJSON = exports.instanceOfWorkflow = exports.WorkflowTypeEnum = void 0; +exports.WorkflowTypeEnum = void 0; +exports.instanceOfWorkflow = instanceOfWorkflow; +exports.WorkflowFromJSON = WorkflowFromJSON; +exports.WorkflowFromJSONTyped = WorkflowFromJSONTyped; +exports.WorkflowToJSON = WorkflowToJSON; +exports.WorkflowToJSONTyped = WorkflowToJSONTyped; const TypedOperatorOperator_1 = require("./TypedOperatorOperator"); /** * @export @@ -27,18 +32,17 @@ exports.WorkflowTypeEnum = { * Check if a given object implements the Workflow interface. */ function instanceOfWorkflow(value) { - let isInstance = true; - isInstance = isInstance && "operator" in value; - isInstance = isInstance && "type" in value; - return isInstance; + if (!('operator' in value) || value['operator'] === undefined) + return false; + if (!('type' in value) || value['type'] === undefined) + return false; + return true; } -exports.instanceOfWorkflow = instanceOfWorkflow; function WorkflowFromJSON(json) { return WorkflowFromJSONTyped(json, false); } -exports.WorkflowFromJSON = WorkflowFromJSON; function WorkflowFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -46,17 +50,15 @@ function WorkflowFromJSONTyped(json, ignoreDiscriminator) { 'type': json['type'], }; } -exports.WorkflowFromJSONTyped = WorkflowFromJSONTyped; -function WorkflowToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function WorkflowToJSON(json) { + return WorkflowToJSONTyped(json, false); +} +function WorkflowToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'operator': (0, TypedOperatorOperator_1.TypedOperatorOperatorToJSON)(value.operator), - 'type': value.type, + 'operator': (0, TypedOperatorOperator_1.TypedOperatorOperatorToJSON)(value['operator']), + 'type': value['type'], }; } -exports.WorkflowToJSON = WorkflowToJSON; diff --git a/typescript/dist/models/WrappedPlotOutput.d.ts b/typescript/dist/models/WrappedPlotOutput.d.ts index b5295159..59b5c0e7 100644 --- a/typescript/dist/models/WrappedPlotOutput.d.ts +++ b/typescript/dist/models/WrappedPlotOutput.d.ts @@ -38,7 +38,8 @@ export interface WrappedPlotOutput { /** * Check if a given object implements the WrappedPlotOutput interface. */ -export declare function instanceOfWrappedPlotOutput(value: object): boolean; +export declare function instanceOfWrappedPlotOutput(value: object): value is WrappedPlotOutput; export declare function WrappedPlotOutputFromJSON(json: any): WrappedPlotOutput; export declare function WrappedPlotOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): WrappedPlotOutput; -export declare function WrappedPlotOutputToJSON(value?: WrappedPlotOutput | null): any; +export declare function WrappedPlotOutputToJSON(json: any): WrappedPlotOutput; +export declare function WrappedPlotOutputToJSONTyped(value?: WrappedPlotOutput | null, ignoreDiscriminator?: boolean): any; diff --git a/typescript/dist/models/WrappedPlotOutput.js b/typescript/dist/models/WrappedPlotOutput.js index f9733d4f..8afbe2b3 100644 --- a/typescript/dist/models/WrappedPlotOutput.js +++ b/typescript/dist/models/WrappedPlotOutput.js @@ -13,25 +13,29 @@ * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.WrappedPlotOutputToJSON = exports.WrappedPlotOutputFromJSONTyped = exports.WrappedPlotOutputFromJSON = exports.instanceOfWrappedPlotOutput = void 0; +exports.instanceOfWrappedPlotOutput = instanceOfWrappedPlotOutput; +exports.WrappedPlotOutputFromJSON = WrappedPlotOutputFromJSON; +exports.WrappedPlotOutputFromJSONTyped = WrappedPlotOutputFromJSONTyped; +exports.WrappedPlotOutputToJSON = WrappedPlotOutputToJSON; +exports.WrappedPlotOutputToJSONTyped = WrappedPlotOutputToJSONTyped; const PlotOutputFormat_1 = require("./PlotOutputFormat"); /** * Check if a given object implements the WrappedPlotOutput interface. */ function instanceOfWrappedPlotOutput(value) { - let isInstance = true; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "outputFormat" in value; - isInstance = isInstance && "plotType" in value; - return isInstance; + if (!('data' in value) || value['data'] === undefined) + return false; + if (!('outputFormat' in value) || value['outputFormat'] === undefined) + return false; + if (!('plotType' in value) || value['plotType'] === undefined) + return false; + return true; } -exports.instanceOfWrappedPlotOutput = instanceOfWrappedPlotOutput; function WrappedPlotOutputFromJSON(json) { return WrappedPlotOutputFromJSONTyped(json, false); } -exports.WrappedPlotOutputFromJSON = WrappedPlotOutputFromJSON; function WrappedPlotOutputFromJSONTyped(json, ignoreDiscriminator) { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -40,18 +44,16 @@ function WrappedPlotOutputFromJSONTyped(json, ignoreDiscriminator) { 'plotType': json['plotType'], }; } -exports.WrappedPlotOutputFromJSONTyped = WrappedPlotOutputFromJSONTyped; -function WrappedPlotOutputToJSON(value) { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +function WrappedPlotOutputToJSON(json) { + return WrappedPlotOutputToJSONTyped(json, false); +} +function WrappedPlotOutputToJSONTyped(value, ignoreDiscriminator = false) { + if (value == null) { + return value; } return { - 'data': value.data, - 'outputFormat': (0, PlotOutputFormat_1.PlotOutputFormatToJSON)(value.outputFormat), - 'plotType': value.plotType, + 'data': value['data'], + 'outputFormat': (0, PlotOutputFormat_1.PlotOutputFormatToJSON)(value['outputFormat']), + 'plotType': value['plotType'], }; } -exports.WrappedPlotOutputToJSON = WrappedPlotOutputToJSON; diff --git a/typescript/dist/models/index.d.ts b/typescript/dist/models/index.d.ts index ccb8f378..4bfa5fb5 100644 --- a/typescript/dist/models/index.d.ts +++ b/typescript/dist/models/index.d.ts @@ -62,6 +62,7 @@ export * from './GetLegendGraphicRequest'; export * from './GetMapExceptionFormat'; export * from './GetMapFormat'; export * from './GetMapRequest'; +export * from './InlineObject'; export * from './InternalDataId'; export * from './Layer'; export * from './LayerCollection'; diff --git a/typescript/dist/models/index.js b/typescript/dist/models/index.js index 52927ee1..bfb06712 100644 --- a/typescript/dist/models/index.js +++ b/typescript/dist/models/index.js @@ -80,6 +80,7 @@ __exportStar(require("./GetLegendGraphicRequest"), exports); __exportStar(require("./GetMapExceptionFormat"), exports); __exportStar(require("./GetMapFormat"), exports); __exportStar(require("./GetMapRequest"), exports); +__exportStar(require("./InlineObject"), exports); __exportStar(require("./InternalDataId"), exports); __exportStar(require("./Layer"), exports); __exportStar(require("./LayerCollection"), exports); diff --git a/typescript/dist/runtime.d.ts b/typescript/dist/runtime.d.ts index 391b42be..2c52ed3d 100644 --- a/typescript/dist/runtime.d.ts +++ b/typescript/dist/runtime.d.ts @@ -17,7 +17,7 @@ export interface ConfigurationParameters { queryParamsStringify?: (params: HTTPQuery) => string; username?: string; password?: string; - apiKey?: string | ((name: string) => string); + apiKey?: string | Promise | ((name: string) => string | Promise); accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); headers?: HTTPHeaders; credentials?: RequestCredentials; @@ -32,7 +32,7 @@ export declare class Configuration { get queryParamsStringify(): (params: HTTPQuery) => string; get username(): string | undefined; get password(): string | undefined; - get apiKey(): ((name: string) => string) | undefined; + get apiKey(): ((name: string) => string | Promise) | undefined; get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined; get headers(): HTTPHeaders | undefined; get credentials(): RequestCredentials | undefined; @@ -122,8 +122,8 @@ export interface RequestOpts { query?: HTTPQuery; body?: HTTPBody; } -export declare function exists(json: any, key: string): boolean; export declare function querystring(params: HTTPQuery, prefix?: string): string; +export declare function exists(json: any, key: string): boolean; export declare function mapValues(data: any, fn: (item: any) => any): {}; export declare function canConsumeForm(consumes: Consume[]): boolean; export interface Consume { diff --git a/typescript/dist/runtime.js b/typescript/dist/runtime.js index 1dc58545..8fcb5f7e 100644 --- a/typescript/dist/runtime.js +++ b/typescript/dist/runtime.js @@ -22,7 +22,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.canConsumeForm = exports.mapValues = exports.querystring = exports.exists = exports.COLLECTION_FORMATS = exports.RequiredError = exports.FetchError = exports.ResponseError = exports.BaseAPI = exports.DefaultConfig = exports.Configuration = exports.BASE_PATH = void 0; +exports.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.COLLECTION_FORMATS = exports.RequiredError = exports.FetchError = exports.ResponseError = exports.BaseAPI = exports.DefaultConfig = exports.Configuration = exports.BASE_PATH = void 0; +exports.querystring = querystring; +exports.exists = exists; +exports.mapValues = mapValues; +exports.canConsumeForm = canConsumeForm; exports.BASE_PATH = "http://0.0.0.0:8080/api".replace(/\/+$/, ""); class Configuration { constructor(configuration = {}) { @@ -73,7 +77,7 @@ class Configuration { exports.Configuration = Configuration; exports.DefaultConfig = new Configuration({ headers: { - 'User-Agent': 'geoengine/openapi-client/typescript/0.0.20' + 'User-Agent': 'geoengine/openapi-client/typescript/0.0.21' } }); /** @@ -257,18 +261,12 @@ exports.COLLECTION_FORMATS = { tsv: "\t", pipes: "|", }; -function exists(json, key) { - const value = json[key]; - return value !== null && value !== undefined; -} -exports.exists = exists; function querystring(params, prefix = '') { return Object.keys(params) .map(key => querystringSingleKey(key, params[key], prefix)) .filter(part => part.length > 0) .join('&'); } -exports.querystring = querystring; function querystringSingleKey(key, value, keyPrefix = '') { const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); if (value instanceof Array) { @@ -288,10 +286,13 @@ function querystringSingleKey(key, value, keyPrefix = '') { } return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; } +function exists(json, key) { + const value = json[key]; + return value !== null && value !== undefined; +} function mapValues(data, fn) { return Object.keys(data).reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: fn(data[key]) })), {}); } -exports.mapValues = mapValues; function canConsumeForm(consumes) { for (const consume of consumes) { if ('multipart/form-data' === consume.contentType) { @@ -300,7 +301,6 @@ function canConsumeForm(consumes) { } return false; } -exports.canConsumeForm = canConsumeForm; class JSONApiResponse { constructor(raw, transformer = (jsonValue) => jsonValue) { this.raw = raw; diff --git a/typescript/package.json b/typescript/package.json index c96f503e..4e954f74 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@geoengine/openapi-client", - "version": "0.0.20", + "version": "0.0.21", "description": "OpenAPI client for @geoengine/openapi-client", "author": "OpenAPI-Generator", "repository": { @@ -16,6 +16,6 @@ "prepare": "npm run build" }, "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" } } diff --git a/typescript/src/apis/DatasetsApi.ts b/typescript/src/apis/DatasetsApi.ts index ae06ffdc..91d9cff6 100644 --- a/typescript/src/apis/DatasetsApi.ts +++ b/typescript/src/apis/DatasetsApi.ts @@ -131,8 +131,11 @@ export class DatasetsApi extends runtime.BaseAPI { * Creates a new dataset using previously uploaded files. */ async autoCreateDatasetHandlerRaw(requestParameters: AutoCreateDatasetHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.autoCreateDataset === null || requestParameters.autoCreateDataset === undefined) { - throw new runtime.RequiredError('autoCreateDataset','Required parameter requestParameters.autoCreateDataset was null or undefined when calling autoCreateDatasetHandler.'); + if (requestParameters['autoCreateDataset'] == null) { + throw new runtime.RequiredError( + 'autoCreateDataset', + 'Required parameter "autoCreateDataset" was null or undefined when calling autoCreateDatasetHandler().' + ); } const queryParameters: any = {}; @@ -154,7 +157,7 @@ export class DatasetsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: AutoCreateDatasetToJSON(requestParameters.autoCreateDataset), + body: AutoCreateDatasetToJSON(requestParameters['autoCreateDataset']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => CreateDatasetHandler200ResponseFromJSON(jsonValue)); @@ -174,8 +177,11 @@ export class DatasetsApi extends runtime.BaseAPI { * Creates a new dataset referencing files. */ async createDatasetHandlerRaw(requestParameters: CreateDatasetHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createDataset === null || requestParameters.createDataset === undefined) { - throw new runtime.RequiredError('createDataset','Required parameter requestParameters.createDataset was null or undefined when calling createDatasetHandler.'); + if (requestParameters['createDataset'] == null) { + throw new runtime.RequiredError( + 'createDataset', + 'Required parameter "createDataset" was null or undefined when calling createDatasetHandler().' + ); } const queryParameters: any = {}; @@ -197,7 +203,7 @@ export class DatasetsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: CreateDatasetToJSON(requestParameters.createDataset), + body: CreateDatasetToJSON(requestParameters['createDataset']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => CreateDatasetHandler200ResponseFromJSON(jsonValue)); @@ -216,8 +222,11 @@ export class DatasetsApi extends runtime.BaseAPI { * Delete a dataset */ async deleteDatasetHandlerRaw(requestParameters: DeleteDatasetHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset','Required parameter requestParameters.dataset was null or undefined when calling deleteDatasetHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError( + 'dataset', + 'Required parameter "dataset" was null or undefined when calling deleteDatasetHandler().' + ); } const queryParameters: any = {}; @@ -233,7 +242,7 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -253,8 +262,11 @@ export class DatasetsApi extends runtime.BaseAPI { * Retrieves details about a dataset using the internal name. */ async getDatasetHandlerRaw(requestParameters: GetDatasetHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset','Required parameter requestParameters.dataset was null or undefined when calling getDatasetHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError( + 'dataset', + 'Required parameter "dataset" was null or undefined when calling getDatasetHandler().' + ); } const queryParameters: any = {}; @@ -270,7 +282,7 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -291,8 +303,11 @@ export class DatasetsApi extends runtime.BaseAPI { * Retrieves the loading information of a dataset */ async getLoadingInfoHandlerRaw(requestParameters: GetLoadingInfoHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset','Required parameter requestParameters.dataset was null or undefined when calling getLoadingInfoHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError( + 'dataset', + 'Required parameter "dataset" was null or undefined when calling getLoadingInfoHandler().' + ); } const queryParameters: any = {}; @@ -308,7 +323,7 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -329,38 +344,47 @@ export class DatasetsApi extends runtime.BaseAPI { * Lists available datasets. */ async listDatasetsHandlerRaw(requestParameters: ListDatasetsHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters.order === null || requestParameters.order === undefined) { - throw new runtime.RequiredError('order','Required parameter requestParameters.order was null or undefined when calling listDatasetsHandler.'); + if (requestParameters['order'] == null) { + throw new runtime.RequiredError( + 'order', + 'Required parameter "order" was null or undefined when calling listDatasetsHandler().' + ); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset','Required parameter requestParameters.offset was null or undefined when calling listDatasetsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError( + 'offset', + 'Required parameter "offset" was null or undefined when calling listDatasetsHandler().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling listDatasetsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling listDatasetsHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.filter !== undefined) { - queryParameters['filter'] = requestParameters.filter; + if (requestParameters['filter'] != null) { + queryParameters['filter'] = requestParameters['filter']; } - if (requestParameters.order !== undefined) { - queryParameters['order'] = requestParameters.order; + if (requestParameters['order'] != null) { + queryParameters['order'] = requestParameters['order']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.tags) { - queryParameters['tags'] = requestParameters.tags; + if (requestParameters['tags'] != null) { + queryParameters['tags'] = requestParameters['tags']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -395,12 +419,18 @@ export class DatasetsApi extends runtime.BaseAPI { * List the layers of a file in a volume. */ async listVolumeFileLayersHandlerRaw(requestParameters: ListVolumeFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.volumeName === null || requestParameters.volumeName === undefined) { - throw new runtime.RequiredError('volumeName','Required parameter requestParameters.volumeName was null or undefined when calling listVolumeFileLayersHandler.'); + if (requestParameters['volumeName'] == null) { + throw new runtime.RequiredError( + 'volumeName', + 'Required parameter "volumeName" was null or undefined when calling listVolumeFileLayersHandler().' + ); } - if (requestParameters.fileName === null || requestParameters.fileName === undefined) { - throw new runtime.RequiredError('fileName','Required parameter requestParameters.fileName was null or undefined when calling listVolumeFileLayersHandler.'); + if (requestParameters['fileName'] == null) { + throw new runtime.RequiredError( + 'fileName', + 'Required parameter "fileName" was null or undefined when calling listVolumeFileLayersHandler().' + ); } const queryParameters: any = {}; @@ -416,7 +446,7 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/dataset/volumes/{volume_name}/files/{file_name}/layers`.replace(`{${"volume_name"}}`, encodeURIComponent(String(requestParameters.volumeName))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters.fileName))), + path: `/dataset/volumes/{volume_name}/files/{file_name}/layers`.replace(`{${"volume_name"}}`, encodeURIComponent(String(requestParameters['volumeName']))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters['fileName']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -472,8 +502,11 @@ export class DatasetsApi extends runtime.BaseAPI { * Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. */ async suggestMetaDataHandlerRaw(requestParameters: SuggestMetaDataHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.suggestMetaData === null || requestParameters.suggestMetaData === undefined) { - throw new runtime.RequiredError('suggestMetaData','Required parameter requestParameters.suggestMetaData was null or undefined when calling suggestMetaDataHandler.'); + if (requestParameters['suggestMetaData'] == null) { + throw new runtime.RequiredError( + 'suggestMetaData', + 'Required parameter "suggestMetaData" was null or undefined when calling suggestMetaDataHandler().' + ); } const queryParameters: any = {}; @@ -495,7 +528,7 @@ export class DatasetsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: SuggestMetaDataToJSON(requestParameters.suggestMetaData), + body: SuggestMetaDataToJSON(requestParameters['suggestMetaData']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => MetaDataSuggestionFromJSON(jsonValue)); @@ -514,12 +547,18 @@ export class DatasetsApi extends runtime.BaseAPI { * Update details about a dataset using the internal name. */ async updateDatasetHandlerRaw(requestParameters: UpdateDatasetHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset','Required parameter requestParameters.dataset was null or undefined when calling updateDatasetHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError( + 'dataset', + 'Required parameter "dataset" was null or undefined when calling updateDatasetHandler().' + ); } - if (requestParameters.updateDataset === null || requestParameters.updateDataset === undefined) { - throw new runtime.RequiredError('updateDataset','Required parameter requestParameters.updateDataset was null or undefined when calling updateDatasetHandler.'); + if (requestParameters['updateDataset'] == null) { + throw new runtime.RequiredError( + 'updateDataset', + 'Required parameter "updateDataset" was null or undefined when calling updateDatasetHandler().' + ); } const queryParameters: any = {}; @@ -537,11 +576,11 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: UpdateDatasetToJSON(requestParameters.updateDataset), + body: UpdateDatasetToJSON(requestParameters['updateDataset']), }, initOverrides); return new runtime.VoidApiResponse(response); @@ -557,12 +596,18 @@ export class DatasetsApi extends runtime.BaseAPI { /** */ async updateDatasetProvenanceHandlerRaw(requestParameters: UpdateDatasetProvenanceHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset','Required parameter requestParameters.dataset was null or undefined when calling updateDatasetProvenanceHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError( + 'dataset', + 'Required parameter "dataset" was null or undefined when calling updateDatasetProvenanceHandler().' + ); } - if (requestParameters.provenances === null || requestParameters.provenances === undefined) { - throw new runtime.RequiredError('provenances','Required parameter requestParameters.provenances was null or undefined when calling updateDatasetProvenanceHandler.'); + if (requestParameters['provenances'] == null) { + throw new runtime.RequiredError( + 'provenances', + 'Required parameter "provenances" was null or undefined when calling updateDatasetProvenanceHandler().' + ); } const queryParameters: any = {}; @@ -580,11 +625,11 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/dataset/{dataset}/provenance`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/provenance`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: ProvenancesToJSON(requestParameters.provenances), + body: ProvenancesToJSON(requestParameters['provenances']), }, initOverrides); return new runtime.VoidApiResponse(response); @@ -600,12 +645,18 @@ export class DatasetsApi extends runtime.BaseAPI { * Updates the dataset\'s symbology */ async updateDatasetSymbologyHandlerRaw(requestParameters: UpdateDatasetSymbologyHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset','Required parameter requestParameters.dataset was null or undefined when calling updateDatasetSymbologyHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError( + 'dataset', + 'Required parameter "dataset" was null or undefined when calling updateDatasetSymbologyHandler().' + ); } - if (requestParameters.symbology === null || requestParameters.symbology === undefined) { - throw new runtime.RequiredError('symbology','Required parameter requestParameters.symbology was null or undefined when calling updateDatasetSymbologyHandler.'); + if (requestParameters['symbology'] == null) { + throw new runtime.RequiredError( + 'symbology', + 'Required parameter "symbology" was null or undefined when calling updateDatasetSymbologyHandler().' + ); } const queryParameters: any = {}; @@ -623,11 +674,11 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: SymbologyToJSON(requestParameters.symbology), + body: SymbologyToJSON(requestParameters['symbology']), }, initOverrides); return new runtime.VoidApiResponse(response); @@ -644,12 +695,18 @@ export class DatasetsApi extends runtime.BaseAPI { * Updates the dataset\'s loading info */ async updateLoadingInfoHandlerRaw(requestParameters: UpdateLoadingInfoHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.dataset === null || requestParameters.dataset === undefined) { - throw new runtime.RequiredError('dataset','Required parameter requestParameters.dataset was null or undefined when calling updateLoadingInfoHandler.'); + if (requestParameters['dataset'] == null) { + throw new runtime.RequiredError( + 'dataset', + 'Required parameter "dataset" was null or undefined when calling updateLoadingInfoHandler().' + ); } - if (requestParameters.metaDataDefinition === null || requestParameters.metaDataDefinition === undefined) { - throw new runtime.RequiredError('metaDataDefinition','Required parameter requestParameters.metaDataDefinition was null or undefined when calling updateLoadingInfoHandler.'); + if (requestParameters['metaDataDefinition'] == null) { + throw new runtime.RequiredError( + 'metaDataDefinition', + 'Required parameter "metaDataDefinition" was null or undefined when calling updateLoadingInfoHandler().' + ); } const queryParameters: any = {}; @@ -667,11 +724,11 @@ export class DatasetsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + path: `/dataset/{dataset}/loadingInfo`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters['dataset']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: MetaDataDefinitionToJSON(requestParameters.metaDataDefinition), + body: MetaDataDefinitionToJSON(requestParameters['metaDataDefinition']), }, initOverrides); return new runtime.VoidApiResponse(response); diff --git a/typescript/src/apis/LayersApi.ts b/typescript/src/apis/LayersApi.ts index 13579b84..d83907aa 100644 --- a/typescript/src/apis/LayersApi.ts +++ b/typescript/src/apis/LayersApi.ts @@ -155,12 +155,18 @@ export class LayersApi extends runtime.BaseAPI { * Add a new collection to an existing collection */ async addCollectionRaw(requestParameters: AddCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection','Required parameter requestParameters.collection was null or undefined when calling addCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError( + 'collection', + 'Required parameter "collection" was null or undefined when calling addCollection().' + ); } - if (requestParameters.addLayerCollection === null || requestParameters.addLayerCollection === undefined) { - throw new runtime.RequiredError('addLayerCollection','Required parameter requestParameters.addLayerCollection was null or undefined when calling addCollection.'); + if (requestParameters['addLayerCollection'] == null) { + throw new runtime.RequiredError( + 'addLayerCollection', + 'Required parameter "addLayerCollection" was null or undefined when calling addCollection().' + ); } const queryParameters: any = {}; @@ -178,11 +184,11 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layerDb/collections/{collection}/collections`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}/collections`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: AddLayerCollectionToJSON(requestParameters.addLayerCollection), + body: AddLayerCollectionToJSON(requestParameters['addLayerCollection']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AddCollection200ResponseFromJSON(jsonValue)); @@ -200,12 +206,18 @@ export class LayersApi extends runtime.BaseAPI { * Add an existing collection to a collection */ async addExistingCollectionToCollectionRaw(requestParameters: AddExistingCollectionToCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.parent === null || requestParameters.parent === undefined) { - throw new runtime.RequiredError('parent','Required parameter requestParameters.parent was null or undefined when calling addExistingCollectionToCollection.'); + if (requestParameters['parent'] == null) { + throw new runtime.RequiredError( + 'parent', + 'Required parameter "parent" was null or undefined when calling addExistingCollectionToCollection().' + ); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection','Required parameter requestParameters.collection was null or undefined when calling addExistingCollectionToCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError( + 'collection', + 'Required parameter "collection" was null or undefined when calling addExistingCollectionToCollection().' + ); } const queryParameters: any = {}; @@ -221,7 +233,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters.parent))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters['parent']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -241,12 +253,18 @@ export class LayersApi extends runtime.BaseAPI { * Add an existing layer to a collection */ async addExistingLayerToCollectionRaw(requestParameters: AddExistingLayerToCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection','Required parameter requestParameters.collection was null or undefined when calling addExistingLayerToCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError( + 'collection', + 'Required parameter "collection" was null or undefined when calling addExistingLayerToCollection().' + ); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer','Required parameter requestParameters.layer was null or undefined when calling addExistingLayerToCollection.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError( + 'layer', + 'Required parameter "layer" was null or undefined when calling addExistingLayerToCollection().' + ); } const queryParameters: any = {}; @@ -262,7 +280,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -282,12 +300,18 @@ export class LayersApi extends runtime.BaseAPI { * Add a new layer to a collection */ async addLayerRaw(requestParameters: AddLayerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection','Required parameter requestParameters.collection was null or undefined when calling addLayer.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError( + 'collection', + 'Required parameter "collection" was null or undefined when calling addLayer().' + ); } - if (requestParameters.addLayer === null || requestParameters.addLayer === undefined) { - throw new runtime.RequiredError('addLayer','Required parameter requestParameters.addLayer was null or undefined when calling addLayer.'); + if (requestParameters['addLayer'] == null) { + throw new runtime.RequiredError( + 'addLayer', + 'Required parameter "addLayer" was null or undefined when calling addLayer().' + ); } const queryParameters: any = {}; @@ -305,11 +329,11 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layerDb/collections/{collection}/layers`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}/layers`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: AddLayerToJSON(requestParameters.addLayer), + body: AddLayerToJSON(requestParameters['addLayer']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AddCollection200ResponseFromJSON(jsonValue)); @@ -327,46 +351,64 @@ export class LayersApi extends runtime.BaseAPI { * Autocompletes the search on the contents of the collection of the given provider */ async autocompleteHandlerRaw(requestParameters: AutocompleteHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider','Required parameter requestParameters.provider was null or undefined when calling autocompleteHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError( + 'provider', + 'Required parameter "provider" was null or undefined when calling autocompleteHandler().' + ); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection','Required parameter requestParameters.collection was null or undefined when calling autocompleteHandler.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError( + 'collection', + 'Required parameter "collection" was null or undefined when calling autocompleteHandler().' + ); } - if (requestParameters.searchType === null || requestParameters.searchType === undefined) { - throw new runtime.RequiredError('searchType','Required parameter requestParameters.searchType was null or undefined when calling autocompleteHandler.'); + if (requestParameters['searchType'] == null) { + throw new runtime.RequiredError( + 'searchType', + 'Required parameter "searchType" was null or undefined when calling autocompleteHandler().' + ); } - if (requestParameters.searchString === null || requestParameters.searchString === undefined) { - throw new runtime.RequiredError('searchString','Required parameter requestParameters.searchString was null or undefined when calling autocompleteHandler.'); + if (requestParameters['searchString'] == null) { + throw new runtime.RequiredError( + 'searchString', + 'Required parameter "searchString" was null or undefined when calling autocompleteHandler().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling autocompleteHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling autocompleteHandler().' + ); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset','Required parameter requestParameters.offset was null or undefined when calling autocompleteHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError( + 'offset', + 'Required parameter "offset" was null or undefined when calling autocompleteHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.searchType !== undefined) { - queryParameters['searchType'] = requestParameters.searchType; + if (requestParameters['searchType'] != null) { + queryParameters['searchType'] = requestParameters['searchType']; } - if (requestParameters.searchString !== undefined) { - queryParameters['searchString'] = requestParameters.searchString; + if (requestParameters['searchString'] != null) { + queryParameters['searchString'] = requestParameters['searchString']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -380,7 +422,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layers/collections/search/autocomplete/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layers/collections/search/autocomplete/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -401,12 +443,18 @@ export class LayersApi extends runtime.BaseAPI { * Retrieves the layer of the given provider */ async layerHandlerRaw(requestParameters: LayerHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider','Required parameter requestParameters.provider was null or undefined when calling layerHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError( + 'provider', + 'Required parameter "provider" was null or undefined when calling layerHandler().' + ); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer','Required parameter requestParameters.layer was null or undefined when calling layerHandler.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError( + 'layer', + 'Required parameter "layer" was null or undefined when calling layerHandler().' + ); } const queryParameters: any = {}; @@ -422,7 +470,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layers/{provider}/{layer}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layers/{provider}/{layer}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -443,12 +491,18 @@ export class LayersApi extends runtime.BaseAPI { * Persist a raster layer from a provider as a dataset. */ async layerToDatasetRaw(requestParameters: LayerToDatasetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider','Required parameter requestParameters.provider was null or undefined when calling layerToDataset.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError( + 'provider', + 'Required parameter "provider" was null or undefined when calling layerToDataset().' + ); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer','Required parameter requestParameters.layer was null or undefined when calling layerToDataset.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError( + 'layer', + 'Required parameter "layer" was null or undefined when calling layerToDataset().' + ); } const queryParameters: any = {}; @@ -464,7 +518,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layers/{provider}/{layer}/dataset`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layers/{provider}/{layer}/dataset`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -485,12 +539,18 @@ export class LayersApi extends runtime.BaseAPI { * Registers a layer from a provider as a workflow and returns the workflow id */ async layerToWorkflowIdHandlerRaw(requestParameters: LayerToWorkflowIdHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider','Required parameter requestParameters.provider was null or undefined when calling layerToWorkflowIdHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError( + 'provider', + 'Required parameter "provider" was null or undefined when calling layerToWorkflowIdHandler().' + ); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer','Required parameter requestParameters.layer was null or undefined when calling layerToWorkflowIdHandler.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError( + 'layer', + 'Required parameter "layer" was null or undefined when calling layerToWorkflowIdHandler().' + ); } const queryParameters: any = {}; @@ -506,7 +566,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layers/{provider}/{layer}/workflowId`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layers/{provider}/{layer}/workflowId`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -527,30 +587,42 @@ export class LayersApi extends runtime.BaseAPI { * List the contents of the collection of the given provider */ async listCollectionHandlerRaw(requestParameters: ListCollectionHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider','Required parameter requestParameters.provider was null or undefined when calling listCollectionHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError( + 'provider', + 'Required parameter "provider" was null or undefined when calling listCollectionHandler().' + ); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection','Required parameter requestParameters.collection was null or undefined when calling listCollectionHandler.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError( + 'collection', + 'Required parameter "collection" was null or undefined when calling listCollectionHandler().' + ); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset','Required parameter requestParameters.offset was null or undefined when calling listCollectionHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError( + 'offset', + 'Required parameter "offset" was null or undefined when calling listCollectionHandler().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling listCollectionHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling listCollectionHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -564,7 +636,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layers/collections/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layers/collections/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -585,22 +657,28 @@ export class LayersApi extends runtime.BaseAPI { * List all layer collections */ async listRootCollectionsHandlerRaw(requestParameters: ListRootCollectionsHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset','Required parameter requestParameters.offset was null or undefined when calling listRootCollectionsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError( + 'offset', + 'Required parameter "offset" was null or undefined when calling listRootCollectionsHandler().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling listRootCollectionsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling listRootCollectionsHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -634,8 +712,11 @@ export class LayersApi extends runtime.BaseAPI { /** */ async providerCapabilitiesHandlerRaw(requestParameters: ProviderCapabilitiesHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider','Required parameter requestParameters.provider was null or undefined when calling providerCapabilitiesHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError( + 'provider', + 'Required parameter "provider" was null or undefined when calling providerCapabilitiesHandler().' + ); } const queryParameters: any = {}; @@ -651,7 +732,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layers/{provider}/capabilities`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))), + path: `/layers/{provider}/capabilities`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -671,8 +752,11 @@ export class LayersApi extends runtime.BaseAPI { * Remove a collection */ async removeCollectionRaw(requestParameters: RemoveCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection','Required parameter requestParameters.collection was null or undefined when calling removeCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError( + 'collection', + 'Required parameter "collection" was null or undefined when calling removeCollection().' + ); } const queryParameters: any = {}; @@ -688,7 +772,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -708,12 +792,18 @@ export class LayersApi extends runtime.BaseAPI { * Delete a collection from a collection */ async removeCollectionFromCollectionRaw(requestParameters: RemoveCollectionFromCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.parent === null || requestParameters.parent === undefined) { - throw new runtime.RequiredError('parent','Required parameter requestParameters.parent was null or undefined when calling removeCollectionFromCollection.'); + if (requestParameters['parent'] == null) { + throw new runtime.RequiredError( + 'parent', + 'Required parameter "parent" was null or undefined when calling removeCollectionFromCollection().' + ); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection','Required parameter requestParameters.collection was null or undefined when calling removeCollectionFromCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError( + 'collection', + 'Required parameter "collection" was null or undefined when calling removeCollectionFromCollection().' + ); } const queryParameters: any = {}; @@ -729,7 +819,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters.parent))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{parent}/collections/{collection}`.replace(`{${"parent"}}`, encodeURIComponent(String(requestParameters['parent']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -749,8 +839,11 @@ export class LayersApi extends runtime.BaseAPI { * Remove a collection */ async removeLayerRaw(requestParameters: RemoveLayerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer','Required parameter requestParameters.layer was null or undefined when calling removeLayer.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError( + 'layer', + 'Required parameter "layer" was null or undefined when calling removeLayer().' + ); } const queryParameters: any = {}; @@ -766,7 +859,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -786,12 +879,18 @@ export class LayersApi extends runtime.BaseAPI { * Remove a layer from a collection */ async removeLayerFromCollectionRaw(requestParameters: RemoveLayerFromCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection','Required parameter requestParameters.collection was null or undefined when calling removeLayerFromCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError( + 'collection', + 'Required parameter "collection" was null or undefined when calling removeLayerFromCollection().' + ); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer','Required parameter requestParameters.layer was null or undefined when calling removeLayerFromCollection.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError( + 'layer', + 'Required parameter "layer" was null or undefined when calling removeLayerFromCollection().' + ); } const queryParameters: any = {}; @@ -807,7 +906,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/collections/{collection}/layers/{layer}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -827,46 +926,64 @@ export class LayersApi extends runtime.BaseAPI { * Searches the contents of the collection of the given provider */ async searchHandlerRaw(requestParameters: SearchHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.provider === null || requestParameters.provider === undefined) { - throw new runtime.RequiredError('provider','Required parameter requestParameters.provider was null or undefined when calling searchHandler.'); + if (requestParameters['provider'] == null) { + throw new runtime.RequiredError( + 'provider', + 'Required parameter "provider" was null or undefined when calling searchHandler().' + ); } - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection','Required parameter requestParameters.collection was null or undefined when calling searchHandler.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError( + 'collection', + 'Required parameter "collection" was null or undefined when calling searchHandler().' + ); } - if (requestParameters.searchType === null || requestParameters.searchType === undefined) { - throw new runtime.RequiredError('searchType','Required parameter requestParameters.searchType was null or undefined when calling searchHandler.'); + if (requestParameters['searchType'] == null) { + throw new runtime.RequiredError( + 'searchType', + 'Required parameter "searchType" was null or undefined when calling searchHandler().' + ); } - if (requestParameters.searchString === null || requestParameters.searchString === undefined) { - throw new runtime.RequiredError('searchString','Required parameter requestParameters.searchString was null or undefined when calling searchHandler.'); + if (requestParameters['searchString'] == null) { + throw new runtime.RequiredError( + 'searchString', + 'Required parameter "searchString" was null or undefined when calling searchHandler().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling searchHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling searchHandler().' + ); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset','Required parameter requestParameters.offset was null or undefined when calling searchHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError( + 'offset', + 'Required parameter "offset" was null or undefined when calling searchHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.searchType !== undefined) { - queryParameters['searchType'] = requestParameters.searchType; + if (requestParameters['searchType'] != null) { + queryParameters['searchType'] = requestParameters['searchType']; } - if (requestParameters.searchString !== undefined) { - queryParameters['searchString'] = requestParameters.searchString; + if (requestParameters['searchString'] != null) { + queryParameters['searchString'] = requestParameters['searchString']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -880,7 +997,7 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layers/collections/search/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters.provider))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layers/collections/search/{provider}/{collection}`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))).replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -901,12 +1018,18 @@ export class LayersApi extends runtime.BaseAPI { * Update a collection */ async updateCollectionRaw(requestParameters: UpdateCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.collection === null || requestParameters.collection === undefined) { - throw new runtime.RequiredError('collection','Required parameter requestParameters.collection was null or undefined when calling updateCollection.'); + if (requestParameters['collection'] == null) { + throw new runtime.RequiredError( + 'collection', + 'Required parameter "collection" was null or undefined when calling updateCollection().' + ); } - if (requestParameters.updateLayerCollection === null || requestParameters.updateLayerCollection === undefined) { - throw new runtime.RequiredError('updateLayerCollection','Required parameter requestParameters.updateLayerCollection was null or undefined when calling updateCollection.'); + if (requestParameters['updateLayerCollection'] == null) { + throw new runtime.RequiredError( + 'updateLayerCollection', + 'Required parameter "updateLayerCollection" was null or undefined when calling updateCollection().' + ); } const queryParameters: any = {}; @@ -924,11 +1047,11 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters.collection))), + path: `/layerDb/collections/{collection}`.replace(`{${"collection"}}`, encodeURIComponent(String(requestParameters['collection']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: UpdateLayerCollectionToJSON(requestParameters.updateLayerCollection), + body: UpdateLayerCollectionToJSON(requestParameters['updateLayerCollection']), }, initOverrides); return new runtime.VoidApiResponse(response); @@ -945,12 +1068,18 @@ export class LayersApi extends runtime.BaseAPI { * Update a layer */ async updateLayerRaw(requestParameters: UpdateLayerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer','Required parameter requestParameters.layer was null or undefined when calling updateLayer.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError( + 'layer', + 'Required parameter "layer" was null or undefined when calling updateLayer().' + ); } - if (requestParameters.updateLayer === null || requestParameters.updateLayer === undefined) { - throw new runtime.RequiredError('updateLayer','Required parameter requestParameters.updateLayer was null or undefined when calling updateLayer.'); + if (requestParameters['updateLayer'] == null) { + throw new runtime.RequiredError( + 'updateLayer', + 'Required parameter "updateLayer" was null or undefined when calling updateLayer().' + ); } const queryParameters: any = {}; @@ -968,11 +1097,11 @@ export class LayersApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/layerDb/layers/{layer}`.replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'PUT', headers: headerParameters, query: queryParameters, - body: UpdateLayerToJSON(requestParameters.updateLayer), + body: UpdateLayerToJSON(requestParameters['updateLayer']), }, initOverrides); return new runtime.VoidApiResponse(response); diff --git a/typescript/src/apis/MLApi.ts b/typescript/src/apis/MLApi.ts index 6b69161d..c729a395 100644 --- a/typescript/src/apis/MLApi.ts +++ b/typescript/src/apis/MLApi.ts @@ -42,8 +42,11 @@ export class MLApi extends runtime.BaseAPI { * Create a new ml model. */ async addMlModelRaw(requestParameters: AddMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.mlModel === null || requestParameters.mlModel === undefined) { - throw new runtime.RequiredError('mlModel','Required parameter requestParameters.mlModel was null or undefined when calling addMlModel.'); + if (requestParameters['mlModel'] == null) { + throw new runtime.RequiredError( + 'mlModel', + 'Required parameter "mlModel" was null or undefined when calling addMlModel().' + ); } const queryParameters: any = {}; @@ -65,7 +68,7 @@ export class MLApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: MlModelToJSON(requestParameters.mlModel), + body: MlModelToJSON(requestParameters['mlModel']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => MlModelNameResponseFromJSON(jsonValue)); @@ -83,8 +86,11 @@ export class MLApi extends runtime.BaseAPI { * Get ml model by name. */ async getMlModelRaw(requestParameters: GetMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.modelName === null || requestParameters.modelName === undefined) { - throw new runtime.RequiredError('modelName','Required parameter requestParameters.modelName was null or undefined when calling getMlModel.'); + if (requestParameters['modelName'] == null) { + throw new runtime.RequiredError( + 'modelName', + 'Required parameter "modelName" was null or undefined when calling getMlModel().' + ); } const queryParameters: any = {}; @@ -100,7 +106,7 @@ export class MLApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/ml/models/{model_name}`.replace(`{${"model_name"}}`, encodeURIComponent(String(requestParameters.modelName))), + path: `/ml/models/{model_name}`.replace(`{${"model_name"}}`, encodeURIComponent(String(requestParameters['modelName']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/src/apis/OGCWCSApi.ts b/typescript/src/apis/OGCWCSApi.ts index 04b5eec0..375cf9e0 100644 --- a/typescript/src/apis/OGCWCSApi.ts +++ b/typescript/src/apis/OGCWCSApi.ts @@ -78,30 +78,39 @@ export class OGCWCSApi extends runtime.BaseAPI { * Get WCS Capabilities */ async wcsCapabilitiesHandlerRaw(requestParameters: WcsCapabilitiesHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow','Required parameter requestParameters.workflow was null or undefined when calling wcsCapabilitiesHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError( + 'workflow', + 'Required parameter "workflow" was null or undefined when calling wcsCapabilitiesHandler().' + ); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service','Required parameter requestParameters.service was null or undefined when calling wcsCapabilitiesHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError( + 'service', + 'Required parameter "service" was null or undefined when calling wcsCapabilitiesHandler().' + ); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request','Required parameter requestParameters.request was null or undefined when calling wcsCapabilitiesHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError( + 'request', + 'Required parameter "request" was null or undefined when calling wcsCapabilitiesHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -115,7 +124,7 @@ export class OGCWCSApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/wcs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wcs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -140,42 +149,57 @@ export class OGCWCSApi extends runtime.BaseAPI { * Get WCS Coverage Description */ async wcsDescribeCoverageHandlerRaw(requestParameters: WcsDescribeCoverageHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow','Required parameter requestParameters.workflow was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError( + 'workflow', + 'Required parameter "workflow" was null or undefined when calling wcsDescribeCoverageHandler().' + ); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version','Required parameter requestParameters.version was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError( + 'version', + 'Required parameter "version" was null or undefined when calling wcsDescribeCoverageHandler().' + ); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service','Required parameter requestParameters.service was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError( + 'service', + 'Required parameter "service" was null or undefined when calling wcsDescribeCoverageHandler().' + ); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request','Required parameter requestParameters.request was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError( + 'request', + 'Required parameter "request" was null or undefined when calling wcsDescribeCoverageHandler().' + ); } - if (requestParameters.identifiers === null || requestParameters.identifiers === undefined) { - throw new runtime.RequiredError('identifiers','Required parameter requestParameters.identifiers was null or undefined when calling wcsDescribeCoverageHandler.'); + if (requestParameters['identifiers'] == null) { + throw new runtime.RequiredError( + 'identifiers', + 'Required parameter "identifiers" was null or undefined when calling wcsDescribeCoverageHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.identifiers !== undefined) { - queryParameters['identifiers'] = requestParameters.identifiers; + if (requestParameters['identifiers'] != null) { + queryParameters['identifiers'] = requestParameters['identifiers']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -189,7 +213,7 @@ export class OGCWCSApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/wcs/{workflow}?request=DescribeCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wcs/{workflow}?request=DescribeCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -214,90 +238,114 @@ export class OGCWCSApi extends runtime.BaseAPI { * Get WCS Coverage */ async wcsGetCoverageHandlerRaw(requestParameters: WcsGetCoverageHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow','Required parameter requestParameters.workflow was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError( + 'workflow', + 'Required parameter "workflow" was null or undefined when calling wcsGetCoverageHandler().' + ); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version','Required parameter requestParameters.version was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError( + 'version', + 'Required parameter "version" was null or undefined when calling wcsGetCoverageHandler().' + ); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service','Required parameter requestParameters.service was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError( + 'service', + 'Required parameter "service" was null or undefined when calling wcsGetCoverageHandler().' + ); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request','Required parameter requestParameters.request was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError( + 'request', + 'Required parameter "request" was null or undefined when calling wcsGetCoverageHandler().' + ); } - if (requestParameters.format === null || requestParameters.format === undefined) { - throw new runtime.RequiredError('format','Required parameter requestParameters.format was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['format'] == null) { + throw new runtime.RequiredError( + 'format', + 'Required parameter "format" was null or undefined when calling wcsGetCoverageHandler().' + ); } - if (requestParameters.identifier === null || requestParameters.identifier === undefined) { - throw new runtime.RequiredError('identifier','Required parameter requestParameters.identifier was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['identifier'] == null) { + throw new runtime.RequiredError( + 'identifier', + 'Required parameter "identifier" was null or undefined when calling wcsGetCoverageHandler().' + ); } - if (requestParameters.boundingbox === null || requestParameters.boundingbox === undefined) { - throw new runtime.RequiredError('boundingbox','Required parameter requestParameters.boundingbox was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['boundingbox'] == null) { + throw new runtime.RequiredError( + 'boundingbox', + 'Required parameter "boundingbox" was null or undefined when calling wcsGetCoverageHandler().' + ); } - if (requestParameters.gridbasecrs === null || requestParameters.gridbasecrs === undefined) { - throw new runtime.RequiredError('gridbasecrs','Required parameter requestParameters.gridbasecrs was null or undefined when calling wcsGetCoverageHandler.'); + if (requestParameters['gridbasecrs'] == null) { + throw new runtime.RequiredError( + 'gridbasecrs', + 'Required parameter "gridbasecrs" was null or undefined when calling wcsGetCoverageHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.format !== undefined) { - queryParameters['format'] = requestParameters.format; + if (requestParameters['format'] != null) { + queryParameters['format'] = requestParameters['format']; } - if (requestParameters.identifier !== undefined) { - queryParameters['identifier'] = requestParameters.identifier; + if (requestParameters['identifier'] != null) { + queryParameters['identifier'] = requestParameters['identifier']; } - if (requestParameters.boundingbox !== undefined) { - queryParameters['boundingbox'] = requestParameters.boundingbox; + if (requestParameters['boundingbox'] != null) { + queryParameters['boundingbox'] = requestParameters['boundingbox']; } - if (requestParameters.gridbasecrs !== undefined) { - queryParameters['gridbasecrs'] = requestParameters.gridbasecrs; + if (requestParameters['gridbasecrs'] != null) { + queryParameters['gridbasecrs'] = requestParameters['gridbasecrs']; } - if (requestParameters.gridorigin !== undefined) { - queryParameters['gridorigin'] = requestParameters.gridorigin; + if (requestParameters['gridorigin'] != null) { + queryParameters['gridorigin'] = requestParameters['gridorigin']; } - if (requestParameters.gridoffsets !== undefined) { - queryParameters['gridoffsets'] = requestParameters.gridoffsets; + if (requestParameters['gridoffsets'] != null) { + queryParameters['gridoffsets'] = requestParameters['gridoffsets']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.resx !== undefined) { - queryParameters['resx'] = requestParameters.resx; + if (requestParameters['resx'] != null) { + queryParameters['resx'] = requestParameters['resx']; } - if (requestParameters.resy !== undefined) { - queryParameters['resy'] = requestParameters.resy; + if (requestParameters['resy'] != null) { + queryParameters['resy'] = requestParameters['resy']; } - if (requestParameters.nodatavalue !== undefined) { - queryParameters['nodatavalue'] = requestParameters.nodatavalue; + if (requestParameters['nodatavalue'] != null) { + queryParameters['nodatavalue'] = requestParameters['nodatavalue']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -311,7 +359,7 @@ export class OGCWCSApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/wcs/{workflow}?request=GetCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wcs/{workflow}?request=GetCoverage`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/src/apis/OGCWFSApi.ts b/typescript/src/apis/OGCWFSApi.ts index e950dca8..88e36f56 100644 --- a/typescript/src/apis/OGCWFSApi.ts +++ b/typescript/src/apis/OGCWFSApi.ts @@ -68,20 +68,32 @@ export class OGCWFSApi extends runtime.BaseAPI { * Get WFS Capabilities */ async wfsCapabilitiesHandlerRaw(requestParameters: WfsCapabilitiesHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow','Required parameter requestParameters.workflow was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError( + 'workflow', + 'Required parameter "workflow" was null or undefined when calling wfsCapabilitiesHandler().' + ); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version','Required parameter requestParameters.version was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError( + 'version', + 'Required parameter "version" was null or undefined when calling wfsCapabilitiesHandler().' + ); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service','Required parameter requestParameters.service was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError( + 'service', + 'Required parameter "service" was null or undefined when calling wfsCapabilitiesHandler().' + ); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request','Required parameter requestParameters.request was null or undefined when calling wfsCapabilitiesHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError( + 'request', + 'Required parameter "request" was null or undefined when calling wfsCapabilitiesHandler().' + ); } const queryParameters: any = {}; @@ -97,7 +109,7 @@ export class OGCWFSApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))), + path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters['service']))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters['request']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -122,82 +134,97 @@ export class OGCWFSApi extends runtime.BaseAPI { * Get WCS Features */ async wfsFeatureHandlerRaw(requestParameters: WfsFeatureHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow','Required parameter requestParameters.workflow was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError( + 'workflow', + 'Required parameter "workflow" was null or undefined when calling wfsFeatureHandler().' + ); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service','Required parameter requestParameters.service was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError( + 'service', + 'Required parameter "service" was null or undefined when calling wfsFeatureHandler().' + ); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request','Required parameter requestParameters.request was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError( + 'request', + 'Required parameter "request" was null or undefined when calling wfsFeatureHandler().' + ); } - if (requestParameters.typeNames === null || requestParameters.typeNames === undefined) { - throw new runtime.RequiredError('typeNames','Required parameter requestParameters.typeNames was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['typeNames'] == null) { + throw new runtime.RequiredError( + 'typeNames', + 'Required parameter "typeNames" was null or undefined when calling wfsFeatureHandler().' + ); } - if (requestParameters.bbox === null || requestParameters.bbox === undefined) { - throw new runtime.RequiredError('bbox','Required parameter requestParameters.bbox was null or undefined when calling wfsFeatureHandler.'); + if (requestParameters['bbox'] == null) { + throw new runtime.RequiredError( + 'bbox', + 'Required parameter "bbox" was null or undefined when calling wfsFeatureHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.typeNames !== undefined) { - queryParameters['typeNames'] = requestParameters.typeNames; + if (requestParameters['typeNames'] != null) { + queryParameters['typeNames'] = requestParameters['typeNames']; } - if (requestParameters.bbox !== undefined) { - queryParameters['bbox'] = requestParameters.bbox; + if (requestParameters['bbox'] != null) { + queryParameters['bbox'] = requestParameters['bbox']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.srsName !== undefined) { - queryParameters['srsName'] = requestParameters.srsName; + if (requestParameters['srsName'] != null) { + queryParameters['srsName'] = requestParameters['srsName']; } - if (requestParameters.namespaces !== undefined) { - queryParameters['namespaces'] = requestParameters.namespaces; + if (requestParameters['namespaces'] != null) { + queryParameters['namespaces'] = requestParameters['namespaces']; } - if (requestParameters.count !== undefined) { - queryParameters['count'] = requestParameters.count; + if (requestParameters['count'] != null) { + queryParameters['count'] = requestParameters['count']; } - if (requestParameters.sortBy !== undefined) { - queryParameters['sortBy'] = requestParameters.sortBy; + if (requestParameters['sortBy'] != null) { + queryParameters['sortBy'] = requestParameters['sortBy']; } - if (requestParameters.resultType !== undefined) { - queryParameters['resultType'] = requestParameters.resultType; + if (requestParameters['resultType'] != null) { + queryParameters['resultType'] = requestParameters['resultType']; } - if (requestParameters.filter !== undefined) { - queryParameters['filter'] = requestParameters.filter; + if (requestParameters['filter'] != null) { + queryParameters['filter'] = requestParameters['filter']; } - if (requestParameters.propertyName !== undefined) { - queryParameters['propertyName'] = requestParameters.propertyName; + if (requestParameters['propertyName'] != null) { + queryParameters['propertyName'] = requestParameters['propertyName']; } - if (requestParameters.queryResolution !== undefined) { - queryParameters['queryResolution'] = requestParameters.queryResolution; + if (requestParameters['queryResolution'] != null) { + queryParameters['queryResolution'] = requestParameters['queryResolution']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -211,7 +238,7 @@ export class OGCWFSApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/wfs/{workflow}?request=GetFeature`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wfs/{workflow}?request=GetFeature`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/src/apis/OGCWMSApi.ts b/typescript/src/apis/OGCWMSApi.ts index 54d30352..327c2ab4 100644 --- a/typescript/src/apis/OGCWMSApi.ts +++ b/typescript/src/apis/OGCWMSApi.ts @@ -89,24 +89,39 @@ export class OGCWMSApi extends runtime.BaseAPI { * Get WMS Capabilities */ async wmsCapabilitiesHandlerRaw(requestParameters: WmsCapabilitiesHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow','Required parameter requestParameters.workflow was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError( + 'workflow', + 'Required parameter "workflow" was null or undefined when calling wmsCapabilitiesHandler().' + ); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version','Required parameter requestParameters.version was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError( + 'version', + 'Required parameter "version" was null or undefined when calling wmsCapabilitiesHandler().' + ); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service','Required parameter requestParameters.service was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError( + 'service', + 'Required parameter "service" was null or undefined when calling wmsCapabilitiesHandler().' + ); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request','Required parameter requestParameters.request was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError( + 'request', + 'Required parameter "request" was null or undefined when calling wmsCapabilitiesHandler().' + ); } - if (requestParameters.format === null || requestParameters.format === undefined) { - throw new runtime.RequiredError('format','Required parameter requestParameters.format was null or undefined when calling wmsCapabilitiesHandler.'); + if (requestParameters['format'] == null) { + throw new runtime.RequiredError( + 'format', + 'Required parameter "format" was null or undefined when calling wmsCapabilitiesHandler().' + ); } const queryParameters: any = {}; @@ -122,7 +137,7 @@ export class OGCWMSApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"format"}}`, encodeURIComponent(String(requestParameters.format))), + path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters['service']))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters['request']))).replace(`{${"format"}}`, encodeURIComponent(String(requestParameters['format']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -147,24 +162,39 @@ export class OGCWMSApi extends runtime.BaseAPI { * Get WMS Legend Graphic */ async wmsLegendGraphicHandlerRaw(requestParameters: WmsLegendGraphicHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow','Required parameter requestParameters.workflow was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError( + 'workflow', + 'Required parameter "workflow" was null or undefined when calling wmsLegendGraphicHandler().' + ); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version','Required parameter requestParameters.version was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError( + 'version', + 'Required parameter "version" was null or undefined when calling wmsLegendGraphicHandler().' + ); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service','Required parameter requestParameters.service was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError( + 'service', + 'Required parameter "service" was null or undefined when calling wmsLegendGraphicHandler().' + ); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request','Required parameter requestParameters.request was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError( + 'request', + 'Required parameter "request" was null or undefined when calling wmsLegendGraphicHandler().' + ); } - if (requestParameters.layer === null || requestParameters.layer === undefined) { - throw new runtime.RequiredError('layer','Required parameter requestParameters.layer was null or undefined when calling wmsLegendGraphicHandler.'); + if (requestParameters['layer'] == null) { + throw new runtime.RequiredError( + 'layer', + 'Required parameter "layer" was null or undefined when calling wmsLegendGraphicHandler().' + ); } const queryParameters: any = {}; @@ -180,7 +210,7 @@ export class OGCWMSApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), + path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters['service']))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters['request']))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters['layer']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -200,114 +230,144 @@ export class OGCWMSApi extends runtime.BaseAPI { * Get WMS Map */ async wmsMapHandlerRaw(requestParameters: WmsMapHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow','Required parameter requestParameters.workflow was null or undefined when calling wmsMapHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError( + 'workflow', + 'Required parameter "workflow" was null or undefined when calling wmsMapHandler().' + ); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version','Required parameter requestParameters.version was null or undefined when calling wmsMapHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError( + 'version', + 'Required parameter "version" was null or undefined when calling wmsMapHandler().' + ); } - if (requestParameters.service === null || requestParameters.service === undefined) { - throw new runtime.RequiredError('service','Required parameter requestParameters.service was null or undefined when calling wmsMapHandler.'); + if (requestParameters['service'] == null) { + throw new runtime.RequiredError( + 'service', + 'Required parameter "service" was null or undefined when calling wmsMapHandler().' + ); } - if (requestParameters.request === null || requestParameters.request === undefined) { - throw new runtime.RequiredError('request','Required parameter requestParameters.request was null or undefined when calling wmsMapHandler.'); + if (requestParameters['request'] == null) { + throw new runtime.RequiredError( + 'request', + 'Required parameter "request" was null or undefined when calling wmsMapHandler().' + ); } - if (requestParameters.width === null || requestParameters.width === undefined) { - throw new runtime.RequiredError('width','Required parameter requestParameters.width was null or undefined when calling wmsMapHandler.'); + if (requestParameters['width'] == null) { + throw new runtime.RequiredError( + 'width', + 'Required parameter "width" was null or undefined when calling wmsMapHandler().' + ); } - if (requestParameters.height === null || requestParameters.height === undefined) { - throw new runtime.RequiredError('height','Required parameter requestParameters.height was null or undefined when calling wmsMapHandler.'); + if (requestParameters['height'] == null) { + throw new runtime.RequiredError( + 'height', + 'Required parameter "height" was null or undefined when calling wmsMapHandler().' + ); } - if (requestParameters.bbox === null || requestParameters.bbox === undefined) { - throw new runtime.RequiredError('bbox','Required parameter requestParameters.bbox was null or undefined when calling wmsMapHandler.'); + if (requestParameters['bbox'] == null) { + throw new runtime.RequiredError( + 'bbox', + 'Required parameter "bbox" was null or undefined when calling wmsMapHandler().' + ); } - if (requestParameters.format === null || requestParameters.format === undefined) { - throw new runtime.RequiredError('format','Required parameter requestParameters.format was null or undefined when calling wmsMapHandler.'); + if (requestParameters['format'] == null) { + throw new runtime.RequiredError( + 'format', + 'Required parameter "format" was null or undefined when calling wmsMapHandler().' + ); } - if (requestParameters.layers === null || requestParameters.layers === undefined) { - throw new runtime.RequiredError('layers','Required parameter requestParameters.layers was null or undefined when calling wmsMapHandler.'); + if (requestParameters['layers'] == null) { + throw new runtime.RequiredError( + 'layers', + 'Required parameter "layers" was null or undefined when calling wmsMapHandler().' + ); } - if (requestParameters.styles === null || requestParameters.styles === undefined) { - throw new runtime.RequiredError('styles','Required parameter requestParameters.styles was null or undefined when calling wmsMapHandler.'); + if (requestParameters['styles'] == null) { + throw new runtime.RequiredError( + 'styles', + 'Required parameter "styles" was null or undefined when calling wmsMapHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; + if (requestParameters['version'] != null) { + queryParameters['version'] = requestParameters['version']; } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; + if (requestParameters['service'] != null) { + queryParameters['service'] = requestParameters['service']; } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters['request'] != null) { + queryParameters['request'] = requestParameters['request']; } - if (requestParameters.width !== undefined) { - queryParameters['width'] = requestParameters.width; + if (requestParameters['width'] != null) { + queryParameters['width'] = requestParameters['width']; } - if (requestParameters.height !== undefined) { - queryParameters['height'] = requestParameters.height; + if (requestParameters['height'] != null) { + queryParameters['height'] = requestParameters['height']; } - if (requestParameters.bbox !== undefined) { - queryParameters['bbox'] = requestParameters.bbox; + if (requestParameters['bbox'] != null) { + queryParameters['bbox'] = requestParameters['bbox']; } - if (requestParameters.format !== undefined) { - queryParameters['format'] = requestParameters.format; + if (requestParameters['format'] != null) { + queryParameters['format'] = requestParameters['format']; } - if (requestParameters.layers !== undefined) { - queryParameters['layers'] = requestParameters.layers; + if (requestParameters['layers'] != null) { + queryParameters['layers'] = requestParameters['layers']; } - if (requestParameters.crs !== undefined) { - queryParameters['crs'] = requestParameters.crs; + if (requestParameters['crs'] != null) { + queryParameters['crs'] = requestParameters['crs']; } - if (requestParameters.styles !== undefined) { - queryParameters['styles'] = requestParameters.styles; + if (requestParameters['styles'] != null) { + queryParameters['styles'] = requestParameters['styles']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.transparent !== undefined) { - queryParameters['transparent'] = requestParameters.transparent; + if (requestParameters['transparent'] != null) { + queryParameters['transparent'] = requestParameters['transparent']; } - if (requestParameters.bgcolor !== undefined) { - queryParameters['bgcolor'] = requestParameters.bgcolor; + if (requestParameters['bgcolor'] != null) { + queryParameters['bgcolor'] = requestParameters['bgcolor']; } - if (requestParameters.sld !== undefined) { - queryParameters['sld'] = requestParameters.sld; + if (requestParameters['sld'] != null) { + queryParameters['sld'] = requestParameters['sld']; } - if (requestParameters.sldBody !== undefined) { - queryParameters['sld_body'] = requestParameters.sldBody; + if (requestParameters['sldBody'] != null) { + queryParameters['sld_body'] = requestParameters['sldBody']; } - if (requestParameters.elevation !== undefined) { - queryParameters['elevation'] = requestParameters.elevation; + if (requestParameters['elevation'] != null) { + queryParameters['elevation'] = requestParameters['elevation']; } - if (requestParameters.exceptions !== undefined) { - queryParameters['exceptions'] = requestParameters.exceptions; + if (requestParameters['exceptions'] != null) { + queryParameters['exceptions'] = requestParameters['exceptions']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -321,7 +381,7 @@ export class OGCWMSApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/wms/{workflow}?request=GetMap`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wms/{workflow}?request=GetMap`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters['workflow']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/src/apis/PermissionsApi.ts b/typescript/src/apis/PermissionsApi.ts index 1b561d23..6ec647fc 100644 --- a/typescript/src/apis/PermissionsApi.ts +++ b/typescript/src/apis/PermissionsApi.ts @@ -49,8 +49,11 @@ export class PermissionsApi extends runtime.BaseAPI { * Adds a new permission. */ async addPermissionHandlerRaw(requestParameters: AddPermissionHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.permissionRequest === null || requestParameters.permissionRequest === undefined) { - throw new runtime.RequiredError('permissionRequest','Required parameter requestParameters.permissionRequest was null or undefined when calling addPermissionHandler.'); + if (requestParameters['permissionRequest'] == null) { + throw new runtime.RequiredError( + 'permissionRequest', + 'Required parameter "permissionRequest" was null or undefined when calling addPermissionHandler().' + ); } const queryParameters: any = {}; @@ -72,7 +75,7 @@ export class PermissionsApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: PermissionRequestToJSON(requestParameters.permissionRequest), + body: PermissionRequestToJSON(requestParameters['permissionRequest']), }, initOverrides); return new runtime.VoidApiResponse(response); @@ -89,30 +92,42 @@ export class PermissionsApi extends runtime.BaseAPI { * Lists permission for a given resource. */ async getResourcePermissionsHandlerRaw(requestParameters: GetResourcePermissionsHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters.resourceType === null || requestParameters.resourceType === undefined) { - throw new runtime.RequiredError('resourceType','Required parameter requestParameters.resourceType was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['resourceType'] == null) { + throw new runtime.RequiredError( + 'resourceType', + 'Required parameter "resourceType" was null or undefined when calling getResourcePermissionsHandler().' + ); } - if (requestParameters.resourceId === null || requestParameters.resourceId === undefined) { - throw new runtime.RequiredError('resourceId','Required parameter requestParameters.resourceId was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['resourceId'] == null) { + throw new runtime.RequiredError( + 'resourceId', + 'Required parameter "resourceId" was null or undefined when calling getResourcePermissionsHandler().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling getResourcePermissionsHandler().' + ); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset','Required parameter requestParameters.offset was null or undefined when calling getResourcePermissionsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError( + 'offset', + 'Required parameter "offset" was null or undefined when calling getResourcePermissionsHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -126,7 +141,7 @@ export class PermissionsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/permissions/resources/{resource_type}/{resource_id}`.replace(`{${"resource_type"}}`, encodeURIComponent(String(requestParameters.resourceType))).replace(`{${"resource_id"}}`, encodeURIComponent(String(requestParameters.resourceId))), + path: `/permissions/resources/{resource_type}/{resource_id}`.replace(`{${"resource_type"}}`, encodeURIComponent(String(requestParameters['resourceType']))).replace(`{${"resource_id"}}`, encodeURIComponent(String(requestParameters['resourceId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -147,8 +162,11 @@ export class PermissionsApi extends runtime.BaseAPI { * Removes an existing permission. */ async removePermissionHandlerRaw(requestParameters: RemovePermissionHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.permissionRequest === null || requestParameters.permissionRequest === undefined) { - throw new runtime.RequiredError('permissionRequest','Required parameter requestParameters.permissionRequest was null or undefined when calling removePermissionHandler.'); + if (requestParameters['permissionRequest'] == null) { + throw new runtime.RequiredError( + 'permissionRequest', + 'Required parameter "permissionRequest" was null or undefined when calling removePermissionHandler().' + ); } const queryParameters: any = {}; @@ -170,7 +188,7 @@ export class PermissionsApi extends runtime.BaseAPI { method: 'DELETE', headers: headerParameters, query: queryParameters, - body: PermissionRequestToJSON(requestParameters.permissionRequest), + body: PermissionRequestToJSON(requestParameters['permissionRequest']), }, initOverrides); return new runtime.VoidApiResponse(response); diff --git a/typescript/src/apis/PlotsApi.ts b/typescript/src/apis/PlotsApi.ts index 22897ee9..5fc364ff 100644 --- a/typescript/src/apis/PlotsApi.ts +++ b/typescript/src/apis/PlotsApi.ts @@ -40,38 +40,50 @@ export class PlotsApi extends runtime.BaseAPI { * Generates a plot. */ async getPlotHandlerRaw(requestParameters: GetPlotHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.bbox === null || requestParameters.bbox === undefined) { - throw new runtime.RequiredError('bbox','Required parameter requestParameters.bbox was null or undefined when calling getPlotHandler.'); + if (requestParameters['bbox'] == null) { + throw new runtime.RequiredError( + 'bbox', + 'Required parameter "bbox" was null or undefined when calling getPlotHandler().' + ); } - if (requestParameters.time === null || requestParameters.time === undefined) { - throw new runtime.RequiredError('time','Required parameter requestParameters.time was null or undefined when calling getPlotHandler.'); + if (requestParameters['time'] == null) { + throw new runtime.RequiredError( + 'time', + 'Required parameter "time" was null or undefined when calling getPlotHandler().' + ); } - if (requestParameters.spatialResolution === null || requestParameters.spatialResolution === undefined) { - throw new runtime.RequiredError('spatialResolution','Required parameter requestParameters.spatialResolution was null or undefined when calling getPlotHandler.'); + if (requestParameters['spatialResolution'] == null) { + throw new runtime.RequiredError( + 'spatialResolution', + 'Required parameter "spatialResolution" was null or undefined when calling getPlotHandler().' + ); } - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getPlotHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getPlotHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.bbox !== undefined) { - queryParameters['bbox'] = requestParameters.bbox; + if (requestParameters['bbox'] != null) { + queryParameters['bbox'] = requestParameters['bbox']; } - if (requestParameters.crs !== undefined) { - queryParameters['crs'] = requestParameters.crs; + if (requestParameters['crs'] != null) { + queryParameters['crs'] = requestParameters['crs']; } - if (requestParameters.time !== undefined) { - queryParameters['time'] = requestParameters.time; + if (requestParameters['time'] != null) { + queryParameters['time'] = requestParameters['time']; } - if (requestParameters.spatialResolution !== undefined) { - queryParameters['spatialResolution'] = requestParameters.spatialResolution; + if (requestParameters['spatialResolution'] != null) { + queryParameters['spatialResolution'] = requestParameters['spatialResolution']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -85,7 +97,7 @@ export class PlotsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/plot/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/plot/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/src/apis/ProjectsApi.ts b/typescript/src/apis/ProjectsApi.ts index e5b749c3..4a109db6 100644 --- a/typescript/src/apis/ProjectsApi.ts +++ b/typescript/src/apis/ProjectsApi.ts @@ -81,8 +81,11 @@ export class ProjectsApi extends runtime.BaseAPI { * Create a new project for the user. */ async createProjectHandlerRaw(requestParameters: CreateProjectHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.createProject === null || requestParameters.createProject === undefined) { - throw new runtime.RequiredError('createProject','Required parameter requestParameters.createProject was null or undefined when calling createProjectHandler.'); + if (requestParameters['createProject'] == null) { + throw new runtime.RequiredError( + 'createProject', + 'Required parameter "createProject" was null or undefined when calling createProjectHandler().' + ); } const queryParameters: any = {}; @@ -104,7 +107,7 @@ export class ProjectsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: CreateProjectToJSON(requestParameters.createProject), + body: CreateProjectToJSON(requestParameters['createProject']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AddCollection200ResponseFromJSON(jsonValue)); @@ -122,8 +125,11 @@ export class ProjectsApi extends runtime.BaseAPI { * Deletes a project. */ async deleteProjectHandlerRaw(requestParameters: DeleteProjectHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling deleteProjectHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError( + 'project', + 'Required parameter "project" was null or undefined when calling deleteProjectHandler().' + ); } const queryParameters: any = {}; @@ -139,7 +145,7 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -159,16 +165,25 @@ export class ProjectsApi extends runtime.BaseAPI { * List all projects accessible to the user that match the selected criteria. */ async listProjectsHandlerRaw(requestParameters: ListProjectsHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters.order === null || requestParameters.order === undefined) { - throw new runtime.RequiredError('order','Required parameter requestParameters.order was null or undefined when calling listProjectsHandler.'); + if (requestParameters['order'] == null) { + throw new runtime.RequiredError( + 'order', + 'Required parameter "order" was null or undefined when calling listProjectsHandler().' + ); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset','Required parameter requestParameters.offset was null or undefined when calling listProjectsHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError( + 'offset', + 'Required parameter "offset" was null or undefined when calling listProjectsHandler().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling listProjectsHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling listProjectsHandler().' + ); } const queryParameters: any = {}; @@ -184,7 +199,7 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/projects`.replace(`{${"order"}}`, encodeURIComponent(String(requestParameters.order))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters.offset))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters.limit))), + path: `/projects`.replace(`{${"order"}}`, encodeURIComponent(String(requestParameters['order']))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters['offset']))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters['limit']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -205,8 +220,11 @@ export class ProjectsApi extends runtime.BaseAPI { * Retrieves details about the latest version of a project. */ async loadProjectLatestHandlerRaw(requestParameters: LoadProjectLatestHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling loadProjectLatestHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError( + 'project', + 'Required parameter "project" was null or undefined when calling loadProjectLatestHandler().' + ); } const queryParameters: any = {}; @@ -222,7 +240,7 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -243,12 +261,18 @@ export class ProjectsApi extends runtime.BaseAPI { * Retrieves details about the given version of a project. */ async loadProjectVersionHandlerRaw(requestParameters: LoadProjectVersionHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling loadProjectVersionHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError( + 'project', + 'Required parameter "project" was null or undefined when calling loadProjectVersionHandler().' + ); } - if (requestParameters.version === null || requestParameters.version === undefined) { - throw new runtime.RequiredError('version','Required parameter requestParameters.version was null or undefined when calling loadProjectVersionHandler.'); + if (requestParameters['version'] == null) { + throw new runtime.RequiredError( + 'version', + 'Required parameter "version" was null or undefined when calling loadProjectVersionHandler().' + ); } const queryParameters: any = {}; @@ -264,7 +288,7 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/project/{project}/{version}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))), + path: `/project/{project}/{version}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters['version']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -285,8 +309,11 @@ export class ProjectsApi extends runtime.BaseAPI { * Lists all available versions of a project. */ async projectVersionsHandlerRaw(requestParameters: ProjectVersionsHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling projectVersionsHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError( + 'project', + 'Required parameter "project" was null or undefined when calling projectVersionsHandler().' + ); } const queryParameters: any = {}; @@ -302,7 +329,7 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/project/{project}/versions`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}/versions`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -324,12 +351,18 @@ export class ProjectsApi extends runtime.BaseAPI { * Updates a project. */ async updateProjectHandlerRaw(requestParameters: UpdateProjectHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.project === null || requestParameters.project === undefined) { - throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling updateProjectHandler.'); + if (requestParameters['project'] == null) { + throw new runtime.RequiredError( + 'project', + 'Required parameter "project" was null or undefined when calling updateProjectHandler().' + ); } - if (requestParameters.updateProject === null || requestParameters.updateProject === undefined) { - throw new runtime.RequiredError('updateProject','Required parameter requestParameters.updateProject was null or undefined when calling updateProjectHandler.'); + if (requestParameters['updateProject'] == null) { + throw new runtime.RequiredError( + 'updateProject', + 'Required parameter "updateProject" was null or undefined when calling updateProjectHandler().' + ); } const queryParameters: any = {}; @@ -347,11 +380,11 @@ export class ProjectsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))), + path: `/project/{project}`.replace(`{${"project"}}`, encodeURIComponent(String(requestParameters['project']))), method: 'PATCH', headers: headerParameters, query: queryParameters, - body: UpdateProjectToJSON(requestParameters.updateProject), + body: UpdateProjectToJSON(requestParameters['updateProject']), }, initOverrides); return new runtime.VoidApiResponse(response); diff --git a/typescript/src/apis/SessionApi.ts b/typescript/src/apis/SessionApi.ts index ccd534ce..6ecb300c 100644 --- a/typescript/src/apis/SessionApi.ts +++ b/typescript/src/apis/SessionApi.ts @@ -86,8 +86,11 @@ export class SessionApi extends runtime.BaseAPI { * Creates a session by providing user credentials. The session\'s id serves as a Bearer token for requests. */ async loginHandlerRaw(requestParameters: LoginHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userCredentials === null || requestParameters.userCredentials === undefined) { - throw new runtime.RequiredError('userCredentials','Required parameter requestParameters.userCredentials was null or undefined when calling loginHandler.'); + if (requestParameters['userCredentials'] == null) { + throw new runtime.RequiredError( + 'userCredentials', + 'Required parameter "userCredentials" was null or undefined when calling loginHandler().' + ); } const queryParameters: any = {}; @@ -101,7 +104,7 @@ export class SessionApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: UserCredentialsToJSON(requestParameters.userCredentials), + body: UserCredentialsToJSON(requestParameters['userCredentials']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => UserSessionFromJSON(jsonValue)); @@ -153,14 +156,17 @@ export class SessionApi extends runtime.BaseAPI { * Initializes the Open Id Connect login procedure by requesting a parametrized url to the configured Id Provider. */ async oidcInitRaw(requestParameters: OidcInitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.redirectUri === null || requestParameters.redirectUri === undefined) { - throw new runtime.RequiredError('redirectUri','Required parameter requestParameters.redirectUri was null or undefined when calling oidcInit.'); + if (requestParameters['redirectUri'] == null) { + throw new runtime.RequiredError( + 'redirectUri', + 'Required parameter "redirectUri" was null or undefined when calling oidcInit().' + ); } const queryParameters: any = {}; - if (requestParameters.redirectUri !== undefined) { - queryParameters['redirectUri'] = requestParameters.redirectUri; + if (requestParameters['redirectUri'] != null) { + queryParameters['redirectUri'] = requestParameters['redirectUri']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -189,18 +195,24 @@ export class SessionApi extends runtime.BaseAPI { * Creates a session for a user via a login with Open Id Connect. */ async oidcLoginRaw(requestParameters: OidcLoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.redirectUri === null || requestParameters.redirectUri === undefined) { - throw new runtime.RequiredError('redirectUri','Required parameter requestParameters.redirectUri was null or undefined when calling oidcLogin.'); + if (requestParameters['redirectUri'] == null) { + throw new runtime.RequiredError( + 'redirectUri', + 'Required parameter "redirectUri" was null or undefined when calling oidcLogin().' + ); } - if (requestParameters.authCodeResponse === null || requestParameters.authCodeResponse === undefined) { - throw new runtime.RequiredError('authCodeResponse','Required parameter requestParameters.authCodeResponse was null or undefined when calling oidcLogin.'); + if (requestParameters['authCodeResponse'] == null) { + throw new runtime.RequiredError( + 'authCodeResponse', + 'Required parameter "authCodeResponse" was null or undefined when calling oidcLogin().' + ); } const queryParameters: any = {}; - if (requestParameters.redirectUri !== undefined) { - queryParameters['redirectUri'] = requestParameters.redirectUri; + if (requestParameters['redirectUri'] != null) { + queryParameters['redirectUri'] = requestParameters['redirectUri']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -212,7 +224,7 @@ export class SessionApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: AuthCodeResponseToJSON(requestParameters.authCodeResponse), + body: AuthCodeResponseToJSON(requestParameters['authCodeResponse']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => UserSessionFromJSON(jsonValue)); @@ -231,8 +243,11 @@ export class SessionApi extends runtime.BaseAPI { * Registers a user. */ async registerUserHandlerRaw(requestParameters: RegisterUserHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.userRegistration === null || requestParameters.userRegistration === undefined) { - throw new runtime.RequiredError('userRegistration','Required parameter requestParameters.userRegistration was null or undefined when calling registerUserHandler.'); + if (requestParameters['userRegistration'] == null) { + throw new runtime.RequiredError( + 'userRegistration', + 'Required parameter "userRegistration" was null or undefined when calling registerUserHandler().' + ); } const queryParameters: any = {}; @@ -246,7 +261,7 @@ export class SessionApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: UserRegistrationToJSON(requestParameters.userRegistration), + body: UserRegistrationToJSON(requestParameters['userRegistration']), }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { diff --git a/typescript/src/apis/SpatialReferencesApi.ts b/typescript/src/apis/SpatialReferencesApi.ts index b75cfb83..fde2d4b8 100644 --- a/typescript/src/apis/SpatialReferencesApi.ts +++ b/typescript/src/apis/SpatialReferencesApi.ts @@ -34,8 +34,11 @@ export class SpatialReferencesApi extends runtime.BaseAPI { /** */ async getSpatialReferenceSpecificationHandlerRaw(requestParameters: GetSpatialReferenceSpecificationHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.srsString === null || requestParameters.srsString === undefined) { - throw new runtime.RequiredError('srsString','Required parameter requestParameters.srsString was null or undefined when calling getSpatialReferenceSpecificationHandler.'); + if (requestParameters['srsString'] == null) { + throw new runtime.RequiredError( + 'srsString', + 'Required parameter "srsString" was null or undefined when calling getSpatialReferenceSpecificationHandler().' + ); } const queryParameters: any = {}; @@ -51,7 +54,7 @@ export class SpatialReferencesApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/spatialReferenceSpecification/{srsString}`.replace(`{${"srsString"}}`, encodeURIComponent(String(requestParameters.srsString))), + path: `/spatialReferenceSpecification/{srsString}`.replace(`{${"srsString"}}`, encodeURIComponent(String(requestParameters['srsString']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/src/apis/TasksApi.ts b/typescript/src/apis/TasksApi.ts index dd1ced52..11e07912 100644 --- a/typescript/src/apis/TasksApi.ts +++ b/typescript/src/apis/TasksApi.ts @@ -53,14 +53,17 @@ export class TasksApi extends runtime.BaseAPI { * Abort a running task. */ async abortHandlerRaw(requestParameters: AbortHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling abortHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling abortHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.force !== undefined) { - queryParameters['force'] = requestParameters.force; + if (requestParameters['force'] != null) { + queryParameters['force'] = requestParameters['force']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -74,7 +77,7 @@ export class TasksApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/tasks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/tasks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -95,16 +98,25 @@ export class TasksApi extends runtime.BaseAPI { * Retrieve the status of all tasks. */ async listHandlerRaw(requestParameters: ListHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters.filter === null || requestParameters.filter === undefined) { - throw new runtime.RequiredError('filter','Required parameter requestParameters.filter was null or undefined when calling listHandler.'); + if (requestParameters['filter'] == null) { + throw new runtime.RequiredError( + 'filter', + 'Required parameter "filter" was null or undefined when calling listHandler().' + ); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset','Required parameter requestParameters.offset was null or undefined when calling listHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError( + 'offset', + 'Required parameter "offset" was null or undefined when calling listHandler().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling listHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling listHandler().' + ); } const queryParameters: any = {}; @@ -120,7 +132,7 @@ export class TasksApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/tasks/list`.replace(`{${"filter"}}`, encodeURIComponent(String(requestParameters.filter))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters.offset))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters.limit))), + path: `/tasks/list`.replace(`{${"filter"}}`, encodeURIComponent(String(requestParameters['filter']))).replace(`{${"offset"}}`, encodeURIComponent(String(requestParameters['offset']))).replace(`{${"limit"}}`, encodeURIComponent(String(requestParameters['limit']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -141,8 +153,11 @@ export class TasksApi extends runtime.BaseAPI { * Retrieve the status of a task. */ async statusHandlerRaw(requestParameters: StatusHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling statusHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling statusHandler().' + ); } const queryParameters: any = {}; @@ -158,7 +173,7 @@ export class TasksApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/tasks/{id}/status`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/tasks/{id}/status`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/src/apis/UploadsApi.ts b/typescript/src/apis/UploadsApi.ts index c6404a01..811263bc 100644 --- a/typescript/src/apis/UploadsApi.ts +++ b/typescript/src/apis/UploadsApi.ts @@ -50,12 +50,18 @@ export class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. */ async listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) { - throw new runtime.RequiredError('uploadId','Required parameter requestParameters.uploadId was null or undefined when calling listUploadFileLayersHandler.'); + if (requestParameters['uploadId'] == null) { + throw new runtime.RequiredError( + 'uploadId', + 'Required parameter "uploadId" was null or undefined when calling listUploadFileLayersHandler().' + ); } - if (requestParameters.fileName === null || requestParameters.fileName === undefined) { - throw new runtime.RequiredError('fileName','Required parameter requestParameters.fileName was null or undefined when calling listUploadFileLayersHandler.'); + if (requestParameters['fileName'] == null) { + throw new runtime.RequiredError( + 'fileName', + 'Required parameter "fileName" was null or undefined when calling listUploadFileLayersHandler().' + ); } const queryParameters: any = {}; @@ -71,7 +77,7 @@ export class UploadsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/uploads/{upload_id}/files/{file_name}/layers`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters.uploadId))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters.fileName))), + path: `/uploads/{upload_id}/files/{file_name}/layers`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters['uploadId']))).replace(`{${"file_name"}}`, encodeURIComponent(String(requestParameters['fileName']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -92,8 +98,11 @@ export class UploadsApi extends runtime.BaseAPI { * List the files of on upload. */ async listUploadFilesHandlerRaw(requestParameters: ListUploadFilesHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) { - throw new runtime.RequiredError('uploadId','Required parameter requestParameters.uploadId was null or undefined when calling listUploadFilesHandler.'); + if (requestParameters['uploadId'] == null) { + throw new runtime.RequiredError( + 'uploadId', + 'Required parameter "uploadId" was null or undefined when calling listUploadFilesHandler().' + ); } const queryParameters: any = {}; @@ -109,7 +118,7 @@ export class UploadsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/uploads/{upload_id}/files`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters.uploadId))), + path: `/uploads/{upload_id}/files`.replace(`{${"upload_id"}}`, encodeURIComponent(String(requestParameters['uploadId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -130,8 +139,11 @@ export class UploadsApi extends runtime.BaseAPI { * Uploads files. */ async uploadHandlerRaw(requestParameters: UploadHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.files === null || requestParameters.files === undefined) { - throw new runtime.RequiredError('files','Required parameter requestParameters.files was null or undefined when calling uploadHandler.'); + if (requestParameters['files'] == null) { + throw new runtime.RequiredError( + 'files', + 'Required parameter "files" was null or undefined when calling uploadHandler().' + ); } const queryParameters: any = {}; @@ -162,8 +174,8 @@ export class UploadsApi extends runtime.BaseAPI { formParams = new URLSearchParams(); } - if (requestParameters.files) { - requestParameters.files.forEach((element) => { + if (requestParameters['files'] != null) { + requestParameters['files'].forEach((element) => { formParams.append('files[]', element as any); }) } diff --git a/typescript/src/apis/UserApi.ts b/typescript/src/apis/UserApi.ts index 677ceafb..3853c200 100644 --- a/typescript/src/apis/UserApi.ts +++ b/typescript/src/apis/UserApi.ts @@ -110,8 +110,11 @@ export class UserApi extends runtime.BaseAPI { * Add a new role. Requires admin privilige. */ async addRoleHandlerRaw(requestParameters: AddRoleHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.addRole === null || requestParameters.addRole === undefined) { - throw new runtime.RequiredError('addRole','Required parameter requestParameters.addRole was null or undefined when calling addRoleHandler.'); + if (requestParameters['addRole'] == null) { + throw new runtime.RequiredError( + 'addRole', + 'Required parameter "addRole" was null or undefined when calling addRoleHandler().' + ); } const queryParameters: any = {}; @@ -133,7 +136,7 @@ export class UserApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: AddRoleToJSON(requestParameters.addRole), + body: AddRoleToJSON(requestParameters['addRole']), }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { @@ -155,12 +158,18 @@ export class UserApi extends runtime.BaseAPI { * Assign a role to a user. Requires admin privilige. */ async assignRoleHandlerRaw(requestParameters: AssignRoleHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling assignRoleHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError( + 'user', + 'Required parameter "user" was null or undefined when calling assignRoleHandler().' + ); } - if (requestParameters.role === null || requestParameters.role === undefined) { - throw new runtime.RequiredError('role','Required parameter requestParameters.role was null or undefined when calling assignRoleHandler.'); + if (requestParameters['role'] == null) { + throw new runtime.RequiredError( + 'role', + 'Required parameter "role" was null or undefined when calling assignRoleHandler().' + ); } const queryParameters: any = {}; @@ -176,7 +185,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters.role))), + path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters['role']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -196,8 +205,11 @@ export class UserApi extends runtime.BaseAPI { * Retrieves the quota used by computation with the given computation id */ async computationQuotaHandlerRaw(requestParameters: ComputationQuotaHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters.computation === null || requestParameters.computation === undefined) { - throw new runtime.RequiredError('computation','Required parameter requestParameters.computation was null or undefined when calling computationQuotaHandler.'); + if (requestParameters['computation'] == null) { + throw new runtime.RequiredError( + 'computation', + 'Required parameter "computation" was null or undefined when calling computationQuotaHandler().' + ); } const queryParameters: any = {}; @@ -213,7 +225,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/quota/computations/{computation}`.replace(`{${"computation"}}`, encodeURIComponent(String(requestParameters.computation))), + path: `/quota/computations/{computation}`.replace(`{${"computation"}}`, encodeURIComponent(String(requestParameters['computation']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -234,22 +246,28 @@ export class UserApi extends runtime.BaseAPI { * Retrieves the quota used by computations */ async computationsQuotaHandlerRaw(requestParameters: ComputationsQuotaHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset','Required parameter requestParameters.offset was null or undefined when calling computationsQuotaHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError( + 'offset', + 'Required parameter "offset" was null or undefined when calling computationsQuotaHandler().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling computationsQuotaHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling computationsQuotaHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -284,22 +302,28 @@ export class UserApi extends runtime.BaseAPI { * Retrieves the data usage */ async dataUsageHandlerRaw(requestParameters: DataUsageHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset','Required parameter requestParameters.offset was null or undefined when calling dataUsageHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError( + 'offset', + 'Required parameter "offset" was null or undefined when calling dataUsageHandler().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling dataUsageHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling dataUsageHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -334,34 +358,43 @@ export class UserApi extends runtime.BaseAPI { * Retrieves the data usage summary */ async dataUsageSummaryHandlerRaw(requestParameters: DataUsageSummaryHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters.granularity === null || requestParameters.granularity === undefined) { - throw new runtime.RequiredError('granularity','Required parameter requestParameters.granularity was null or undefined when calling dataUsageSummaryHandler.'); + if (requestParameters['granularity'] == null) { + throw new runtime.RequiredError( + 'granularity', + 'Required parameter "granularity" was null or undefined when calling dataUsageSummaryHandler().' + ); } - if (requestParameters.offset === null || requestParameters.offset === undefined) { - throw new runtime.RequiredError('offset','Required parameter requestParameters.offset was null or undefined when calling dataUsageSummaryHandler.'); + if (requestParameters['offset'] == null) { + throw new runtime.RequiredError( + 'offset', + 'Required parameter "offset" was null or undefined when calling dataUsageSummaryHandler().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling dataUsageSummaryHandler.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling dataUsageSummaryHandler().' + ); } const queryParameters: any = {}; - if (requestParameters.granularity !== undefined) { - queryParameters['granularity'] = requestParameters.granularity; + if (requestParameters['granularity'] != null) { + queryParameters['granularity'] = requestParameters['granularity']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.dataset !== undefined) { - queryParameters['dataset'] = requestParameters.dataset; + if (requestParameters['dataset'] != null) { + queryParameters['dataset'] = requestParameters['dataset']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -396,8 +429,11 @@ export class UserApi extends runtime.BaseAPI { * Get role by name */ async getRoleByNameHandlerRaw(requestParameters: GetRoleByNameHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getRoleByNameHandler.'); + if (requestParameters['name'] == null) { + throw new runtime.RequiredError( + 'name', + 'Required parameter "name" was null or undefined when calling getRoleByNameHandler().' + ); } const queryParameters: any = {}; @@ -413,7 +449,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/roles/byName/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))), + path: `/roles/byName/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters['name']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -468,8 +504,11 @@ export class UserApi extends runtime.BaseAPI { * Retrieves the available and used quota of a specific user. */ async getUserQuotaHandlerRaw(requestParameters: GetUserQuotaHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling getUserQuotaHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError( + 'user', + 'Required parameter "user" was null or undefined when calling getUserQuotaHandler().' + ); } const queryParameters: any = {}; @@ -485,7 +524,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))), + path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -540,8 +579,11 @@ export class UserApi extends runtime.BaseAPI { * Remove a role. Requires admin privilige. */ async removeRoleHandlerRaw(requestParameters: RemoveRoleHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.role === null || requestParameters.role === undefined) { - throw new runtime.RequiredError('role','Required parameter requestParameters.role was null or undefined when calling removeRoleHandler.'); + if (requestParameters['role'] == null) { + throw new runtime.RequiredError( + 'role', + 'Required parameter "role" was null or undefined when calling removeRoleHandler().' + ); } const queryParameters: any = {}; @@ -557,7 +599,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/roles/{role}`.replace(`{${"role"}}`, encodeURIComponent(String(requestParameters.role))), + path: `/roles/{role}`.replace(`{${"role"}}`, encodeURIComponent(String(requestParameters['role']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -577,12 +619,18 @@ export class UserApi extends runtime.BaseAPI { * Revoke a role from a user. Requires admin privilige. */ async revokeRoleHandlerRaw(requestParameters: RevokeRoleHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling revokeRoleHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError( + 'user', + 'Required parameter "user" was null or undefined when calling revokeRoleHandler().' + ); } - if (requestParameters.role === null || requestParameters.role === undefined) { - throw new runtime.RequiredError('role','Required parameter requestParameters.role was null or undefined when calling revokeRoleHandler.'); + if (requestParameters['role'] == null) { + throw new runtime.RequiredError( + 'role', + 'Required parameter "role" was null or undefined when calling revokeRoleHandler().' + ); } const queryParameters: any = {}; @@ -598,7 +646,7 @@ export class UserApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters.role))), + path: `/users/{user}/roles/{role}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))).replace(`{${"role"}}`, encodeURIComponent(String(requestParameters['role']))), method: 'DELETE', headers: headerParameters, query: queryParameters, @@ -618,12 +666,18 @@ export class UserApi extends runtime.BaseAPI { * Update the available quota of a specific user. */ async updateUserQuotaHandlerRaw(requestParameters: UpdateUserQuotaHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.user === null || requestParameters.user === undefined) { - throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling updateUserQuotaHandler.'); + if (requestParameters['user'] == null) { + throw new runtime.RequiredError( + 'user', + 'Required parameter "user" was null or undefined when calling updateUserQuotaHandler().' + ); } - if (requestParameters.updateQuota === null || requestParameters.updateQuota === undefined) { - throw new runtime.RequiredError('updateQuota','Required parameter requestParameters.updateQuota was null or undefined when calling updateUserQuotaHandler.'); + if (requestParameters['updateQuota'] == null) { + throw new runtime.RequiredError( + 'updateQuota', + 'Required parameter "updateQuota" was null or undefined when calling updateUserQuotaHandler().' + ); } const queryParameters: any = {}; @@ -641,11 +695,11 @@ export class UserApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))), + path: `/quotas/{user}`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters['user']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: UpdateQuotaToJSON(requestParameters.updateQuota), + body: UpdateQuotaToJSON(requestParameters['updateQuota']), }, initOverrides); return new runtime.VoidApiResponse(response); diff --git a/typescript/src/apis/WorkflowsApi.ts b/typescript/src/apis/WorkflowsApi.ts index 074d5db1..3b4047e9 100644 --- a/typescript/src/apis/WorkflowsApi.ts +++ b/typescript/src/apis/WorkflowsApi.ts @@ -90,12 +90,18 @@ export class WorkflowsApi extends runtime.BaseAPI { * Create a task for creating a new dataset from the result of the workflow given by its `id` and the dataset parameters in the request body. */ async datasetFromWorkflowHandlerRaw(requestParameters: DatasetFromWorkflowHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling datasetFromWorkflowHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling datasetFromWorkflowHandler().' + ); } - if (requestParameters.rasterDatasetFromWorkflow === null || requestParameters.rasterDatasetFromWorkflow === undefined) { - throw new runtime.RequiredError('rasterDatasetFromWorkflow','Required parameter requestParameters.rasterDatasetFromWorkflow was null or undefined when calling datasetFromWorkflowHandler.'); + if (requestParameters['rasterDatasetFromWorkflow'] == null) { + throw new runtime.RequiredError( + 'rasterDatasetFromWorkflow', + 'Required parameter "rasterDatasetFromWorkflow" was null or undefined when calling datasetFromWorkflowHandler().' + ); } const queryParameters: any = {}; @@ -113,11 +119,11 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/datasetFromWorkflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/datasetFromWorkflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: RasterDatasetFromWorkflowToJSON(requestParameters.rasterDatasetFromWorkflow), + body: RasterDatasetFromWorkflowToJSON(requestParameters['rasterDatasetFromWorkflow']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => TaskResponseFromJSON(jsonValue)); @@ -136,8 +142,11 @@ export class WorkflowsApi extends runtime.BaseAPI { * Gets a ZIP archive of the worklow, its provenance and the output metadata. */ async getWorkflowAllMetadataZipHandlerRaw(requestParameters: GetWorkflowAllMetadataZipHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getWorkflowAllMetadataZipHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getWorkflowAllMetadataZipHandler().' + ); } const queryParameters: any = {}; @@ -153,7 +162,7 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/workflow/{id}/allMetadata/zip`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/allMetadata/zip`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -174,8 +183,11 @@ export class WorkflowsApi extends runtime.BaseAPI { * Gets the metadata of a workflow */ async getWorkflowMetadataHandlerRaw(requestParameters: GetWorkflowMetadataHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getWorkflowMetadataHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getWorkflowMetadataHandler().' + ); } const queryParameters: any = {}; @@ -191,7 +203,7 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/workflow/{id}/metadata`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/metadata`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -212,8 +224,11 @@ export class WorkflowsApi extends runtime.BaseAPI { * Gets the provenance of all datasets used in a workflow. */ async getWorkflowProvenanceHandlerRaw(requestParameters: GetWorkflowProvenanceHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getWorkflowProvenanceHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getWorkflowProvenanceHandler().' + ); } const queryParameters: any = {}; @@ -229,7 +244,7 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/workflow/{id}/provenance`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/provenance`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -250,8 +265,11 @@ export class WorkflowsApi extends runtime.BaseAPI { * Retrieves an existing Workflow. */ async loadWorkflowHandlerRaw(requestParameters: LoadWorkflowHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling loadWorkflowHandler.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling loadWorkflowHandler().' + ); } const queryParameters: any = {}; @@ -267,7 +285,7 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/workflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -288,50 +306,68 @@ export class WorkflowsApi extends runtime.BaseAPI { * Query a workflow raster result as a stream of tiles via a websocket connection. */ async rasterStreamWebsocketRaw(requestParameters: RasterStreamWebsocketRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling rasterStreamWebsocket().' + ); } - if (requestParameters.spatialBounds === null || requestParameters.spatialBounds === undefined) { - throw new runtime.RequiredError('spatialBounds','Required parameter requestParameters.spatialBounds was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['spatialBounds'] == null) { + throw new runtime.RequiredError( + 'spatialBounds', + 'Required parameter "spatialBounds" was null or undefined when calling rasterStreamWebsocket().' + ); } - if (requestParameters.timeInterval === null || requestParameters.timeInterval === undefined) { - throw new runtime.RequiredError('timeInterval','Required parameter requestParameters.timeInterval was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['timeInterval'] == null) { + throw new runtime.RequiredError( + 'timeInterval', + 'Required parameter "timeInterval" was null or undefined when calling rasterStreamWebsocket().' + ); } - if (requestParameters.spatialResolution === null || requestParameters.spatialResolution === undefined) { - throw new runtime.RequiredError('spatialResolution','Required parameter requestParameters.spatialResolution was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['spatialResolution'] == null) { + throw new runtime.RequiredError( + 'spatialResolution', + 'Required parameter "spatialResolution" was null or undefined when calling rasterStreamWebsocket().' + ); } - if (requestParameters.attributes === null || requestParameters.attributes === undefined) { - throw new runtime.RequiredError('attributes','Required parameter requestParameters.attributes was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['attributes'] == null) { + throw new runtime.RequiredError( + 'attributes', + 'Required parameter "attributes" was null or undefined when calling rasterStreamWebsocket().' + ); } - if (requestParameters.resultType === null || requestParameters.resultType === undefined) { - throw new runtime.RequiredError('resultType','Required parameter requestParameters.resultType was null or undefined when calling rasterStreamWebsocket.'); + if (requestParameters['resultType'] == null) { + throw new runtime.RequiredError( + 'resultType', + 'Required parameter "resultType" was null or undefined when calling rasterStreamWebsocket().' + ); } const queryParameters: any = {}; - if (requestParameters.spatialBounds !== undefined) { - queryParameters['spatialBounds'] = requestParameters.spatialBounds; + if (requestParameters['spatialBounds'] != null) { + queryParameters['spatialBounds'] = requestParameters['spatialBounds']; } - if (requestParameters.timeInterval !== undefined) { - queryParameters['timeInterval'] = requestParameters.timeInterval; + if (requestParameters['timeInterval'] != null) { + queryParameters['timeInterval'] = requestParameters['timeInterval']; } - if (requestParameters.spatialResolution !== undefined) { - queryParameters['spatialResolution'] = requestParameters.spatialResolution; + if (requestParameters['spatialResolution'] != null) { + queryParameters['spatialResolution'] = requestParameters['spatialResolution']; } - if (requestParameters.attributes !== undefined) { - queryParameters['attributes'] = requestParameters.attributes; + if (requestParameters['attributes'] != null) { + queryParameters['attributes'] = requestParameters['attributes']; } - if (requestParameters.resultType !== undefined) { - queryParameters['resultType'] = requestParameters.resultType; + if (requestParameters['resultType'] != null) { + queryParameters['resultType'] = requestParameters['resultType']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -345,7 +381,7 @@ export class WorkflowsApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/workflow/{id}/rasterStream`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), + path: `/workflow/{id}/rasterStream`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -365,8 +401,11 @@ export class WorkflowsApi extends runtime.BaseAPI { * Registers a new Workflow. */ async registerWorkflowHandlerRaw(requestParameters: RegisterWorkflowHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.workflow === null || requestParameters.workflow === undefined) { - throw new runtime.RequiredError('workflow','Required parameter requestParameters.workflow was null or undefined when calling registerWorkflowHandler.'); + if (requestParameters['workflow'] == null) { + throw new runtime.RequiredError( + 'workflow', + 'Required parameter "workflow" was null or undefined when calling registerWorkflowHandler().' + ); } const queryParameters: any = {}; @@ -388,7 +427,7 @@ export class WorkflowsApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: WorkflowToJSON(requestParameters.workflow), + body: WorkflowToJSON(requestParameters['workflow']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AddCollection200ResponseFromJSON(jsonValue)); diff --git a/typescript/src/models/AddCollection200Response.ts b/typescript/src/models/AddCollection200Response.ts index 94ebe9b5..ec3e36e2 100644 --- a/typescript/src/models/AddCollection200Response.ts +++ b/typescript/src/models/AddCollection200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface AddCollection200Response { /** * Check if a given object implements the AddCollection200Response interface. */ -export function instanceOfAddCollection200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - - return isInstance; +export function instanceOfAddCollection200Response(value: object): value is AddCollection200Response { + if (!('id' in value) || value['id'] === undefined) return false; + return true; } export function AddCollection200ResponseFromJSON(json: any): AddCollection200Response { @@ -42,7 +40,7 @@ export function AddCollection200ResponseFromJSON(json: any): AddCollection200Res } export function AddCollection200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddCollection200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function AddCollection200ResponseFromJSONTyped(json: any, ignoreDiscrimin }; } -export function AddCollection200ResponseToJSON(value?: AddCollection200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AddCollection200ResponseToJSON(json: any): AddCollection200Response { + return AddCollection200ResponseToJSONTyped(json, false); +} + +export function AddCollection200ResponseToJSONTyped(value?: AddCollection200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, + 'id': value['id'], }; } diff --git a/typescript/src/models/AddDataset.ts b/typescript/src/models/AddDataset.ts index fa9a0f57..ed060de1 100644 --- a/typescript/src/models/AddDataset.ts +++ b/typescript/src/models/AddDataset.ts @@ -12,18 +12,20 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Provenance } from './Provenance'; import { ProvenanceFromJSON, ProvenanceFromJSONTyped, ProvenanceToJSON, + ProvenanceToJSONTyped, } from './Provenance'; import type { Symbology } from './Symbology'; import { SymbologyFromJSON, SymbologyFromJSONTyped, SymbologyToJSON, + SymbologyToJSONTyped, } from './Symbology'; /** @@ -79,13 +81,11 @@ export interface AddDataset { /** * Check if a given object implements the AddDataset interface. */ -export function instanceOfAddDataset(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "sourceOperator" in value; - - return isInstance; +export function instanceOfAddDataset(value: object): value is AddDataset { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('sourceOperator' in value) || value['sourceOperator'] === undefined) return false; + return true; } export function AddDatasetFromJSON(json: any): AddDataset { @@ -93,37 +93,39 @@ export function AddDatasetFromJSON(json: any): AddDataset { } export function AddDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddDataset { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'displayName': json['displayName'], - 'name': !exists(json, 'name') ? undefined : json['name'], - 'provenance': !exists(json, 'provenance') ? undefined : (json['provenance'] === null ? null : (json['provenance'] as Array).map(ProvenanceFromJSON)), + 'name': json['name'] == null ? undefined : json['name'], + 'provenance': json['provenance'] == null ? undefined : ((json['provenance'] as Array).map(ProvenanceFromJSON)), 'sourceOperator': json['sourceOperator'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), - 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), + 'tags': json['tags'] == null ? undefined : json['tags'], }; } -export function AddDatasetToJSON(value?: AddDataset | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AddDatasetToJSON(json: any): AddDataset { + return AddDatasetToJSONTyped(json, false); +} + +export function AddDatasetToJSONTyped(value?: AddDataset | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'displayName': value.displayName, - 'name': value.name, - 'provenance': value.provenance === undefined ? undefined : (value.provenance === null ? null : (value.provenance as Array).map(ProvenanceToJSON)), - 'sourceOperator': value.sourceOperator, - 'symbology': SymbologyToJSON(value.symbology), - 'tags': value.tags, + 'description': value['description'], + 'displayName': value['displayName'], + 'name': value['name'], + 'provenance': value['provenance'] == null ? undefined : ((value['provenance'] as Array).map(ProvenanceToJSON)), + 'sourceOperator': value['sourceOperator'], + 'symbology': SymbologyToJSON(value['symbology']), + 'tags': value['tags'], }; } diff --git a/typescript/src/models/AddLayer.ts b/typescript/src/models/AddLayer.ts index f86efee1..1a9544cc 100644 --- a/typescript/src/models/AddLayer.ts +++ b/typescript/src/models/AddLayer.ts @@ -12,18 +12,20 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Symbology } from './Symbology'; import { SymbologyFromJSON, SymbologyFromJSONTyped, SymbologyToJSON, + SymbologyToJSONTyped, } from './Symbology'; import type { Workflow } from './Workflow'; import { WorkflowFromJSON, WorkflowFromJSONTyped, WorkflowToJSON, + WorkflowToJSONTyped, } from './Workflow'; /** @@ -73,13 +75,11 @@ export interface AddLayer { /** * Check if a given object implements the AddLayer interface. */ -export function instanceOfAddLayer(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - - return isInstance; +export function instanceOfAddLayer(value: object): value is AddLayer { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('workflow' in value) || value['workflow'] === undefined) return false; + return true; } export function AddLayerFromJSON(json: any): AddLayer { @@ -87,35 +87,37 @@ export function AddLayerFromJSON(json: any): AddLayer { } export function AddLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddLayer { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], - 'metadata': !exists(json, 'metadata') ? undefined : json['metadata'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), + 'properties': json['properties'] == null ? undefined : json['properties'], + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), 'workflow': WorkflowFromJSON(json['workflow']), }; } -export function AddLayerToJSON(value?: AddLayer | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AddLayerToJSON(json: any): AddLayer { + return AddLayerToJSONTyped(json, false); +} + +export function AddLayerToJSONTyped(value?: AddLayer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'metadata': value.metadata, - 'name': value.name, - 'properties': value.properties, - 'symbology': SymbologyToJSON(value.symbology), - 'workflow': WorkflowToJSON(value.workflow), + 'description': value['description'], + 'metadata': value['metadata'], + 'name': value['name'], + 'properties': value['properties'], + 'symbology': SymbologyToJSON(value['symbology']), + 'workflow': WorkflowToJSON(value['workflow']), }; } diff --git a/typescript/src/models/AddLayerCollection.ts b/typescript/src/models/AddLayerCollection.ts index a5c05676..0269e745 100644 --- a/typescript/src/models/AddLayerCollection.ts +++ b/typescript/src/models/AddLayerCollection.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -42,12 +42,10 @@ export interface AddLayerCollection { /** * Check if a given object implements the AddLayerCollection interface. */ -export function instanceOfAddLayerCollection(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - - return isInstance; +export function instanceOfAddLayerCollection(value: object): value is AddLayerCollection { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + return true; } export function AddLayerCollectionFromJSON(json: any): AddLayerCollection { @@ -55,29 +53,31 @@ export function AddLayerCollectionFromJSON(json: any): AddLayerCollection { } export function AddLayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddLayerCollection { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], }; } -export function AddLayerCollectionToJSON(value?: AddLayerCollection | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AddLayerCollectionToJSON(json: any): AddLayerCollection { + return AddLayerCollectionToJSONTyped(json, false); +} + +export function AddLayerCollectionToJSONTyped(value?: AddLayerCollection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'name': value.name, - 'properties': value.properties, + 'description': value['description'], + 'name': value['name'], + 'properties': value['properties'], }; } diff --git a/typescript/src/models/AddRole.ts b/typescript/src/models/AddRole.ts index ef684293..5b79fb59 100644 --- a/typescript/src/models/AddRole.ts +++ b/typescript/src/models/AddRole.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface AddRole { /** * Check if a given object implements the AddRole interface. */ -export function instanceOfAddRole(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "name" in value; - - return isInstance; +export function instanceOfAddRole(value: object): value is AddRole { + if (!('name' in value) || value['name'] === undefined) return false; + return true; } export function AddRoleFromJSON(json: any): AddRole { @@ -42,7 +40,7 @@ export function AddRoleFromJSON(json: any): AddRole { } export function AddRoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddRole { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function AddRoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): A }; } -export function AddRoleToJSON(value?: AddRole | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AddRoleToJSON(json: any): AddRole { + return AddRoleToJSONTyped(json, false); +} + +export function AddRoleToJSONTyped(value?: AddRole | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'name': value.name, + 'name': value['name'], }; } diff --git a/typescript/src/models/AuthCodeRequestURL.ts b/typescript/src/models/AuthCodeRequestURL.ts index 423457b9..6d7b8d09 100644 --- a/typescript/src/models/AuthCodeRequestURL.ts +++ b/typescript/src/models/AuthCodeRequestURL.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface AuthCodeRequestURL { /** * Check if a given object implements the AuthCodeRequestURL interface. */ -export function instanceOfAuthCodeRequestURL(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "url" in value; - - return isInstance; +export function instanceOfAuthCodeRequestURL(value: object): value is AuthCodeRequestURL { + if (!('url' in value) || value['url'] === undefined) return false; + return true; } export function AuthCodeRequestURLFromJSON(json: any): AuthCodeRequestURL { @@ -42,7 +40,7 @@ export function AuthCodeRequestURLFromJSON(json: any): AuthCodeRequestURL { } export function AuthCodeRequestURLFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthCodeRequestURL { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function AuthCodeRequestURLFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function AuthCodeRequestURLToJSON(value?: AuthCodeRequestURL | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AuthCodeRequestURLToJSON(json: any): AuthCodeRequestURL { + return AuthCodeRequestURLToJSONTyped(json, false); +} + +export function AuthCodeRequestURLToJSONTyped(value?: AuthCodeRequestURL | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'url': value.url, + 'url': value['url'], }; } diff --git a/typescript/src/models/AuthCodeResponse.ts b/typescript/src/models/AuthCodeResponse.ts index ac753460..2dbfd01a 100644 --- a/typescript/src/models/AuthCodeResponse.ts +++ b/typescript/src/models/AuthCodeResponse.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -42,13 +42,11 @@ export interface AuthCodeResponse { /** * Check if a given object implements the AuthCodeResponse interface. */ -export function instanceOfAuthCodeResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "code" in value; - isInstance = isInstance && "sessionState" in value; - isInstance = isInstance && "state" in value; - - return isInstance; +export function instanceOfAuthCodeResponse(value: object): value is AuthCodeResponse { + if (!('code' in value) || value['code'] === undefined) return false; + if (!('sessionState' in value) || value['sessionState'] === undefined) return false; + if (!('state' in value) || value['state'] === undefined) return false; + return true; } export function AuthCodeResponseFromJSON(json: any): AuthCodeResponse { @@ -56,7 +54,7 @@ export function AuthCodeResponseFromJSON(json: any): AuthCodeResponse { } export function AuthCodeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthCodeResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,18 +65,20 @@ export function AuthCodeResponseFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function AuthCodeResponseToJSON(value?: AuthCodeResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AuthCodeResponseToJSON(json: any): AuthCodeResponse { + return AuthCodeResponseToJSONTyped(json, false); +} + +export function AuthCodeResponseToJSONTyped(value?: AuthCodeResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'code': value.code, - 'sessionState': value.sessionState, - 'state': value.state, + 'code': value['code'], + 'sessionState': value['sessionState'], + 'state': value['state'], }; } diff --git a/typescript/src/models/AutoCreateDataset.ts b/typescript/src/models/AutoCreateDataset.ts index 461705e8..3b0c363e 100644 --- a/typescript/src/models/AutoCreateDataset.ts +++ b/typescript/src/models/AutoCreateDataset.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -60,14 +60,12 @@ export interface AutoCreateDataset { /** * Check if a given object implements the AutoCreateDataset interface. */ -export function instanceOfAutoCreateDataset(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "datasetDescription" in value; - isInstance = isInstance && "datasetName" in value; - isInstance = isInstance && "mainFile" in value; - isInstance = isInstance && "upload" in value; - - return isInstance; +export function instanceOfAutoCreateDataset(value: object): value is AutoCreateDataset { + if (!('datasetDescription' in value) || value['datasetDescription'] === undefined) return false; + if (!('datasetName' in value) || value['datasetName'] === undefined) return false; + if (!('mainFile' in value) || value['mainFile'] === undefined) return false; + if (!('upload' in value) || value['upload'] === undefined) return false; + return true; } export function AutoCreateDatasetFromJSON(json: any): AutoCreateDataset { @@ -75,35 +73,37 @@ export function AutoCreateDatasetFromJSON(json: any): AutoCreateDataset { } export function AutoCreateDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoCreateDataset { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'datasetDescription': json['datasetDescription'], 'datasetName': json['datasetName'], - 'layerName': !exists(json, 'layerName') ? undefined : json['layerName'], + 'layerName': json['layerName'] == null ? undefined : json['layerName'], 'mainFile': json['mainFile'], - 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'tags': json['tags'] == null ? undefined : json['tags'], 'upload': json['upload'], }; } -export function AutoCreateDatasetToJSON(value?: AutoCreateDataset | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function AutoCreateDatasetToJSON(json: any): AutoCreateDataset { + return AutoCreateDatasetToJSONTyped(json, false); +} + +export function AutoCreateDatasetToJSONTyped(value?: AutoCreateDataset | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'datasetDescription': value.datasetDescription, - 'datasetName': value.datasetName, - 'layerName': value.layerName, - 'mainFile': value.mainFile, - 'tags': value.tags, - 'upload': value.upload, + 'datasetDescription': value['datasetDescription'], + 'datasetName': value['datasetName'], + 'layerName': value['layerName'], + 'mainFile': value['mainFile'], + 'tags': value['tags'], + 'upload': value['upload'], }; } diff --git a/typescript/src/models/AxisOrder.ts b/typescript/src/models/AxisOrder.ts index c790cf8d..fcc8f48a 100644 --- a/typescript/src/models/AxisOrder.ts +++ b/typescript/src/models/AxisOrder.ts @@ -24,6 +24,17 @@ export const AxisOrder = { export type AxisOrder = typeof AxisOrder[keyof typeof AxisOrder]; +export function instanceOfAxisOrder(value: any): boolean { + for (const key in AxisOrder) { + if (Object.prototype.hasOwnProperty.call(AxisOrder, key)) { + if (AxisOrder[key as keyof typeof AxisOrder] === value) { + return true; + } + } + } + return false; +} + export function AxisOrderFromJSON(json: any): AxisOrder { return AxisOrderFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function AxisOrderToJSON(value?: AxisOrder | null): any { return value as any; } +export function AxisOrderToJSONTyped(value: any, ignoreDiscriminator: boolean): AxisOrder { + return value as AxisOrder; +} + diff --git a/typescript/src/models/BoundingBox2D.ts b/typescript/src/models/BoundingBox2D.ts index 85fff6a3..ce24b495 100644 --- a/typescript/src/models/BoundingBox2D.ts +++ b/typescript/src/models/BoundingBox2D.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Coordinate2D } from './Coordinate2D'; import { Coordinate2DFromJSON, Coordinate2DFromJSONTyped, Coordinate2DToJSON, + Coordinate2DToJSONTyped, } from './Coordinate2D'; /** @@ -44,12 +45,10 @@ export interface BoundingBox2D { /** * Check if a given object implements the BoundingBox2D interface. */ -export function instanceOfBoundingBox2D(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "lowerLeftCoordinate" in value; - isInstance = isInstance && "upperRightCoordinate" in value; - - return isInstance; +export function instanceOfBoundingBox2D(value: object): value is BoundingBox2D { + if (!('lowerLeftCoordinate' in value) || value['lowerLeftCoordinate'] === undefined) return false; + if (!('upperRightCoordinate' in value) || value['upperRightCoordinate'] === undefined) return false; + return true; } export function BoundingBox2DFromJSON(json: any): BoundingBox2D { @@ -57,7 +56,7 @@ export function BoundingBox2DFromJSON(json: any): BoundingBox2D { } export function BoundingBox2DFromJSONTyped(json: any, ignoreDiscriminator: boolean): BoundingBox2D { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,17 +66,19 @@ export function BoundingBox2DFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function BoundingBox2DToJSON(value?: BoundingBox2D | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function BoundingBox2DToJSON(json: any): BoundingBox2D { + return BoundingBox2DToJSONTyped(json, false); +} + +export function BoundingBox2DToJSONTyped(value?: BoundingBox2D | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'lowerLeftCoordinate': Coordinate2DToJSON(value.lowerLeftCoordinate), - 'upperRightCoordinate': Coordinate2DToJSON(value.upperRightCoordinate), + 'lowerLeftCoordinate': Coordinate2DToJSON(value['lowerLeftCoordinate']), + 'upperRightCoordinate': Coordinate2DToJSON(value['upperRightCoordinate']), }; } diff --git a/typescript/src/models/Breakpoint.ts b/typescript/src/models/Breakpoint.ts index 4f041bdc..474f081c 100644 --- a/typescript/src/models/Breakpoint.ts +++ b/typescript/src/models/Breakpoint.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface Breakpoint { /** * Check if a given object implements the Breakpoint interface. */ -export function instanceOfBreakpoint(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "color" in value; - isInstance = isInstance && "value" in value; - - return isInstance; +export function instanceOfBreakpoint(value: object): value is Breakpoint { + if (!('color' in value) || value['color'] === undefined) return false; + if (!('value' in value) || value['value'] === undefined) return false; + return true; } export function BreakpointFromJSON(json: any): Breakpoint { @@ -49,7 +47,7 @@ export function BreakpointFromJSON(json: any): Breakpoint { } export function BreakpointFromJSONTyped(json: any, ignoreDiscriminator: boolean): Breakpoint { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function BreakpointFromJSONTyped(json: any, ignoreDiscriminator: boolean) }; } -export function BreakpointToJSON(value?: Breakpoint | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function BreakpointToJSON(json: any): Breakpoint { + return BreakpointToJSONTyped(json, false); +} + +export function BreakpointToJSONTyped(value?: Breakpoint | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'color': value.color, - 'value': value.value, + 'color': value['color'], + 'value': value['value'], }; } diff --git a/typescript/src/models/ClassificationMeasurement.ts b/typescript/src/models/ClassificationMeasurement.ts index c11d8e06..571f6f0c 100644 --- a/typescript/src/models/ClassificationMeasurement.ts +++ b/typescript/src/models/ClassificationMeasurement.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -52,13 +52,11 @@ export type ClassificationMeasurementTypeEnum = typeof ClassificationMeasurement /** * Check if a given object implements the ClassificationMeasurement interface. */ -export function instanceOfClassificationMeasurement(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "classes" in value; - isInstance = isInstance && "measurement" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfClassificationMeasurement(value: object): value is ClassificationMeasurement { + if (!('classes' in value) || value['classes'] === undefined) return false; + if (!('measurement' in value) || value['measurement'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function ClassificationMeasurementFromJSON(json: any): ClassificationMeasurement { @@ -66,7 +64,7 @@ export function ClassificationMeasurementFromJSON(json: any): ClassificationMeas } export function ClassificationMeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClassificationMeasurement { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -77,18 +75,20 @@ export function ClassificationMeasurementFromJSONTyped(json: any, ignoreDiscrimi }; } -export function ClassificationMeasurementToJSON(value?: ClassificationMeasurement | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ClassificationMeasurementToJSON(json: any): ClassificationMeasurement { + return ClassificationMeasurementToJSONTyped(json, false); +} + +export function ClassificationMeasurementToJSONTyped(value?: ClassificationMeasurement | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'classes': value.classes, - 'measurement': value.measurement, - 'type': value.type, + 'classes': value['classes'], + 'measurement': value['measurement'], + 'type': value['type'], }; } diff --git a/typescript/src/models/CollectionItem.ts b/typescript/src/models/CollectionItem.ts index 0e39c872..a7bf9a9b 100644 --- a/typescript/src/models/CollectionItem.ts +++ b/typescript/src/models/CollectionItem.ts @@ -12,15 +12,15 @@ * Do not edit the class manually. */ +import type { LayerCollectionListing } from './LayerCollectionListing'; import { - LayerCollectionListing, instanceOfLayerCollectionListing, LayerCollectionListingFromJSON, LayerCollectionListingFromJSONTyped, LayerCollectionListingToJSON, } from './LayerCollectionListing'; +import type { LayerListing } from './LayerListing'; import { - LayerListing, instanceOfLayerListing, LayerListingFromJSON, LayerListingFromJSONTyped, @@ -39,31 +39,32 @@ export function CollectionItemFromJSON(json: any): CollectionItem { } export function CollectionItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionItem { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'collection': - return {...LayerCollectionListingFromJSONTyped(json, true), type: 'collection'}; + return Object.assign({}, LayerCollectionListingFromJSONTyped(json, true), { type: 'collection' } as const); case 'layer': - return {...LayerListingFromJSONTyped(json, true), type: 'layer'}; + return Object.assign({}, LayerListingFromJSONTyped(json, true), { type: 'layer' } as const); default: throw new Error(`No variant of CollectionItem exists with 'type=${json['type']}'`); } } -export function CollectionItemToJSON(value?: CollectionItem | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function CollectionItemToJSON(json: any): any { + return CollectionItemToJSONTyped(json, false); +} + +export function CollectionItemToJSONTyped(value?: CollectionItem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'collection': - return LayerCollectionListingToJSON(value); + return Object.assign({}, LayerCollectionListingToJSON(value), { type: 'collection' } as const); case 'layer': - return LayerListingToJSON(value); + return Object.assign({}, LayerListingToJSON(value), { type: 'layer' } as const); default: throw new Error(`No variant of CollectionItem exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/CollectionType.ts b/typescript/src/models/CollectionType.ts index 846092f7..02fe95fb 100644 --- a/typescript/src/models/CollectionType.ts +++ b/typescript/src/models/CollectionType.ts @@ -23,6 +23,17 @@ export const CollectionType = { export type CollectionType = typeof CollectionType[keyof typeof CollectionType]; +export function instanceOfCollectionType(value: any): boolean { + for (const key in CollectionType) { + if (Object.prototype.hasOwnProperty.call(CollectionType, key)) { + if (CollectionType[key as keyof typeof CollectionType] === value) { + return true; + } + } + } + return false; +} + export function CollectionTypeFromJSON(json: any): CollectionType { return CollectionTypeFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function CollectionTypeToJSON(value?: CollectionType | null): any { return value as any; } +export function CollectionTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): CollectionType { + return value as CollectionType; +} + diff --git a/typescript/src/models/ColorParam.ts b/typescript/src/models/ColorParam.ts index 014632fe..fc216bbd 100644 --- a/typescript/src/models/ColorParam.ts +++ b/typescript/src/models/ColorParam.ts @@ -12,15 +12,15 @@ * Do not edit the class manually. */ +import type { ColorParamStatic } from './ColorParamStatic'; import { - ColorParamStatic, instanceOfColorParamStatic, ColorParamStaticFromJSON, ColorParamStaticFromJSONTyped, ColorParamStaticToJSON, } from './ColorParamStatic'; +import type { DerivedColor } from './DerivedColor'; import { - DerivedColor, instanceOfDerivedColor, DerivedColorFromJSON, DerivedColorFromJSONTyped, @@ -39,31 +39,32 @@ export function ColorParamFromJSON(json: any): ColorParam { } export function ColorParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): ColorParam { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'derived': - return {...DerivedColorFromJSONTyped(json, true), type: 'derived'}; + return Object.assign({}, DerivedColorFromJSONTyped(json, true), { type: 'derived' } as const); case 'static': - return {...ColorParamStaticFromJSONTyped(json, true), type: 'static'}; + return Object.assign({}, ColorParamStaticFromJSONTyped(json, true), { type: 'static' } as const); default: throw new Error(`No variant of ColorParam exists with 'type=${json['type']}'`); } } -export function ColorParamToJSON(value?: ColorParam | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ColorParamToJSON(json: any): any { + return ColorParamToJSONTyped(json, false); +} + +export function ColorParamToJSONTyped(value?: ColorParam | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'derived': - return DerivedColorToJSON(value); + return Object.assign({}, DerivedColorToJSON(value), { type: 'derived' } as const); case 'static': - return ColorParamStaticToJSON(value); + return Object.assign({}, ColorParamStaticToJSON(value), { type: 'static' } as const); default: throw new Error(`No variant of ColorParam exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/ColorParamStatic.ts b/typescript/src/models/ColorParamStatic.ts index ddd9c506..6238c2af 100644 --- a/typescript/src/models/ColorParamStatic.ts +++ b/typescript/src/models/ColorParamStatic.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -38,8 +38,7 @@ export interface ColorParamStatic { * @export */ export const ColorParamStaticTypeEnum = { - Static: 'static', - Derived: 'derived' + Static: 'static' } as const; export type ColorParamStaticTypeEnum = typeof ColorParamStaticTypeEnum[keyof typeof ColorParamStaticTypeEnum]; @@ -47,12 +46,10 @@ export type ColorParamStaticTypeEnum = typeof ColorParamStaticTypeEnum[keyof typ /** * Check if a given object implements the ColorParamStatic interface. */ -export function instanceOfColorParamStatic(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "color" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfColorParamStatic(value: object): value is ColorParamStatic { + if (!('color' in value) || value['color'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function ColorParamStaticFromJSON(json: any): ColorParamStatic { @@ -60,7 +57,7 @@ export function ColorParamStaticFromJSON(json: any): ColorParamStatic { } export function ColorParamStaticFromJSONTyped(json: any, ignoreDiscriminator: boolean): ColorParamStatic { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -70,17 +67,19 @@ export function ColorParamStaticFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function ColorParamStaticToJSON(value?: ColorParamStatic | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ColorParamStaticToJSON(json: any): ColorParamStatic { + return ColorParamStaticToJSONTyped(json, false); +} + +export function ColorParamStaticToJSONTyped(value?: ColorParamStatic | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'color': value.color, - 'type': value.type, + 'color': value['color'], + 'type': value['type'], }; } diff --git a/typescript/src/models/Colorizer.ts b/typescript/src/models/Colorizer.ts index 257609b8..f71e755e 100644 --- a/typescript/src/models/Colorizer.ts +++ b/typescript/src/models/Colorizer.ts @@ -12,22 +12,22 @@ * Do not edit the class manually. */ +import type { LinearGradient } from './LinearGradient'; import { - LinearGradient, instanceOfLinearGradient, LinearGradientFromJSON, LinearGradientFromJSONTyped, LinearGradientToJSON, } from './LinearGradient'; +import type { LogarithmicGradient } from './LogarithmicGradient'; import { - LogarithmicGradient, instanceOfLogarithmicGradient, LogarithmicGradientFromJSON, LogarithmicGradientFromJSONTyped, LogarithmicGradientToJSON, } from './LogarithmicGradient'; +import type { PaletteColorizer } from './PaletteColorizer'; import { - PaletteColorizer, instanceOfPaletteColorizer, PaletteColorizerFromJSON, PaletteColorizerFromJSONTyped, @@ -46,35 +46,36 @@ export function ColorizerFromJSON(json: any): Colorizer { } export function ColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): Colorizer { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'linearGradient': - return {...LinearGradientFromJSONTyped(json, true), type: 'linearGradient'}; + return Object.assign({}, LinearGradientFromJSONTyped(json, true), { type: 'linearGradient' } as const); case 'logarithmicGradient': - return {...LogarithmicGradientFromJSONTyped(json, true), type: 'logarithmicGradient'}; + return Object.assign({}, LogarithmicGradientFromJSONTyped(json, true), { type: 'logarithmicGradient' } as const); case 'palette': - return {...PaletteColorizerFromJSONTyped(json, true), type: 'palette'}; + return Object.assign({}, PaletteColorizerFromJSONTyped(json, true), { type: 'palette' } as const); default: throw new Error(`No variant of Colorizer exists with 'type=${json['type']}'`); } } -export function ColorizerToJSON(value?: Colorizer | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ColorizerToJSON(json: any): any { + return ColorizerToJSONTyped(json, false); +} + +export function ColorizerToJSONTyped(value?: Colorizer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'linearGradient': - return LinearGradientToJSON(value); + return Object.assign({}, LinearGradientToJSON(value), { type: 'linearGradient' } as const); case 'logarithmicGradient': - return LogarithmicGradientToJSON(value); + return Object.assign({}, LogarithmicGradientToJSON(value), { type: 'logarithmicGradient' } as const); case 'palette': - return PaletteColorizerToJSON(value); + return Object.assign({}, PaletteColorizerToJSON(value), { type: 'palette' } as const); default: throw new Error(`No variant of Colorizer exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/ComputationQuota.ts b/typescript/src/models/ComputationQuota.ts index 92bc43fe..5c5e6fad 100644 --- a/typescript/src/models/ComputationQuota.ts +++ b/typescript/src/models/ComputationQuota.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -48,14 +48,12 @@ export interface ComputationQuota { /** * Check if a given object implements the ComputationQuota interface. */ -export function instanceOfComputationQuota(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "computationId" in value; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "timestamp" in value; - isInstance = isInstance && "workflowId" in value; - - return isInstance; +export function instanceOfComputationQuota(value: object): value is ComputationQuota { + if (!('computationId' in value) || value['computationId'] === undefined) return false; + if (!('count' in value) || value['count'] === undefined) return false; + if (!('timestamp' in value) || value['timestamp'] === undefined) return false; + if (!('workflowId' in value) || value['workflowId'] === undefined) return false; + return true; } export function ComputationQuotaFromJSON(json: any): ComputationQuota { @@ -63,7 +61,7 @@ export function ComputationQuotaFromJSON(json: any): ComputationQuota { } export function ComputationQuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): ComputationQuota { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,19 +73,21 @@ export function ComputationQuotaFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function ComputationQuotaToJSON(value?: ComputationQuota | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ComputationQuotaToJSON(json: any): ComputationQuota { + return ComputationQuotaToJSONTyped(json, false); +} + +export function ComputationQuotaToJSONTyped(value?: ComputationQuota | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'computationId': value.computationId, - 'count': value.count, - 'timestamp': (value.timestamp.toISOString()), - 'workflowId': value.workflowId, + 'computationId': value['computationId'], + 'count': value['count'], + 'timestamp': ((value['timestamp']).toISOString()), + 'workflowId': value['workflowId'], }; } diff --git a/typescript/src/models/ContinuousMeasurement.ts b/typescript/src/models/ContinuousMeasurement.ts index 736fbed1..1667ffd5 100644 --- a/typescript/src/models/ContinuousMeasurement.ts +++ b/typescript/src/models/ContinuousMeasurement.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -52,12 +52,10 @@ export type ContinuousMeasurementTypeEnum = typeof ContinuousMeasurementTypeEnum /** * Check if a given object implements the ContinuousMeasurement interface. */ -export function instanceOfContinuousMeasurement(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "measurement" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfContinuousMeasurement(value: object): value is ContinuousMeasurement { + if (!('measurement' in value) || value['measurement'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function ContinuousMeasurementFromJSON(json: any): ContinuousMeasurement { @@ -65,29 +63,31 @@ export function ContinuousMeasurementFromJSON(json: any): ContinuousMeasurement } export function ContinuousMeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContinuousMeasurement { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'measurement': json['measurement'], 'type': json['type'], - 'unit': !exists(json, 'unit') ? undefined : json['unit'], + 'unit': json['unit'] == null ? undefined : json['unit'], }; } -export function ContinuousMeasurementToJSON(value?: ContinuousMeasurement | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ContinuousMeasurementToJSON(json: any): ContinuousMeasurement { + return ContinuousMeasurementToJSONTyped(json, false); +} + +export function ContinuousMeasurementToJSONTyped(value?: ContinuousMeasurement | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'measurement': value.measurement, - 'type': value.type, - 'unit': value.unit, + 'measurement': value['measurement'], + 'type': value['type'], + 'unit': value['unit'], }; } diff --git a/typescript/src/models/Coordinate2D.ts b/typescript/src/models/Coordinate2D.ts index 3659cf80..e5d3cf4e 100644 --- a/typescript/src/models/Coordinate2D.ts +++ b/typescript/src/models/Coordinate2D.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface Coordinate2D { /** * Check if a given object implements the Coordinate2D interface. */ -export function instanceOfCoordinate2D(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "x" in value; - isInstance = isInstance && "y" in value; - - return isInstance; +export function instanceOfCoordinate2D(value: object): value is Coordinate2D { + if (!('x' in value) || value['x'] === undefined) return false; + if (!('y' in value) || value['y'] === undefined) return false; + return true; } export function Coordinate2DFromJSON(json: any): Coordinate2D { @@ -49,7 +47,7 @@ export function Coordinate2DFromJSON(json: any): Coordinate2D { } export function Coordinate2DFromJSONTyped(json: any, ignoreDiscriminator: boolean): Coordinate2D { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function Coordinate2DFromJSONTyped(json: any, ignoreDiscriminator: boolea }; } -export function Coordinate2DToJSON(value?: Coordinate2D | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function Coordinate2DToJSON(json: any): Coordinate2D { + return Coordinate2DToJSONTyped(json, false); +} + +export function Coordinate2DToJSONTyped(value?: Coordinate2D | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'x': value.x, - 'y': value.y, + 'x': value['x'], + 'y': value['y'], }; } diff --git a/typescript/src/models/CreateDataset.ts b/typescript/src/models/CreateDataset.ts index 6061d1f6..e62d7b48 100644 --- a/typescript/src/models/CreateDataset.ts +++ b/typescript/src/models/CreateDataset.ts @@ -12,18 +12,20 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { DataPath } from './DataPath'; import { DataPathFromJSON, DataPathFromJSONTyped, DataPathToJSON, + DataPathToJSONTyped, } from './DataPath'; import type { DatasetDefinition } from './DatasetDefinition'; import { DatasetDefinitionFromJSON, DatasetDefinitionFromJSONTyped, DatasetDefinitionToJSON, + DatasetDefinitionToJSONTyped, } from './DatasetDefinition'; /** @@ -49,12 +51,10 @@ export interface CreateDataset { /** * Check if a given object implements the CreateDataset interface. */ -export function instanceOfCreateDataset(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "dataPath" in value; - isInstance = isInstance && "definition" in value; - - return isInstance; +export function instanceOfCreateDataset(value: object): value is CreateDataset { + if (!('dataPath' in value) || value['dataPath'] === undefined) return false; + if (!('definition' in value) || value['definition'] === undefined) return false; + return true; } export function CreateDatasetFromJSON(json: any): CreateDataset { @@ -62,7 +62,7 @@ export function CreateDatasetFromJSON(json: any): CreateDataset { } export function CreateDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDataset { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -72,17 +72,19 @@ export function CreateDatasetFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function CreateDatasetToJSON(value?: CreateDataset | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function CreateDatasetToJSON(json: any): CreateDataset { + return CreateDatasetToJSONTyped(json, false); +} + +export function CreateDatasetToJSONTyped(value?: CreateDataset | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'dataPath': DataPathToJSON(value.dataPath), - 'definition': DatasetDefinitionToJSON(value.definition), + 'dataPath': DataPathToJSON(value['dataPath']), + 'definition': DatasetDefinitionToJSON(value['definition']), }; } diff --git a/typescript/src/models/CreateDatasetHandler200Response.ts b/typescript/src/models/CreateDatasetHandler200Response.ts index fa91ba1d..e1d546af 100644 --- a/typescript/src/models/CreateDatasetHandler200Response.ts +++ b/typescript/src/models/CreateDatasetHandler200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface CreateDatasetHandler200Response { /** * Check if a given object implements the CreateDatasetHandler200Response interface. */ -export function instanceOfCreateDatasetHandler200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "datasetName" in value; - - return isInstance; +export function instanceOfCreateDatasetHandler200Response(value: object): value is CreateDatasetHandler200Response { + if (!('datasetName' in value) || value['datasetName'] === undefined) return false; + return true; } export function CreateDatasetHandler200ResponseFromJSON(json: any): CreateDatasetHandler200Response { @@ -42,7 +40,7 @@ export function CreateDatasetHandler200ResponseFromJSON(json: any): CreateDatase } export function CreateDatasetHandler200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDatasetHandler200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function CreateDatasetHandler200ResponseFromJSONTyped(json: any, ignoreDi }; } -export function CreateDatasetHandler200ResponseToJSON(value?: CreateDatasetHandler200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function CreateDatasetHandler200ResponseToJSON(json: any): CreateDatasetHandler200Response { + return CreateDatasetHandler200ResponseToJSONTyped(json, false); +} + +export function CreateDatasetHandler200ResponseToJSONTyped(value?: CreateDatasetHandler200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'datasetName': value.datasetName, + 'datasetName': value['datasetName'], }; } diff --git a/typescript/src/models/CreateProject.ts b/typescript/src/models/CreateProject.ts index 85a5cbdd..d45c2483 100644 --- a/typescript/src/models/CreateProject.ts +++ b/typescript/src/models/CreateProject.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { STRectangle } from './STRectangle'; -import { - STRectangleFromJSON, - STRectangleFromJSONTyped, - STRectangleToJSON, -} from './STRectangle'; +import { mapValues } from '../runtime'; import type { TimeStep } from './TimeStep'; import { TimeStepFromJSON, TimeStepFromJSONTyped, TimeStepToJSON, + TimeStepToJSONTyped, } from './TimeStep'; +import type { STRectangle } from './STRectangle'; +import { + STRectangleFromJSON, + STRectangleFromJSONTyped, + STRectangleToJSON, + STRectangleToJSONTyped, +} from './STRectangle'; /** * @@ -61,13 +63,11 @@ export interface CreateProject { /** * Check if a given object implements the CreateProject interface. */ -export function instanceOfCreateProject(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "bounds" in value; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - - return isInstance; +export function instanceOfCreateProject(value: object): value is CreateProject { + if (!('bounds' in value) || value['bounds'] === undefined) return false; + if (!('description' in value) || value['description'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + return true; } export function CreateProjectFromJSON(json: any): CreateProject { @@ -75,7 +75,7 @@ export function CreateProjectFromJSON(json: any): CreateProject { } export function CreateProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateProject { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -83,23 +83,25 @@ export function CreateProjectFromJSONTyped(json: any, ignoreDiscriminator: boole 'bounds': STRectangleFromJSON(json['bounds']), 'description': json['description'], 'name': json['name'], - 'timeStep': !exists(json, 'timeStep') ? undefined : TimeStepFromJSON(json['timeStep']), + 'timeStep': json['timeStep'] == null ? undefined : TimeStepFromJSON(json['timeStep']), }; } -export function CreateProjectToJSON(value?: CreateProject | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function CreateProjectToJSON(json: any): CreateProject { + return CreateProjectToJSONTyped(json, false); +} + +export function CreateProjectToJSONTyped(value?: CreateProject | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bounds': STRectangleToJSON(value.bounds), - 'description': value.description, - 'name': value.name, - 'timeStep': TimeStepToJSON(value.timeStep), + 'bounds': STRectangleToJSON(value['bounds']), + 'description': value['description'], + 'name': value['name'], + 'timeStep': TimeStepToJSON(value['timeStep']), }; } diff --git a/typescript/src/models/CsvHeader.ts b/typescript/src/models/CsvHeader.ts index ab5888ad..37a11df1 100644 --- a/typescript/src/models/CsvHeader.ts +++ b/typescript/src/models/CsvHeader.ts @@ -25,6 +25,17 @@ export const CsvHeader = { export type CsvHeader = typeof CsvHeader[keyof typeof CsvHeader]; +export function instanceOfCsvHeader(value: any): boolean { + for (const key in CsvHeader) { + if (Object.prototype.hasOwnProperty.call(CsvHeader, key)) { + if (CsvHeader[key as keyof typeof CsvHeader] === value) { + return true; + } + } + } + return false; +} + export function CsvHeaderFromJSON(json: any): CsvHeader { return CsvHeaderFromJSONTyped(json, false); } @@ -37,3 +48,7 @@ export function CsvHeaderToJSON(value?: CsvHeader | null): any { return value as any; } +export function CsvHeaderToJSONTyped(value: any, ignoreDiscriminator: boolean): CsvHeader { + return value as CsvHeader; +} + diff --git a/typescript/src/models/DataId.ts b/typescript/src/models/DataId.ts index 25e81b38..9d38e5eb 100644 --- a/typescript/src/models/DataId.ts +++ b/typescript/src/models/DataId.ts @@ -12,15 +12,15 @@ * Do not edit the class manually. */ +import type { ExternalDataId } from './ExternalDataId'; import { - ExternalDataId, instanceOfExternalDataId, ExternalDataIdFromJSON, ExternalDataIdFromJSONTyped, ExternalDataIdToJSON, } from './ExternalDataId'; +import type { InternalDataId } from './InternalDataId'; import { - InternalDataId, instanceOfInternalDataId, InternalDataIdFromJSON, InternalDataIdFromJSONTyped, @@ -39,31 +39,32 @@ export function DataIdFromJSON(json: any): DataId { } export function DataIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataId { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'external': - return {...ExternalDataIdFromJSONTyped(json, true), type: 'external'}; + return Object.assign({}, ExternalDataIdFromJSONTyped(json, true), { type: 'external' } as const); case 'internal': - return {...InternalDataIdFromJSONTyped(json, true), type: 'internal'}; + return Object.assign({}, InternalDataIdFromJSONTyped(json, true), { type: 'internal' } as const); default: throw new Error(`No variant of DataId exists with 'type=${json['type']}'`); } } -export function DataIdToJSON(value?: DataId | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DataIdToJSON(json: any): any { + return DataIdToJSONTyped(json, false); +} + +export function DataIdToJSONTyped(value?: DataId | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'external': - return ExternalDataIdToJSON(value); + return Object.assign({}, ExternalDataIdToJSON(value), { type: 'external' } as const); case 'internal': - return InternalDataIdToJSON(value); + return Object.assign({}, InternalDataIdToJSON(value), { type: 'internal' } as const); default: throw new Error(`No variant of DataId exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/DataPath.ts b/typescript/src/models/DataPath.ts index 351bdf23..ba847ea6 100644 --- a/typescript/src/models/DataPath.ts +++ b/typescript/src/models/DataPath.ts @@ -12,15 +12,15 @@ * Do not edit the class manually. */ +import type { DataPathOneOf } from './DataPathOneOf'; import { - DataPathOneOf, instanceOfDataPathOneOf, DataPathOneOfFromJSON, DataPathOneOfFromJSONTyped, DataPathOneOfToJSON, } from './DataPathOneOf'; +import type { DataPathOneOf1 } from './DataPathOneOf1'; import { - DataPathOneOf1, instanceOfDataPathOneOf1, DataPathOneOf1FromJSON, DataPathOneOf1FromJSONTyped, @@ -39,18 +39,26 @@ export function DataPathFromJSON(json: any): DataPath { } export function DataPathFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataPath { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - return { ...DataPathOneOfFromJSONTyped(json, true), ...DataPathOneOf1FromJSONTyped(json, true) }; + if (instanceOfDataPathOneOf(json)) { + return DataPathOneOfFromJSONTyped(json, true); + } + if (instanceOfDataPathOneOf1(json)) { + return DataPathOneOf1FromJSONTyped(json, true); + } + + return {} as any; } -export function DataPathToJSON(value?: DataPath | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DataPathToJSON(json: any): any { + return DataPathToJSONTyped(json, false); +} + +export function DataPathToJSONTyped(value?: DataPath | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } if (instanceOfDataPathOneOf(value)) { diff --git a/typescript/src/models/DataPathOneOf.ts b/typescript/src/models/DataPathOneOf.ts index b05e7239..5b04590a 100644 --- a/typescript/src/models/DataPathOneOf.ts +++ b/typescript/src/models/DataPathOneOf.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface DataPathOneOf { /** * Check if a given object implements the DataPathOneOf interface. */ -export function instanceOfDataPathOneOf(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "volume" in value; - - return isInstance; +export function instanceOfDataPathOneOf(value: object): value is DataPathOneOf { + if (!('volume' in value) || value['volume'] === undefined) return false; + return true; } export function DataPathOneOfFromJSON(json: any): DataPathOneOf { @@ -42,7 +40,7 @@ export function DataPathOneOfFromJSON(json: any): DataPathOneOf { } export function DataPathOneOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataPathOneOf { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function DataPathOneOfFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function DataPathOneOfToJSON(value?: DataPathOneOf | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DataPathOneOfToJSON(json: any): DataPathOneOf { + return DataPathOneOfToJSONTyped(json, false); +} + +export function DataPathOneOfToJSONTyped(value?: DataPathOneOf | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'volume': value.volume, + 'volume': value['volume'], }; } diff --git a/typescript/src/models/DataPathOneOf1.ts b/typescript/src/models/DataPathOneOf1.ts index 52ec8051..7db17c9b 100644 --- a/typescript/src/models/DataPathOneOf1.ts +++ b/typescript/src/models/DataPathOneOf1.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface DataPathOneOf1 { /** * Check if a given object implements the DataPathOneOf1 interface. */ -export function instanceOfDataPathOneOf1(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "upload" in value; - - return isInstance; +export function instanceOfDataPathOneOf1(value: object): value is DataPathOneOf1 { + if (!('upload' in value) || value['upload'] === undefined) return false; + return true; } export function DataPathOneOf1FromJSON(json: any): DataPathOneOf1 { @@ -42,7 +40,7 @@ export function DataPathOneOf1FromJSON(json: any): DataPathOneOf1 { } export function DataPathOneOf1FromJSONTyped(json: any, ignoreDiscriminator: boolean): DataPathOneOf1 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function DataPathOneOf1FromJSONTyped(json: any, ignoreDiscriminator: bool }; } -export function DataPathOneOf1ToJSON(value?: DataPathOneOf1 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DataPathOneOf1ToJSON(json: any): DataPathOneOf1 { + return DataPathOneOf1ToJSONTyped(json, false); +} + +export function DataPathOneOf1ToJSONTyped(value?: DataPathOneOf1 | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'upload': value.upload, + 'upload': value['upload'], }; } diff --git a/typescript/src/models/DataUsage.ts b/typescript/src/models/DataUsage.ts index 39586ffe..20ef7a4a 100644 --- a/typescript/src/models/DataUsage.ts +++ b/typescript/src/models/DataUsage.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -54,15 +54,13 @@ export interface DataUsage { /** * Check if a given object implements the DataUsage interface. */ -export function instanceOfDataUsage(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "computationId" in value; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "timestamp" in value; - isInstance = isInstance && "userId" in value; - - return isInstance; +export function instanceOfDataUsage(value: object): value is DataUsage { + if (!('computationId' in value) || value['computationId'] === undefined) return false; + if (!('count' in value) || value['count'] === undefined) return false; + if (!('data' in value) || value['data'] === undefined) return false; + if (!('timestamp' in value) || value['timestamp'] === undefined) return false; + if (!('userId' in value) || value['userId'] === undefined) return false; + return true; } export function DataUsageFromJSON(json: any): DataUsage { @@ -70,7 +68,7 @@ export function DataUsageFromJSON(json: any): DataUsage { } export function DataUsageFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataUsage { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -83,20 +81,22 @@ export function DataUsageFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function DataUsageToJSON(value?: DataUsage | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DataUsageToJSON(json: any): DataUsage { + return DataUsageToJSONTyped(json, false); +} + +export function DataUsageToJSONTyped(value?: DataUsage | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'computationId': value.computationId, - 'count': value.count, - 'data': value.data, - 'timestamp': (value.timestamp.toISOString()), - 'userId': value.userId, + 'computationId': value['computationId'], + 'count': value['count'], + 'data': value['data'], + 'timestamp': ((value['timestamp']).toISOString()), + 'userId': value['userId'], }; } diff --git a/typescript/src/models/DataUsageSummary.ts b/typescript/src/models/DataUsageSummary.ts index c8f0cb18..d64bb22a 100644 --- a/typescript/src/models/DataUsageSummary.ts +++ b/typescript/src/models/DataUsageSummary.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -42,13 +42,11 @@ export interface DataUsageSummary { /** * Check if a given object implements the DataUsageSummary interface. */ -export function instanceOfDataUsageSummary(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "timestamp" in value; - - return isInstance; +export function instanceOfDataUsageSummary(value: object): value is DataUsageSummary { + if (!('count' in value) || value['count'] === undefined) return false; + if (!('data' in value) || value['data'] === undefined) return false; + if (!('timestamp' in value) || value['timestamp'] === undefined) return false; + return true; } export function DataUsageSummaryFromJSON(json: any): DataUsageSummary { @@ -56,7 +54,7 @@ export function DataUsageSummaryFromJSON(json: any): DataUsageSummary { } export function DataUsageSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataUsageSummary { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,18 +65,20 @@ export function DataUsageSummaryFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function DataUsageSummaryToJSON(value?: DataUsageSummary | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DataUsageSummaryToJSON(json: any): DataUsageSummary { + return DataUsageSummaryToJSONTyped(json, false); +} + +export function DataUsageSummaryToJSONTyped(value?: DataUsageSummary | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'count': value.count, - 'data': value.data, - 'timestamp': (value.timestamp.toISOString()), + 'count': value['count'], + 'data': value['data'], + 'timestamp': ((value['timestamp']).toISOString()), }; } diff --git a/typescript/src/models/Dataset.ts b/typescript/src/models/Dataset.ts index 51ca110d..1df8ef22 100644 --- a/typescript/src/models/Dataset.ts +++ b/typescript/src/models/Dataset.ts @@ -12,24 +12,27 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Provenance } from './Provenance'; import { ProvenanceFromJSON, ProvenanceFromJSONTyped, ProvenanceToJSON, + ProvenanceToJSONTyped, } from './Provenance'; import type { Symbology } from './Symbology'; import { SymbologyFromJSON, SymbologyFromJSONTyped, SymbologyToJSON, + SymbologyToJSONTyped, } from './Symbology'; import type { TypedResultDescriptor } from './TypedResultDescriptor'; import { TypedResultDescriptorFromJSON, TypedResultDescriptorFromJSONTyped, TypedResultDescriptorToJSON, + TypedResultDescriptorToJSONTyped, } from './TypedResultDescriptor'; /** @@ -97,16 +100,14 @@ export interface Dataset { /** * Check if a given object implements the Dataset interface. */ -export function instanceOfDataset(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "sourceOperator" in value; - - return isInstance; +export function instanceOfDataset(value: object): value is Dataset { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) return false; + if (!('sourceOperator' in value) || value['sourceOperator'] === undefined) return false; + return true; } export function DatasetFromJSON(json: any): Dataset { @@ -114,7 +115,7 @@ export function DatasetFromJSON(json: any): Dataset { } export function DatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Dataset { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -123,32 +124,34 @@ export function DatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): D 'displayName': json['displayName'], 'id': json['id'], 'name': json['name'], - 'provenance': !exists(json, 'provenance') ? undefined : (json['provenance'] === null ? null : (json['provenance'] as Array).map(ProvenanceFromJSON)), + 'provenance': json['provenance'] == null ? undefined : ((json['provenance'] as Array).map(ProvenanceFromJSON)), 'resultDescriptor': TypedResultDescriptorFromJSON(json['resultDescriptor']), 'sourceOperator': json['sourceOperator'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), - 'tags': !exists(json, 'tags') ? undefined : json['tags'], + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), + 'tags': json['tags'] == null ? undefined : json['tags'], }; } -export function DatasetToJSON(value?: Dataset | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DatasetToJSON(json: any): Dataset { + return DatasetToJSONTyped(json, false); +} + +export function DatasetToJSONTyped(value?: Dataset | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'displayName': value.displayName, - 'id': value.id, - 'name': value.name, - 'provenance': value.provenance === undefined ? undefined : (value.provenance === null ? null : (value.provenance as Array).map(ProvenanceToJSON)), - 'resultDescriptor': TypedResultDescriptorToJSON(value.resultDescriptor), - 'sourceOperator': value.sourceOperator, - 'symbology': SymbologyToJSON(value.symbology), - 'tags': value.tags, + 'description': value['description'], + 'displayName': value['displayName'], + 'id': value['id'], + 'name': value['name'], + 'provenance': value['provenance'] == null ? undefined : ((value['provenance'] as Array).map(ProvenanceToJSON)), + 'resultDescriptor': TypedResultDescriptorToJSON(value['resultDescriptor']), + 'sourceOperator': value['sourceOperator'], + 'symbology': SymbologyToJSON(value['symbology']), + 'tags': value['tags'], }; } diff --git a/typescript/src/models/DatasetDefinition.ts b/typescript/src/models/DatasetDefinition.ts index 869f3d7b..bf4be4d0 100644 --- a/typescript/src/models/DatasetDefinition.ts +++ b/typescript/src/models/DatasetDefinition.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { AddDataset } from './AddDataset'; -import { - AddDatasetFromJSON, - AddDatasetFromJSONTyped, - AddDatasetToJSON, -} from './AddDataset'; +import { mapValues } from '../runtime'; import type { MetaDataDefinition } from './MetaDataDefinition'; import { MetaDataDefinitionFromJSON, MetaDataDefinitionFromJSONTyped, MetaDataDefinitionToJSON, + MetaDataDefinitionToJSONTyped, } from './MetaDataDefinition'; +import type { AddDataset } from './AddDataset'; +import { + AddDatasetFromJSON, + AddDatasetFromJSONTyped, + AddDatasetToJSON, + AddDatasetToJSONTyped, +} from './AddDataset'; /** * @@ -49,12 +51,10 @@ export interface DatasetDefinition { /** * Check if a given object implements the DatasetDefinition interface. */ -export function instanceOfDatasetDefinition(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "metaData" in value; - isInstance = isInstance && "properties" in value; - - return isInstance; +export function instanceOfDatasetDefinition(value: object): value is DatasetDefinition { + if (!('metaData' in value) || value['metaData'] === undefined) return false; + if (!('properties' in value) || value['properties'] === undefined) return false; + return true; } export function DatasetDefinitionFromJSON(json: any): DatasetDefinition { @@ -62,7 +62,7 @@ export function DatasetDefinitionFromJSON(json: any): DatasetDefinition { } export function DatasetDefinitionFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatasetDefinition { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -72,17 +72,19 @@ export function DatasetDefinitionFromJSONTyped(json: any, ignoreDiscriminator: b }; } -export function DatasetDefinitionToJSON(value?: DatasetDefinition | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DatasetDefinitionToJSON(json: any): DatasetDefinition { + return DatasetDefinitionToJSONTyped(json, false); +} + +export function DatasetDefinitionToJSONTyped(value?: DatasetDefinition | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'metaData': MetaDataDefinitionToJSON(value.metaData), - 'properties': AddDatasetToJSON(value.properties), + 'metaData': MetaDataDefinitionToJSON(value['metaData']), + 'properties': AddDatasetToJSON(value['properties']), }; } diff --git a/typescript/src/models/DatasetListing.ts b/typescript/src/models/DatasetListing.ts index f397ad93..e997ba62 100644 --- a/typescript/src/models/DatasetListing.ts +++ b/typescript/src/models/DatasetListing.ts @@ -12,18 +12,20 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Symbology } from './Symbology'; import { SymbologyFromJSON, SymbologyFromJSONTyped, SymbologyToJSON, + SymbologyToJSONTyped, } from './Symbology'; import type { TypedResultDescriptor } from './TypedResultDescriptor'; import { TypedResultDescriptorFromJSON, TypedResultDescriptorFromJSONTyped, TypedResultDescriptorToJSON, + TypedResultDescriptorToJSONTyped, } from './TypedResultDescriptor'; /** @@ -85,17 +87,15 @@ export interface DatasetListing { /** * Check if a given object implements the DatasetListing interface. */ -export function instanceOfDatasetListing(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "sourceOperator" in value; - isInstance = isInstance && "tags" in value; - - return isInstance; +export function instanceOfDatasetListing(value: object): value is DatasetListing { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) return false; + if (!('sourceOperator' in value) || value['sourceOperator'] === undefined) return false; + if (!('tags' in value) || value['tags'] === undefined) return false; + return true; } export function DatasetListingFromJSON(json: any): DatasetListing { @@ -103,7 +103,7 @@ export function DatasetListingFromJSON(json: any): DatasetListing { } export function DatasetListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatasetListing { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -114,28 +114,30 @@ export function DatasetListingFromJSONTyped(json: any, ignoreDiscriminator: bool 'name': json['name'], 'resultDescriptor': TypedResultDescriptorFromJSON(json['resultDescriptor']), 'sourceOperator': json['sourceOperator'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), 'tags': json['tags'], }; } -export function DatasetListingToJSON(value?: DatasetListing | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DatasetListingToJSON(json: any): DatasetListing { + return DatasetListingToJSONTyped(json, false); +} + +export function DatasetListingToJSONTyped(value?: DatasetListing | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'displayName': value.displayName, - 'id': value.id, - 'name': value.name, - 'resultDescriptor': TypedResultDescriptorToJSON(value.resultDescriptor), - 'sourceOperator': value.sourceOperator, - 'symbology': SymbologyToJSON(value.symbology), - 'tags': value.tags, + 'description': value['description'], + 'displayName': value['displayName'], + 'id': value['id'], + 'name': value['name'], + 'resultDescriptor': TypedResultDescriptorToJSON(value['resultDescriptor']), + 'sourceOperator': value['sourceOperator'], + 'symbology': SymbologyToJSON(value['symbology']), + 'tags': value['tags'], }; } diff --git a/typescript/src/models/DatasetResource.ts b/typescript/src/models/DatasetResource.ts index 059d57fb..01397425 100644 --- a/typescript/src/models/DatasetResource.ts +++ b/typescript/src/models/DatasetResource.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type DatasetResourceTypeEnum = typeof DatasetResourceTypeEnum[keyof typeo /** * Check if a given object implements the DatasetResource interface. */ -export function instanceOfDatasetResource(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfDatasetResource(value: object): value is DatasetResource { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function DatasetResourceFromJSON(json: any): DatasetResource { @@ -59,7 +57,7 @@ export function DatasetResourceFromJSON(json: any): DatasetResource { } export function DatasetResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatasetResource { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function DatasetResourceFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function DatasetResourceToJSON(value?: DatasetResource | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DatasetResourceToJSON(json: any): DatasetResource { + return DatasetResourceToJSONTyped(json, false); +} + +export function DatasetResourceToJSONTyped(value?: DatasetResource | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/src/models/DateTime.ts b/typescript/src/models/DateTime.ts index 9f2b0619..e03a61f4 100644 --- a/typescript/src/models/DateTime.ts +++ b/typescript/src/models/DateTime.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * An object that composes the date and a timestamp with time zone. * @export @@ -30,11 +30,9 @@ export interface DateTime { /** * Check if a given object implements the DateTime interface. */ -export function instanceOfDateTime(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "datetime" in value; - - return isInstance; +export function instanceOfDateTime(value: object): value is DateTime { + if (!('datetime' in value) || value['datetime'] === undefined) return false; + return true; } export function DateTimeFromJSON(json: any): DateTime { @@ -42,7 +40,7 @@ export function DateTimeFromJSON(json: any): DateTime { } export function DateTimeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DateTime { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function DateTimeFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function DateTimeToJSON(value?: DateTime | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DateTimeToJSON(json: any): DateTime { + return DateTimeToJSONTyped(json, false); +} + +export function DateTimeToJSONTyped(value?: DateTime | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'datetime': (value.datetime.toISOString()), + 'datetime': ((value['datetime']).toISOString()), }; } diff --git a/typescript/src/models/DerivedColor.ts b/typescript/src/models/DerivedColor.ts index 1ed2300f..10128d77 100644 --- a/typescript/src/models/DerivedColor.ts +++ b/typescript/src/models/DerivedColor.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Colorizer } from './Colorizer'; import { ColorizerFromJSON, ColorizerFromJSONTyped, ColorizerToJSON, + ColorizerToJSONTyped, } from './Colorizer'; /** @@ -59,13 +60,11 @@ export type DerivedColorTypeEnum = typeof DerivedColorTypeEnum[keyof typeof Deri /** * Check if a given object implements the DerivedColor interface. */ -export function instanceOfDerivedColor(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "attribute" in value; - isInstance = isInstance && "colorizer" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfDerivedColor(value: object): value is DerivedColor { + if (!('attribute' in value) || value['attribute'] === undefined) return false; + if (!('colorizer' in value) || value['colorizer'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function DerivedColorFromJSON(json: any): DerivedColor { @@ -73,7 +72,7 @@ export function DerivedColorFromJSON(json: any): DerivedColor { } export function DerivedColorFromJSONTyped(json: any, ignoreDiscriminator: boolean): DerivedColor { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -84,18 +83,20 @@ export function DerivedColorFromJSONTyped(json: any, ignoreDiscriminator: boolea }; } -export function DerivedColorToJSON(value?: DerivedColor | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DerivedColorToJSON(json: any): DerivedColor { + return DerivedColorToJSONTyped(json, false); +} + +export function DerivedColorToJSONTyped(value?: DerivedColor | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'attribute': value.attribute, - 'colorizer': ColorizerToJSON(value.colorizer), - 'type': value.type, + 'attribute': value['attribute'], + 'colorizer': ColorizerToJSON(value['colorizer']), + 'type': value['type'], }; } diff --git a/typescript/src/models/DerivedNumber.ts b/typescript/src/models/DerivedNumber.ts index c8ab21da..d1c2effa 100644 --- a/typescript/src/models/DerivedNumber.ts +++ b/typescript/src/models/DerivedNumber.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -58,14 +58,12 @@ export type DerivedNumberTypeEnum = typeof DerivedNumberTypeEnum[keyof typeof De /** * Check if a given object implements the DerivedNumber interface. */ -export function instanceOfDerivedNumber(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "attribute" in value; - isInstance = isInstance && "defaultValue" in value; - isInstance = isInstance && "factor" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfDerivedNumber(value: object): value is DerivedNumber { + if (!('attribute' in value) || value['attribute'] === undefined) return false; + if (!('defaultValue' in value) || value['defaultValue'] === undefined) return false; + if (!('factor' in value) || value['factor'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function DerivedNumberFromJSON(json: any): DerivedNumber { @@ -73,7 +71,7 @@ export function DerivedNumberFromJSON(json: any): DerivedNumber { } export function DerivedNumberFromJSONTyped(json: any, ignoreDiscriminator: boolean): DerivedNumber { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -85,19 +83,21 @@ export function DerivedNumberFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function DerivedNumberToJSON(value?: DerivedNumber | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function DerivedNumberToJSON(json: any): DerivedNumber { + return DerivedNumberToJSONTyped(json, false); +} + +export function DerivedNumberToJSONTyped(value?: DerivedNumber | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'attribute': value.attribute, - 'defaultValue': value.defaultValue, - 'factor': value.factor, - 'type': value.type, + 'attribute': value['attribute'], + 'defaultValue': value['defaultValue'], + 'factor': value['factor'], + 'type': value['type'], }; } diff --git a/typescript/src/models/DescribeCoverageRequest.ts b/typescript/src/models/DescribeCoverageRequest.ts index 0e34c414..6f8bd084 100644 --- a/typescript/src/models/DescribeCoverageRequest.ts +++ b/typescript/src/models/DescribeCoverageRequest.ts @@ -23,6 +23,17 @@ export const DescribeCoverageRequest = { export type DescribeCoverageRequest = typeof DescribeCoverageRequest[keyof typeof DescribeCoverageRequest]; +export function instanceOfDescribeCoverageRequest(value: any): boolean { + for (const key in DescribeCoverageRequest) { + if (Object.prototype.hasOwnProperty.call(DescribeCoverageRequest, key)) { + if (DescribeCoverageRequest[key as keyof typeof DescribeCoverageRequest] === value) { + return true; + } + } + } + return false; +} + export function DescribeCoverageRequestFromJSON(json: any): DescribeCoverageRequest { return DescribeCoverageRequestFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function DescribeCoverageRequestToJSON(value?: DescribeCoverageRequest | return value as any; } +export function DescribeCoverageRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): DescribeCoverageRequest { + return value as DescribeCoverageRequest; +} + diff --git a/typescript/src/models/ErrorResponse.ts b/typescript/src/models/ErrorResponse.ts index 1798279e..4af9c2e2 100644 --- a/typescript/src/models/ErrorResponse.ts +++ b/typescript/src/models/ErrorResponse.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface ErrorResponse { /** * Check if a given object implements the ErrorResponse interface. */ -export function instanceOfErrorResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "error" in value; - isInstance = isInstance && "message" in value; - - return isInstance; +export function instanceOfErrorResponse(value: object): value is ErrorResponse { + if (!('error' in value) || value['error'] === undefined) return false; + if (!('message' in value) || value['message'] === undefined) return false; + return true; } export function ErrorResponseFromJSON(json: any): ErrorResponse { @@ -49,7 +47,7 @@ export function ErrorResponseFromJSON(json: any): ErrorResponse { } export function ErrorResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function ErrorResponseFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function ErrorResponseToJSON(value?: ErrorResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ErrorResponseToJSON(json: any): ErrorResponse { + return ErrorResponseToJSONTyped(json, false); +} + +export function ErrorResponseToJSONTyped(value?: ErrorResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'error': value.error, - 'message': value.message, + 'error': value['error'], + 'message': value['message'], }; } diff --git a/typescript/src/models/ExternalDataId.ts b/typescript/src/models/ExternalDataId.ts index b12bea13..1aa47e30 100644 --- a/typescript/src/models/ExternalDataId.ts +++ b/typescript/src/models/ExternalDataId.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -52,13 +52,11 @@ export type ExternalDataIdTypeEnum = typeof ExternalDataIdTypeEnum[keyof typeof /** * Check if a given object implements the ExternalDataId interface. */ -export function instanceOfExternalDataId(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "layerId" in value; - isInstance = isInstance && "providerId" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfExternalDataId(value: object): value is ExternalDataId { + if (!('layerId' in value) || value['layerId'] === undefined) return false; + if (!('providerId' in value) || value['providerId'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function ExternalDataIdFromJSON(json: any): ExternalDataId { @@ -66,7 +64,7 @@ export function ExternalDataIdFromJSON(json: any): ExternalDataId { } export function ExternalDataIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExternalDataId { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -77,18 +75,20 @@ export function ExternalDataIdFromJSONTyped(json: any, ignoreDiscriminator: bool }; } -export function ExternalDataIdToJSON(value?: ExternalDataId | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ExternalDataIdToJSON(json: any): ExternalDataId { + return ExternalDataIdToJSONTyped(json, false); +} + +export function ExternalDataIdToJSONTyped(value?: ExternalDataId | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'layerId': value.layerId, - 'providerId': value.providerId, - 'type': value.type, + 'layerId': value['layerId'], + 'providerId': value['providerId'], + 'type': value['type'], }; } diff --git a/typescript/src/models/FeatureDataType.ts b/typescript/src/models/FeatureDataType.ts index 23cdcc53..22a4e82f 100644 --- a/typescript/src/models/FeatureDataType.ts +++ b/typescript/src/models/FeatureDataType.ts @@ -28,6 +28,17 @@ export const FeatureDataType = { export type FeatureDataType = typeof FeatureDataType[keyof typeof FeatureDataType]; +export function instanceOfFeatureDataType(value: any): boolean { + for (const key in FeatureDataType) { + if (Object.prototype.hasOwnProperty.call(FeatureDataType, key)) { + if (FeatureDataType[key as keyof typeof FeatureDataType] === value) { + return true; + } + } + } + return false; +} + export function FeatureDataTypeFromJSON(json: any): FeatureDataType { return FeatureDataTypeFromJSONTyped(json, false); } @@ -40,3 +51,7 @@ export function FeatureDataTypeToJSON(value?: FeatureDataType | null): any { return value as any; } +export function FeatureDataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): FeatureDataType { + return value as FeatureDataType; +} + diff --git a/typescript/src/models/FileNotFoundHandling.ts b/typescript/src/models/FileNotFoundHandling.ts index 11da7644..d7a740d7 100644 --- a/typescript/src/models/FileNotFoundHandling.ts +++ b/typescript/src/models/FileNotFoundHandling.ts @@ -24,6 +24,17 @@ export const FileNotFoundHandling = { export type FileNotFoundHandling = typeof FileNotFoundHandling[keyof typeof FileNotFoundHandling]; +export function instanceOfFileNotFoundHandling(value: any): boolean { + for (const key in FileNotFoundHandling) { + if (Object.prototype.hasOwnProperty.call(FileNotFoundHandling, key)) { + if (FileNotFoundHandling[key as keyof typeof FileNotFoundHandling] === value) { + return true; + } + } + } + return false; +} + export function FileNotFoundHandlingFromJSON(json: any): FileNotFoundHandling { return FileNotFoundHandlingFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function FileNotFoundHandlingToJSON(value?: FileNotFoundHandling | null): return value as any; } +export function FileNotFoundHandlingToJSONTyped(value: any, ignoreDiscriminator: boolean): FileNotFoundHandling { + return value as FileNotFoundHandling; +} + diff --git a/typescript/src/models/FormatSpecifics.ts b/typescript/src/models/FormatSpecifics.ts index 30d595c9..4e632106 100644 --- a/typescript/src/models/FormatSpecifics.ts +++ b/typescript/src/models/FormatSpecifics.ts @@ -12,8 +12,8 @@ * Do not edit the class manually. */ +import type { FormatSpecificsOneOf } from './FormatSpecificsOneOf'; import { - FormatSpecificsOneOf, instanceOfFormatSpecificsOneOf, FormatSpecificsOneOfFromJSON, FormatSpecificsOneOfFromJSONTyped, @@ -32,18 +32,23 @@ export function FormatSpecificsFromJSON(json: any): FormatSpecifics { } export function FormatSpecificsFromJSONTyped(json: any, ignoreDiscriminator: boolean): FormatSpecifics { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - return { ...FormatSpecificsOneOfFromJSONTyped(json, true) }; + if (instanceOfFormatSpecificsOneOf(json)) { + return FormatSpecificsOneOfFromJSONTyped(json, true); + } + + return {} as any; } -export function FormatSpecificsToJSON(value?: FormatSpecifics | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function FormatSpecificsToJSON(json: any): any { + return FormatSpecificsToJSONTyped(json, false); +} + +export function FormatSpecificsToJSONTyped(value?: FormatSpecifics | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } if (instanceOfFormatSpecificsOneOf(value)) { diff --git a/typescript/src/models/FormatSpecificsOneOf.ts b/typescript/src/models/FormatSpecificsOneOf.ts index 811d5dbb..b28b7d82 100644 --- a/typescript/src/models/FormatSpecificsOneOf.ts +++ b/typescript/src/models/FormatSpecificsOneOf.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { FormatSpecificsOneOfCsv } from './FormatSpecificsOneOfCsv'; import { FormatSpecificsOneOfCsvFromJSON, FormatSpecificsOneOfCsvFromJSONTyped, FormatSpecificsOneOfCsvToJSON, + FormatSpecificsOneOfCsvToJSONTyped, } from './FormatSpecificsOneOfCsv'; /** @@ -37,11 +38,9 @@ export interface FormatSpecificsOneOf { /** * Check if a given object implements the FormatSpecificsOneOf interface. */ -export function instanceOfFormatSpecificsOneOf(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "csv" in value; - - return isInstance; +export function instanceOfFormatSpecificsOneOf(value: object): value is FormatSpecificsOneOf { + if (!('csv' in value) || value['csv'] === undefined) return false; + return true; } export function FormatSpecificsOneOfFromJSON(json: any): FormatSpecificsOneOf { @@ -49,7 +48,7 @@ export function FormatSpecificsOneOfFromJSON(json: any): FormatSpecificsOneOf { } export function FormatSpecificsOneOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): FormatSpecificsOneOf { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function FormatSpecificsOneOfFromJSONTyped(json: any, ignoreDiscriminator }; } -export function FormatSpecificsOneOfToJSON(value?: FormatSpecificsOneOf | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function FormatSpecificsOneOfToJSON(json: any): FormatSpecificsOneOf { + return FormatSpecificsOneOfToJSONTyped(json, false); +} + +export function FormatSpecificsOneOfToJSONTyped(value?: FormatSpecificsOneOf | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'csv': FormatSpecificsOneOfCsvToJSON(value.csv), + 'csv': FormatSpecificsOneOfCsvToJSON(value['csv']), }; } diff --git a/typescript/src/models/FormatSpecificsOneOfCsv.ts b/typescript/src/models/FormatSpecificsOneOfCsv.ts index 5325d556..e33520c2 100644 --- a/typescript/src/models/FormatSpecificsOneOfCsv.ts +++ b/typescript/src/models/FormatSpecificsOneOfCsv.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { CsvHeader } from './CsvHeader'; import { CsvHeaderFromJSON, CsvHeaderFromJSONTyped, CsvHeaderToJSON, + CsvHeaderToJSONTyped, } from './CsvHeader'; /** @@ -34,14 +35,14 @@ export interface FormatSpecificsOneOfCsv { header: CsvHeader; } + + /** * Check if a given object implements the FormatSpecificsOneOfCsv interface. */ -export function instanceOfFormatSpecificsOneOfCsv(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "header" in value; - - return isInstance; +export function instanceOfFormatSpecificsOneOfCsv(value: object): value is FormatSpecificsOneOfCsv { + if (!('header' in value) || value['header'] === undefined) return false; + return true; } export function FormatSpecificsOneOfCsvFromJSON(json: any): FormatSpecificsOneOfCsv { @@ -49,7 +50,7 @@ export function FormatSpecificsOneOfCsvFromJSON(json: any): FormatSpecificsOneOf } export function FormatSpecificsOneOfCsvFromJSONTyped(json: any, ignoreDiscriminator: boolean): FormatSpecificsOneOfCsv { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +59,18 @@ export function FormatSpecificsOneOfCsvFromJSONTyped(json: any, ignoreDiscrimina }; } -export function FormatSpecificsOneOfCsvToJSON(value?: FormatSpecificsOneOfCsv | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function FormatSpecificsOneOfCsvToJSON(json: any): FormatSpecificsOneOfCsv { + return FormatSpecificsOneOfCsvToJSONTyped(json, false); +} + +export function FormatSpecificsOneOfCsvToJSONTyped(value?: FormatSpecificsOneOfCsv | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'header': CsvHeaderToJSON(value.header), + 'header': CsvHeaderToJSON(value['header']), }; } diff --git a/typescript/src/models/GdalDatasetGeoTransform.ts b/typescript/src/models/GdalDatasetGeoTransform.ts index 4f2a0261..1273c0e6 100644 --- a/typescript/src/models/GdalDatasetGeoTransform.ts +++ b/typescript/src/models/GdalDatasetGeoTransform.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Coordinate2D } from './Coordinate2D'; import { Coordinate2DFromJSON, Coordinate2DFromJSONTyped, Coordinate2DToJSON, + Coordinate2DToJSONTyped, } from './Coordinate2D'; /** @@ -49,13 +50,11 @@ export interface GdalDatasetGeoTransform { /** * Check if a given object implements the GdalDatasetGeoTransform interface. */ -export function instanceOfGdalDatasetGeoTransform(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "originCoordinate" in value; - isInstance = isInstance && "xPixelSize" in value; - isInstance = isInstance && "yPixelSize" in value; - - return isInstance; +export function instanceOfGdalDatasetGeoTransform(value: object): value is GdalDatasetGeoTransform { + if (!('originCoordinate' in value) || value['originCoordinate'] === undefined) return false; + if (!('xPixelSize' in value) || value['xPixelSize'] === undefined) return false; + if (!('yPixelSize' in value) || value['yPixelSize'] === undefined) return false; + return true; } export function GdalDatasetGeoTransformFromJSON(json: any): GdalDatasetGeoTransform { @@ -63,7 +62,7 @@ export function GdalDatasetGeoTransformFromJSON(json: any): GdalDatasetGeoTransf } export function GdalDatasetGeoTransformFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalDatasetGeoTransform { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -74,18 +73,20 @@ export function GdalDatasetGeoTransformFromJSONTyped(json: any, ignoreDiscrimina }; } -export function GdalDatasetGeoTransformToJSON(value?: GdalDatasetGeoTransform | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalDatasetGeoTransformToJSON(json: any): GdalDatasetGeoTransform { + return GdalDatasetGeoTransformToJSONTyped(json, false); +} + +export function GdalDatasetGeoTransformToJSONTyped(value?: GdalDatasetGeoTransform | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'originCoordinate': Coordinate2DToJSON(value.originCoordinate), - 'xPixelSize': value.xPixelSize, - 'yPixelSize': value.yPixelSize, + 'originCoordinate': Coordinate2DToJSON(value['originCoordinate']), + 'xPixelSize': value['xPixelSize'], + 'yPixelSize': value['yPixelSize'], }; } diff --git a/typescript/src/models/GdalDatasetParameters.ts b/typescript/src/models/GdalDatasetParameters.ts index 6a0e6f2c..53b3e0b8 100644 --- a/typescript/src/models/GdalDatasetParameters.ts +++ b/typescript/src/models/GdalDatasetParameters.ts @@ -12,25 +12,28 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { FileNotFoundHandling } from './FileNotFoundHandling'; -import { - FileNotFoundHandlingFromJSON, - FileNotFoundHandlingFromJSONTyped, - FileNotFoundHandlingToJSON, -} from './FileNotFoundHandling'; +import { mapValues } from '../runtime'; import type { GdalDatasetGeoTransform } from './GdalDatasetGeoTransform'; import { GdalDatasetGeoTransformFromJSON, GdalDatasetGeoTransformFromJSONTyped, GdalDatasetGeoTransformToJSON, + GdalDatasetGeoTransformToJSONTyped, } from './GdalDatasetGeoTransform'; import type { GdalMetadataMapping } from './GdalMetadataMapping'; import { GdalMetadataMappingFromJSON, GdalMetadataMappingFromJSONTyped, GdalMetadataMappingToJSON, + GdalMetadataMappingToJSONTyped, } from './GdalMetadataMapping'; +import type { FileNotFoundHandling } from './FileNotFoundHandling'; +import { + FileNotFoundHandlingFromJSON, + FileNotFoundHandlingFromJSONTyped, + FileNotFoundHandlingToJSON, + FileNotFoundHandlingToJSONTyped, +} from './FileNotFoundHandling'; /** * Parameters for loading data using Gdal @@ -106,19 +109,19 @@ export interface GdalDatasetParameters { width: number; } + + /** * Check if a given object implements the GdalDatasetParameters interface. */ -export function instanceOfGdalDatasetParameters(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "fileNotFoundHandling" in value; - isInstance = isInstance && "filePath" in value; - isInstance = isInstance && "geoTransform" in value; - isInstance = isInstance && "height" in value; - isInstance = isInstance && "rasterbandChannel" in value; - isInstance = isInstance && "width" in value; - - return isInstance; +export function instanceOfGdalDatasetParameters(value: object): value is GdalDatasetParameters { + if (!('fileNotFoundHandling' in value) || value['fileNotFoundHandling'] === undefined) return false; + if (!('filePath' in value) || value['filePath'] === undefined) return false; + if (!('geoTransform' in value) || value['geoTransform'] === undefined) return false; + if (!('height' in value) || value['height'] === undefined) return false; + if (!('rasterbandChannel' in value) || value['rasterbandChannel'] === undefined) return false; + if (!('width' in value) || value['width'] === undefined) return false; + return true; } export function GdalDatasetParametersFromJSON(json: any): GdalDatasetParameters { @@ -126,45 +129,47 @@ export function GdalDatasetParametersFromJSON(json: any): GdalDatasetParameters } export function GdalDatasetParametersFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalDatasetParameters { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'allowAlphabandAsMask': !exists(json, 'allowAlphabandAsMask') ? undefined : json['allowAlphabandAsMask'], + 'allowAlphabandAsMask': json['allowAlphabandAsMask'] == null ? undefined : json['allowAlphabandAsMask'], 'fileNotFoundHandling': FileNotFoundHandlingFromJSON(json['fileNotFoundHandling']), 'filePath': json['filePath'], - 'gdalConfigOptions': !exists(json, 'gdalConfigOptions') ? undefined : json['gdalConfigOptions'], - 'gdalOpenOptions': !exists(json, 'gdalOpenOptions') ? undefined : json['gdalOpenOptions'], + 'gdalConfigOptions': json['gdalConfigOptions'] == null ? undefined : json['gdalConfigOptions'], + 'gdalOpenOptions': json['gdalOpenOptions'] == null ? undefined : json['gdalOpenOptions'], 'geoTransform': GdalDatasetGeoTransformFromJSON(json['geoTransform']), 'height': json['height'], - 'noDataValue': !exists(json, 'noDataValue') ? undefined : json['noDataValue'], - 'propertiesMapping': !exists(json, 'propertiesMapping') ? undefined : (json['propertiesMapping'] === null ? null : (json['propertiesMapping'] as Array).map(GdalMetadataMappingFromJSON)), + 'noDataValue': json['noDataValue'] == null ? undefined : json['noDataValue'], + 'propertiesMapping': json['propertiesMapping'] == null ? undefined : ((json['propertiesMapping'] as Array).map(GdalMetadataMappingFromJSON)), 'rasterbandChannel': json['rasterbandChannel'], 'width': json['width'], }; } -export function GdalDatasetParametersToJSON(value?: GdalDatasetParameters | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalDatasetParametersToJSON(json: any): GdalDatasetParameters { + return GdalDatasetParametersToJSONTyped(json, false); +} + +export function GdalDatasetParametersToJSONTyped(value?: GdalDatasetParameters | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'allowAlphabandAsMask': value.allowAlphabandAsMask, - 'fileNotFoundHandling': FileNotFoundHandlingToJSON(value.fileNotFoundHandling), - 'filePath': value.filePath, - 'gdalConfigOptions': value.gdalConfigOptions, - 'gdalOpenOptions': value.gdalOpenOptions, - 'geoTransform': GdalDatasetGeoTransformToJSON(value.geoTransform), - 'height': value.height, - 'noDataValue': value.noDataValue, - 'propertiesMapping': value.propertiesMapping === undefined ? undefined : (value.propertiesMapping === null ? null : (value.propertiesMapping as Array).map(GdalMetadataMappingToJSON)), - 'rasterbandChannel': value.rasterbandChannel, - 'width': value.width, + 'allowAlphabandAsMask': value['allowAlphabandAsMask'], + 'fileNotFoundHandling': FileNotFoundHandlingToJSON(value['fileNotFoundHandling']), + 'filePath': value['filePath'], + 'gdalConfigOptions': value['gdalConfigOptions'], + 'gdalOpenOptions': value['gdalOpenOptions'], + 'geoTransform': GdalDatasetGeoTransformToJSON(value['geoTransform']), + 'height': value['height'], + 'noDataValue': value['noDataValue'], + 'propertiesMapping': value['propertiesMapping'] == null ? undefined : ((value['propertiesMapping'] as Array).map(GdalMetadataMappingToJSON)), + 'rasterbandChannel': value['rasterbandChannel'], + 'width': value['width'], }; } diff --git a/typescript/src/models/GdalLoadingInfoTemporalSlice.ts b/typescript/src/models/GdalLoadingInfoTemporalSlice.ts index 17a0d309..e3e905d1 100644 --- a/typescript/src/models/GdalLoadingInfoTemporalSlice.ts +++ b/typescript/src/models/GdalLoadingInfoTemporalSlice.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { GdalDatasetParameters } from './GdalDatasetParameters'; -import { - GdalDatasetParametersFromJSON, - GdalDatasetParametersFromJSONTyped, - GdalDatasetParametersToJSON, -} from './GdalDatasetParameters'; +import { mapValues } from '../runtime'; import type { TimeInterval } from './TimeInterval'; import { TimeIntervalFromJSON, TimeIntervalFromJSONTyped, TimeIntervalToJSON, + TimeIntervalToJSONTyped, } from './TimeInterval'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; +import { + GdalDatasetParametersFromJSON, + GdalDatasetParametersFromJSONTyped, + GdalDatasetParametersToJSON, + GdalDatasetParametersToJSONTyped, +} from './GdalDatasetParameters'; /** * one temporal slice of the dataset that requires reading from exactly one Gdal dataset @@ -55,11 +57,9 @@ export interface GdalLoadingInfoTemporalSlice { /** * Check if a given object implements the GdalLoadingInfoTemporalSlice interface. */ -export function instanceOfGdalLoadingInfoTemporalSlice(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "time" in value; - - return isInstance; +export function instanceOfGdalLoadingInfoTemporalSlice(value: object): value is GdalLoadingInfoTemporalSlice { + if (!('time' in value) || value['time'] === undefined) return false; + return true; } export function GdalLoadingInfoTemporalSliceFromJSON(json: any): GdalLoadingInfoTemporalSlice { @@ -67,29 +67,31 @@ export function GdalLoadingInfoTemporalSliceFromJSON(json: any): GdalLoadingInfo } export function GdalLoadingInfoTemporalSliceFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalLoadingInfoTemporalSlice { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'cacheTtl': !exists(json, 'cacheTtl') ? undefined : json['cacheTtl'], - 'params': !exists(json, 'params') ? undefined : GdalDatasetParametersFromJSON(json['params']), + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], + 'params': json['params'] == null ? undefined : GdalDatasetParametersFromJSON(json['params']), 'time': TimeIntervalFromJSON(json['time']), }; } -export function GdalLoadingInfoTemporalSliceToJSON(value?: GdalLoadingInfoTemporalSlice | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalLoadingInfoTemporalSliceToJSON(json: any): GdalLoadingInfoTemporalSlice { + return GdalLoadingInfoTemporalSliceToJSONTyped(json, false); +} + +export function GdalLoadingInfoTemporalSliceToJSONTyped(value?: GdalLoadingInfoTemporalSlice | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'cacheTtl': value.cacheTtl, - 'params': GdalDatasetParametersToJSON(value.params), - 'time': TimeIntervalToJSON(value.time), + 'cacheTtl': value['cacheTtl'], + 'params': GdalDatasetParametersToJSON(value['params']), + 'time': TimeIntervalToJSON(value['time']), }; } diff --git a/typescript/src/models/GdalMetaDataList.ts b/typescript/src/models/GdalMetaDataList.ts index 1d877bf7..b5d584d2 100644 --- a/typescript/src/models/GdalMetaDataList.ts +++ b/typescript/src/models/GdalMetaDataList.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { GdalLoadingInfoTemporalSlice } from './GdalLoadingInfoTemporalSlice'; -import { - GdalLoadingInfoTemporalSliceFromJSON, - GdalLoadingInfoTemporalSliceFromJSONTyped, - GdalLoadingInfoTemporalSliceToJSON, -} from './GdalLoadingInfoTemporalSlice'; +import { mapValues } from '../runtime'; import type { RasterResultDescriptor } from './RasterResultDescriptor'; import { RasterResultDescriptorFromJSON, RasterResultDescriptorFromJSONTyped, RasterResultDescriptorToJSON, + RasterResultDescriptorToJSONTyped, } from './RasterResultDescriptor'; +import type { GdalLoadingInfoTemporalSlice } from './GdalLoadingInfoTemporalSlice'; +import { + GdalLoadingInfoTemporalSliceFromJSON, + GdalLoadingInfoTemporalSliceFromJSONTyped, + GdalLoadingInfoTemporalSliceToJSON, + GdalLoadingInfoTemporalSliceToJSONTyped, +} from './GdalLoadingInfoTemporalSlice'; /** * @@ -65,13 +67,11 @@ export type GdalMetaDataListTypeEnum = typeof GdalMetaDataListTypeEnum[keyof typ /** * Check if a given object implements the GdalMetaDataList interface. */ -export function instanceOfGdalMetaDataList(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfGdalMetaDataList(value: object): value is GdalMetaDataList { + if (!('params' in value) || value['params'] === undefined) return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function GdalMetaDataListFromJSON(json: any): GdalMetaDataList { @@ -79,7 +79,7 @@ export function GdalMetaDataListFromJSON(json: any): GdalMetaDataList { } export function GdalMetaDataListFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetaDataList { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -90,18 +90,20 @@ export function GdalMetaDataListFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function GdalMetaDataListToJSON(value?: GdalMetaDataList | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalMetaDataListToJSON(json: any): GdalMetaDataList { + return GdalMetaDataListToJSONTyped(json, false); +} + +export function GdalMetaDataListToJSONTyped(value?: GdalMetaDataList | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'params': ((value.params as Array).map(GdalLoadingInfoTemporalSliceToJSON)), - 'resultDescriptor': RasterResultDescriptorToJSON(value.resultDescriptor), - 'type': value.type, + 'params': ((value['params'] as Array).map(GdalLoadingInfoTemporalSliceToJSON)), + 'resultDescriptor': RasterResultDescriptorToJSON(value['resultDescriptor']), + 'type': value['type'], }; } diff --git a/typescript/src/models/GdalMetaDataRegular.ts b/typescript/src/models/GdalMetaDataRegular.ts index 63e19d34..98592653 100644 --- a/typescript/src/models/GdalMetaDataRegular.ts +++ b/typescript/src/models/GdalMetaDataRegular.ts @@ -12,37 +12,42 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { GdalDatasetParameters } from './GdalDatasetParameters'; +import { mapValues } from '../runtime'; +import type { TimeStep } from './TimeStep'; import { - GdalDatasetParametersFromJSON, - GdalDatasetParametersFromJSONTyped, - GdalDatasetParametersToJSON, -} from './GdalDatasetParameters'; + TimeStepFromJSON, + TimeStepFromJSONTyped, + TimeStepToJSON, + TimeStepToJSONTyped, +} from './TimeStep'; +import type { TimeInterval } from './TimeInterval'; +import { + TimeIntervalFromJSON, + TimeIntervalFromJSONTyped, + TimeIntervalToJSON, + TimeIntervalToJSONTyped, +} from './TimeInterval'; import type { GdalSourceTimePlaceholder } from './GdalSourceTimePlaceholder'; import { GdalSourceTimePlaceholderFromJSON, GdalSourceTimePlaceholderFromJSONTyped, GdalSourceTimePlaceholderToJSON, + GdalSourceTimePlaceholderToJSONTyped, } from './GdalSourceTimePlaceholder'; import type { RasterResultDescriptor } from './RasterResultDescriptor'; import { RasterResultDescriptorFromJSON, RasterResultDescriptorFromJSONTyped, RasterResultDescriptorToJSON, + RasterResultDescriptorToJSONTyped, } from './RasterResultDescriptor'; -import type { TimeInterval } from './TimeInterval'; -import { - TimeIntervalFromJSON, - TimeIntervalFromJSONTyped, - TimeIntervalToJSON, -} from './TimeInterval'; -import type { TimeStep } from './TimeStep'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; import { - TimeStepFromJSON, - TimeStepFromJSONTyped, - TimeStepToJSON, -} from './TimeStep'; + GdalDatasetParametersFromJSON, + GdalDatasetParametersFromJSONTyped, + GdalDatasetParametersToJSON, + GdalDatasetParametersToJSONTyped, +} from './GdalDatasetParameters'; /** * @@ -107,16 +112,14 @@ export type GdalMetaDataRegularTypeEnum = typeof GdalMetaDataRegularTypeEnum[key /** * Check if a given object implements the GdalMetaDataRegular interface. */ -export function instanceOfGdalMetaDataRegular(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "dataTime" in value; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "step" in value; - isInstance = isInstance && "timePlaceholders" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfGdalMetaDataRegular(value: object): value is GdalMetaDataRegular { + if (!('dataTime' in value) || value['dataTime'] === undefined) return false; + if (!('params' in value) || value['params'] === undefined) return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) return false; + if (!('step' in value) || value['step'] === undefined) return false; + if (!('timePlaceholders' in value) || value['timePlaceholders'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function GdalMetaDataRegularFromJSON(json: any): GdalMetaDataRegular { @@ -124,12 +127,12 @@ export function GdalMetaDataRegularFromJSON(json: any): GdalMetaDataRegular { } export function GdalMetaDataRegularFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetaDataRegular { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'cacheTtl': !exists(json, 'cacheTtl') ? undefined : json['cacheTtl'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], 'dataTime': TimeIntervalFromJSON(json['dataTime']), 'params': GdalDatasetParametersFromJSON(json['params']), 'resultDescriptor': RasterResultDescriptorFromJSON(json['resultDescriptor']), @@ -139,22 +142,24 @@ export function GdalMetaDataRegularFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function GdalMetaDataRegularToJSON(value?: GdalMetaDataRegular | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalMetaDataRegularToJSON(json: any): GdalMetaDataRegular { + return GdalMetaDataRegularToJSONTyped(json, false); +} + +export function GdalMetaDataRegularToJSONTyped(value?: GdalMetaDataRegular | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'cacheTtl': value.cacheTtl, - 'dataTime': TimeIntervalToJSON(value.dataTime), - 'params': GdalDatasetParametersToJSON(value.params), - 'resultDescriptor': RasterResultDescriptorToJSON(value.resultDescriptor), - 'step': TimeStepToJSON(value.step), - 'timePlaceholders': (mapValues(value.timePlaceholders, GdalSourceTimePlaceholderToJSON)), - 'type': value.type, + 'cacheTtl': value['cacheTtl'], + 'dataTime': TimeIntervalToJSON(value['dataTime']), + 'params': GdalDatasetParametersToJSON(value['params']), + 'resultDescriptor': RasterResultDescriptorToJSON(value['resultDescriptor']), + 'step': TimeStepToJSON(value['step']), + 'timePlaceholders': (mapValues(value['timePlaceholders'], GdalSourceTimePlaceholderToJSON)), + 'type': value['type'], }; } diff --git a/typescript/src/models/GdalMetaDataStatic.ts b/typescript/src/models/GdalMetaDataStatic.ts index 3c777164..7ffa8192 100644 --- a/typescript/src/models/GdalMetaDataStatic.ts +++ b/typescript/src/models/GdalMetaDataStatic.ts @@ -12,25 +12,28 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { GdalDatasetParameters } from './GdalDatasetParameters'; +import { mapValues } from '../runtime'; +import type { TimeInterval } from './TimeInterval'; import { - GdalDatasetParametersFromJSON, - GdalDatasetParametersFromJSONTyped, - GdalDatasetParametersToJSON, -} from './GdalDatasetParameters'; + TimeIntervalFromJSON, + TimeIntervalFromJSONTyped, + TimeIntervalToJSON, + TimeIntervalToJSONTyped, +} from './TimeInterval'; import type { RasterResultDescriptor } from './RasterResultDescriptor'; import { RasterResultDescriptorFromJSON, RasterResultDescriptorFromJSONTyped, RasterResultDescriptorToJSON, + RasterResultDescriptorToJSONTyped, } from './RasterResultDescriptor'; -import type { TimeInterval } from './TimeInterval'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; import { - TimeIntervalFromJSON, - TimeIntervalFromJSONTyped, - TimeIntervalToJSON, -} from './TimeInterval'; + GdalDatasetParametersFromJSON, + GdalDatasetParametersFromJSONTyped, + GdalDatasetParametersToJSON, + GdalDatasetParametersToJSONTyped, +} from './GdalDatasetParameters'; /** * @@ -83,13 +86,11 @@ export type GdalMetaDataStaticTypeEnum = typeof GdalMetaDataStaticTypeEnum[keyof /** * Check if a given object implements the GdalMetaDataStatic interface. */ -export function instanceOfGdalMetaDataStatic(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfGdalMetaDataStatic(value: object): value is GdalMetaDataStatic { + if (!('params' in value) || value['params'] === undefined) return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function GdalMetaDataStaticFromJSON(json: any): GdalMetaDataStatic { @@ -97,33 +98,35 @@ export function GdalMetaDataStaticFromJSON(json: any): GdalMetaDataStatic { } export function GdalMetaDataStaticFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetaDataStatic { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'cacheTtl': !exists(json, 'cacheTtl') ? undefined : json['cacheTtl'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], 'params': GdalDatasetParametersFromJSON(json['params']), 'resultDescriptor': RasterResultDescriptorFromJSON(json['resultDescriptor']), - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), 'type': json['type'], }; } -export function GdalMetaDataStaticToJSON(value?: GdalMetaDataStatic | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalMetaDataStaticToJSON(json: any): GdalMetaDataStatic { + return GdalMetaDataStaticToJSONTyped(json, false); +} + +export function GdalMetaDataStaticToJSONTyped(value?: GdalMetaDataStatic | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'cacheTtl': value.cacheTtl, - 'params': GdalDatasetParametersToJSON(value.params), - 'resultDescriptor': RasterResultDescriptorToJSON(value.resultDescriptor), - 'time': TimeIntervalToJSON(value.time), - 'type': value.type, + 'cacheTtl': value['cacheTtl'], + 'params': GdalDatasetParametersToJSON(value['params']), + 'resultDescriptor': RasterResultDescriptorToJSON(value['resultDescriptor']), + 'time': TimeIntervalToJSON(value['time']), + 'type': value['type'], }; } diff --git a/typescript/src/models/GdalMetadataMapping.ts b/typescript/src/models/GdalMetadataMapping.ts index d89ea4d1..64e658b8 100644 --- a/typescript/src/models/GdalMetadataMapping.ts +++ b/typescript/src/models/GdalMetadataMapping.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { RasterPropertiesEntryType } from './RasterPropertiesEntryType'; -import { - RasterPropertiesEntryTypeFromJSON, - RasterPropertiesEntryTypeFromJSONTyped, - RasterPropertiesEntryTypeToJSON, -} from './RasterPropertiesEntryType'; +import { mapValues } from '../runtime'; import type { RasterPropertiesKey } from './RasterPropertiesKey'; import { RasterPropertiesKeyFromJSON, RasterPropertiesKeyFromJSONTyped, RasterPropertiesKeyToJSON, + RasterPropertiesKeyToJSONTyped, } from './RasterPropertiesKey'; +import type { RasterPropertiesEntryType } from './RasterPropertiesEntryType'; +import { + RasterPropertiesEntryTypeFromJSON, + RasterPropertiesEntryTypeFromJSONTyped, + RasterPropertiesEntryTypeToJSON, + RasterPropertiesEntryTypeToJSONTyped, +} from './RasterPropertiesEntryType'; /** * @@ -52,16 +54,16 @@ export interface GdalMetadataMapping { targetType: RasterPropertiesEntryType; } + + /** * Check if a given object implements the GdalMetadataMapping interface. */ -export function instanceOfGdalMetadataMapping(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "sourceKey" in value; - isInstance = isInstance && "targetKey" in value; - isInstance = isInstance && "targetType" in value; - - return isInstance; +export function instanceOfGdalMetadataMapping(value: object): value is GdalMetadataMapping { + if (!('sourceKey' in value) || value['sourceKey'] === undefined) return false; + if (!('targetKey' in value) || value['targetKey'] === undefined) return false; + if (!('targetType' in value) || value['targetType'] === undefined) return false; + return true; } export function GdalMetadataMappingFromJSON(json: any): GdalMetadataMapping { @@ -69,7 +71,7 @@ export function GdalMetadataMappingFromJSON(json: any): GdalMetadataMapping { } export function GdalMetadataMappingFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetadataMapping { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -80,18 +82,20 @@ export function GdalMetadataMappingFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function GdalMetadataMappingToJSON(value?: GdalMetadataMapping | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalMetadataMappingToJSON(json: any): GdalMetadataMapping { + return GdalMetadataMappingToJSONTyped(json, false); +} + +export function GdalMetadataMappingToJSONTyped(value?: GdalMetadataMapping | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'source_key': RasterPropertiesKeyToJSON(value.sourceKey), - 'target_key': RasterPropertiesKeyToJSON(value.targetKey), - 'target_type': RasterPropertiesEntryTypeToJSON(value.targetType), + 'source_key': RasterPropertiesKeyToJSON(value['sourceKey']), + 'target_key': RasterPropertiesKeyToJSON(value['targetKey']), + 'target_type': RasterPropertiesEntryTypeToJSON(value['targetType']), }; } diff --git a/typescript/src/models/GdalMetadataNetCdfCf.ts b/typescript/src/models/GdalMetadataNetCdfCf.ts index 4f71e7a7..3582352e 100644 --- a/typescript/src/models/GdalMetadataNetCdfCf.ts +++ b/typescript/src/models/GdalMetadataNetCdfCf.ts @@ -12,25 +12,28 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { GdalDatasetParameters } from './GdalDatasetParameters'; +import { mapValues } from '../runtime'; +import type { TimeStep } from './TimeStep'; import { - GdalDatasetParametersFromJSON, - GdalDatasetParametersFromJSONTyped, - GdalDatasetParametersToJSON, -} from './GdalDatasetParameters'; + TimeStepFromJSON, + TimeStepFromJSONTyped, + TimeStepToJSON, + TimeStepToJSONTyped, +} from './TimeStep'; import type { RasterResultDescriptor } from './RasterResultDescriptor'; import { RasterResultDescriptorFromJSON, RasterResultDescriptorFromJSONTyped, RasterResultDescriptorToJSON, + RasterResultDescriptorToJSONTyped, } from './RasterResultDescriptor'; -import type { TimeStep } from './TimeStep'; +import type { GdalDatasetParameters } from './GdalDatasetParameters'; import { - TimeStepFromJSON, - TimeStepFromJSONTyped, - TimeStepToJSON, -} from './TimeStep'; + GdalDatasetParametersFromJSON, + GdalDatasetParametersFromJSONTyped, + GdalDatasetParametersToJSON, + GdalDatasetParametersToJSONTyped, +} from './GdalDatasetParameters'; /** * Meta data for 4D `NetCDF` CF datasets @@ -102,17 +105,15 @@ export type GdalMetadataNetCdfCfTypeEnum = typeof GdalMetadataNetCdfCfTypeEnum[k /** * Check if a given object implements the GdalMetadataNetCdfCf interface. */ -export function instanceOfGdalMetadataNetCdfCf(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "bandOffset" in value; - isInstance = isInstance && "end" in value; - isInstance = isInstance && "params" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "start" in value; - isInstance = isInstance && "step" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfGdalMetadataNetCdfCf(value: object): value is GdalMetadataNetCdfCf { + if (!('bandOffset' in value) || value['bandOffset'] === undefined) return false; + if (!('end' in value) || value['end'] === undefined) return false; + if (!('params' in value) || value['params'] === undefined) return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) return false; + if (!('start' in value) || value['start'] === undefined) return false; + if (!('step' in value) || value['step'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function GdalMetadataNetCdfCfFromJSON(json: any): GdalMetadataNetCdfCf { @@ -120,13 +121,13 @@ export function GdalMetadataNetCdfCfFromJSON(json: any): GdalMetadataNetCdfCf { } export function GdalMetadataNetCdfCfFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalMetadataNetCdfCf { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bandOffset': json['bandOffset'], - 'cacheTtl': !exists(json, 'cacheTtl') ? undefined : json['cacheTtl'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], 'end': json['end'], 'params': GdalDatasetParametersFromJSON(json['params']), 'resultDescriptor': RasterResultDescriptorFromJSON(json['resultDescriptor']), @@ -136,23 +137,25 @@ export function GdalMetadataNetCdfCfFromJSONTyped(json: any, ignoreDiscriminator }; } -export function GdalMetadataNetCdfCfToJSON(value?: GdalMetadataNetCdfCf | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalMetadataNetCdfCfToJSON(json: any): GdalMetadataNetCdfCf { + return GdalMetadataNetCdfCfToJSONTyped(json, false); +} + +export function GdalMetadataNetCdfCfToJSONTyped(value?: GdalMetadataNetCdfCf | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bandOffset': value.bandOffset, - 'cacheTtl': value.cacheTtl, - 'end': value.end, - 'params': GdalDatasetParametersToJSON(value.params), - 'resultDescriptor': RasterResultDescriptorToJSON(value.resultDescriptor), - 'start': value.start, - 'step': TimeStepToJSON(value.step), - 'type': value.type, + 'bandOffset': value['bandOffset'], + 'cacheTtl': value['cacheTtl'], + 'end': value['end'], + 'params': GdalDatasetParametersToJSON(value['params']), + 'resultDescriptor': RasterResultDescriptorToJSON(value['resultDescriptor']), + 'start': value['start'], + 'step': TimeStepToJSON(value['step']), + 'type': value['type'], }; } diff --git a/typescript/src/models/GdalSourceTimePlaceholder.ts b/typescript/src/models/GdalSourceTimePlaceholder.ts index 983b8f1d..a90823a3 100644 --- a/typescript/src/models/GdalSourceTimePlaceholder.ts +++ b/typescript/src/models/GdalSourceTimePlaceholder.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TimeReference } from './TimeReference'; import { TimeReferenceFromJSON, TimeReferenceFromJSONTyped, TimeReferenceToJSON, + TimeReferenceToJSONTyped, } from './TimeReference'; /** @@ -40,15 +41,15 @@ export interface GdalSourceTimePlaceholder { reference: TimeReference; } + + /** * Check if a given object implements the GdalSourceTimePlaceholder interface. */ -export function instanceOfGdalSourceTimePlaceholder(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "format" in value; - isInstance = isInstance && "reference" in value; - - return isInstance; +export function instanceOfGdalSourceTimePlaceholder(value: object): value is GdalSourceTimePlaceholder { + if (!('format' in value) || value['format'] === undefined) return false; + if (!('reference' in value) || value['reference'] === undefined) return false; + return true; } export function GdalSourceTimePlaceholderFromJSON(json: any): GdalSourceTimePlaceholder { @@ -56,7 +57,7 @@ export function GdalSourceTimePlaceholderFromJSON(json: any): GdalSourceTimePlac } export function GdalSourceTimePlaceholderFromJSONTyped(json: any, ignoreDiscriminator: boolean): GdalSourceTimePlaceholder { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -66,17 +67,19 @@ export function GdalSourceTimePlaceholderFromJSONTyped(json: any, ignoreDiscrimi }; } -export function GdalSourceTimePlaceholderToJSON(value?: GdalSourceTimePlaceholder | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GdalSourceTimePlaceholderToJSON(json: any): GdalSourceTimePlaceholder { + return GdalSourceTimePlaceholderToJSONTyped(json, false); +} + +export function GdalSourceTimePlaceholderToJSONTyped(value?: GdalSourceTimePlaceholder | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'format': value.format, - 'reference': TimeReferenceToJSON(value.reference), + 'format': value['format'], + 'reference': TimeReferenceToJSON(value['reference']), }; } diff --git a/typescript/src/models/GeoJson.ts b/typescript/src/models/GeoJson.ts index ba7619d3..12de7785 100644 --- a/typescript/src/models/GeoJson.ts +++ b/typescript/src/models/GeoJson.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { CollectionType } from './CollectionType'; import { CollectionTypeFromJSON, CollectionTypeFromJSONTyped, CollectionTypeToJSON, + CollectionTypeToJSONTyped, } from './CollectionType'; /** @@ -40,15 +41,15 @@ export interface GeoJson { type: CollectionType; } + + /** * Check if a given object implements the GeoJson interface. */ -export function instanceOfGeoJson(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "features" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfGeoJson(value: object): value is GeoJson { + if (!('features' in value) || value['features'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function GeoJsonFromJSON(json: any): GeoJson { @@ -56,7 +57,7 @@ export function GeoJsonFromJSON(json: any): GeoJson { } export function GeoJsonFromJSONTyped(json: any, ignoreDiscriminator: boolean): GeoJson { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -66,17 +67,19 @@ export function GeoJsonFromJSONTyped(json: any, ignoreDiscriminator: boolean): G }; } -export function GeoJsonToJSON(value?: GeoJson | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function GeoJsonToJSON(json: any): GeoJson { + return GeoJsonToJSONTyped(json, false); +} + +export function GeoJsonToJSONTyped(value?: GeoJson | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'features': value.features, - 'type': CollectionTypeToJSON(value.type), + 'features': value['features'], + 'type': CollectionTypeToJSON(value['type']), }; } diff --git a/typescript/src/models/GetCapabilitiesFormat.ts b/typescript/src/models/GetCapabilitiesFormat.ts index cb1131d8..fa0cb14d 100644 --- a/typescript/src/models/GetCapabilitiesFormat.ts +++ b/typescript/src/models/GetCapabilitiesFormat.ts @@ -23,6 +23,17 @@ export const GetCapabilitiesFormat = { export type GetCapabilitiesFormat = typeof GetCapabilitiesFormat[keyof typeof GetCapabilitiesFormat]; +export function instanceOfGetCapabilitiesFormat(value: any): boolean { + for (const key in GetCapabilitiesFormat) { + if (Object.prototype.hasOwnProperty.call(GetCapabilitiesFormat, key)) { + if (GetCapabilitiesFormat[key as keyof typeof GetCapabilitiesFormat] === value) { + return true; + } + } + } + return false; +} + export function GetCapabilitiesFormatFromJSON(json: any): GetCapabilitiesFormat { return GetCapabilitiesFormatFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function GetCapabilitiesFormatToJSON(value?: GetCapabilitiesFormat | null return value as any; } +export function GetCapabilitiesFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCapabilitiesFormat { + return value as GetCapabilitiesFormat; +} + diff --git a/typescript/src/models/GetCapabilitiesRequest.ts b/typescript/src/models/GetCapabilitiesRequest.ts index ed171378..cdf2a36f 100644 --- a/typescript/src/models/GetCapabilitiesRequest.ts +++ b/typescript/src/models/GetCapabilitiesRequest.ts @@ -23,6 +23,17 @@ export const GetCapabilitiesRequest = { export type GetCapabilitiesRequest = typeof GetCapabilitiesRequest[keyof typeof GetCapabilitiesRequest]; +export function instanceOfGetCapabilitiesRequest(value: any): boolean { + for (const key in GetCapabilitiesRequest) { + if (Object.prototype.hasOwnProperty.call(GetCapabilitiesRequest, key)) { + if (GetCapabilitiesRequest[key as keyof typeof GetCapabilitiesRequest] === value) { + return true; + } + } + } + return false; +} + export function GetCapabilitiesRequestFromJSON(json: any): GetCapabilitiesRequest { return GetCapabilitiesRequestFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function GetCapabilitiesRequestToJSON(value?: GetCapabilitiesRequest | nu return value as any; } +export function GetCapabilitiesRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCapabilitiesRequest { + return value as GetCapabilitiesRequest; +} + diff --git a/typescript/src/models/GetCoverageFormat.ts b/typescript/src/models/GetCoverageFormat.ts index e85394df..6e2f0bf8 100644 --- a/typescript/src/models/GetCoverageFormat.ts +++ b/typescript/src/models/GetCoverageFormat.ts @@ -23,6 +23,17 @@ export const GetCoverageFormat = { export type GetCoverageFormat = typeof GetCoverageFormat[keyof typeof GetCoverageFormat]; +export function instanceOfGetCoverageFormat(value: any): boolean { + for (const key in GetCoverageFormat) { + if (Object.prototype.hasOwnProperty.call(GetCoverageFormat, key)) { + if (GetCoverageFormat[key as keyof typeof GetCoverageFormat] === value) { + return true; + } + } + } + return false; +} + export function GetCoverageFormatFromJSON(json: any): GetCoverageFormat { return GetCoverageFormatFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function GetCoverageFormatToJSON(value?: GetCoverageFormat | null): any { return value as any; } +export function GetCoverageFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCoverageFormat { + return value as GetCoverageFormat; +} + diff --git a/typescript/src/models/GetCoverageRequest.ts b/typescript/src/models/GetCoverageRequest.ts index 7b346cc0..af625dd9 100644 --- a/typescript/src/models/GetCoverageRequest.ts +++ b/typescript/src/models/GetCoverageRequest.ts @@ -23,6 +23,17 @@ export const GetCoverageRequest = { export type GetCoverageRequest = typeof GetCoverageRequest[keyof typeof GetCoverageRequest]; +export function instanceOfGetCoverageRequest(value: any): boolean { + for (const key in GetCoverageRequest) { + if (Object.prototype.hasOwnProperty.call(GetCoverageRequest, key)) { + if (GetCoverageRequest[key as keyof typeof GetCoverageRequest] === value) { + return true; + } + } + } + return false; +} + export function GetCoverageRequestFromJSON(json: any): GetCoverageRequest { return GetCoverageRequestFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function GetCoverageRequestToJSON(value?: GetCoverageRequest | null): any return value as any; } +export function GetCoverageRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetCoverageRequest { + return value as GetCoverageRequest; +} + diff --git a/typescript/src/models/GetFeatureRequest.ts b/typescript/src/models/GetFeatureRequest.ts index afb70db1..97424509 100644 --- a/typescript/src/models/GetFeatureRequest.ts +++ b/typescript/src/models/GetFeatureRequest.ts @@ -23,6 +23,17 @@ export const GetFeatureRequest = { export type GetFeatureRequest = typeof GetFeatureRequest[keyof typeof GetFeatureRequest]; +export function instanceOfGetFeatureRequest(value: any): boolean { + for (const key in GetFeatureRequest) { + if (Object.prototype.hasOwnProperty.call(GetFeatureRequest, key)) { + if (GetFeatureRequest[key as keyof typeof GetFeatureRequest] === value) { + return true; + } + } + } + return false; +} + export function GetFeatureRequestFromJSON(json: any): GetFeatureRequest { return GetFeatureRequestFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function GetFeatureRequestToJSON(value?: GetFeatureRequest | null): any { return value as any; } +export function GetFeatureRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetFeatureRequest { + return value as GetFeatureRequest; +} + diff --git a/typescript/src/models/GetLegendGraphicRequest.ts b/typescript/src/models/GetLegendGraphicRequest.ts index 2f846a44..5cb9ab7e 100644 --- a/typescript/src/models/GetLegendGraphicRequest.ts +++ b/typescript/src/models/GetLegendGraphicRequest.ts @@ -23,6 +23,17 @@ export const GetLegendGraphicRequest = { export type GetLegendGraphicRequest = typeof GetLegendGraphicRequest[keyof typeof GetLegendGraphicRequest]; +export function instanceOfGetLegendGraphicRequest(value: any): boolean { + for (const key in GetLegendGraphicRequest) { + if (Object.prototype.hasOwnProperty.call(GetLegendGraphicRequest, key)) { + if (GetLegendGraphicRequest[key as keyof typeof GetLegendGraphicRequest] === value) { + return true; + } + } + } + return false; +} + export function GetLegendGraphicRequestFromJSON(json: any): GetLegendGraphicRequest { return GetLegendGraphicRequestFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function GetLegendGraphicRequestToJSON(value?: GetLegendGraphicRequest | return value as any; } +export function GetLegendGraphicRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetLegendGraphicRequest { + return value as GetLegendGraphicRequest; +} + diff --git a/typescript/src/models/GetMapExceptionFormat.ts b/typescript/src/models/GetMapExceptionFormat.ts index 26e6d772..5aa42787 100644 --- a/typescript/src/models/GetMapExceptionFormat.ts +++ b/typescript/src/models/GetMapExceptionFormat.ts @@ -24,6 +24,17 @@ export const GetMapExceptionFormat = { export type GetMapExceptionFormat = typeof GetMapExceptionFormat[keyof typeof GetMapExceptionFormat]; +export function instanceOfGetMapExceptionFormat(value: any): boolean { + for (const key in GetMapExceptionFormat) { + if (Object.prototype.hasOwnProperty.call(GetMapExceptionFormat, key)) { + if (GetMapExceptionFormat[key as keyof typeof GetMapExceptionFormat] === value) { + return true; + } + } + } + return false; +} + export function GetMapExceptionFormatFromJSON(json: any): GetMapExceptionFormat { return GetMapExceptionFormatFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function GetMapExceptionFormatToJSON(value?: GetMapExceptionFormat | null return value as any; } +export function GetMapExceptionFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetMapExceptionFormat { + return value as GetMapExceptionFormat; +} + diff --git a/typescript/src/models/GetMapFormat.ts b/typescript/src/models/GetMapFormat.ts index 4fb0f971..45914006 100644 --- a/typescript/src/models/GetMapFormat.ts +++ b/typescript/src/models/GetMapFormat.ts @@ -23,6 +23,17 @@ export const GetMapFormat = { export type GetMapFormat = typeof GetMapFormat[keyof typeof GetMapFormat]; +export function instanceOfGetMapFormat(value: any): boolean { + for (const key in GetMapFormat) { + if (Object.prototype.hasOwnProperty.call(GetMapFormat, key)) { + if (GetMapFormat[key as keyof typeof GetMapFormat] === value) { + return true; + } + } + } + return false; +} + export function GetMapFormatFromJSON(json: any): GetMapFormat { return GetMapFormatFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function GetMapFormatToJSON(value?: GetMapFormat | null): any { return value as any; } +export function GetMapFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): GetMapFormat { + return value as GetMapFormat; +} + diff --git a/typescript/src/models/GetMapRequest.ts b/typescript/src/models/GetMapRequest.ts index 6f795e63..52f24743 100644 --- a/typescript/src/models/GetMapRequest.ts +++ b/typescript/src/models/GetMapRequest.ts @@ -23,6 +23,17 @@ export const GetMapRequest = { export type GetMapRequest = typeof GetMapRequest[keyof typeof GetMapRequest]; +export function instanceOfGetMapRequest(value: any): boolean { + for (const key in GetMapRequest) { + if (Object.prototype.hasOwnProperty.call(GetMapRequest, key)) { + if (GetMapRequest[key as keyof typeof GetMapRequest] === value) { + return true; + } + } + } + return false; +} + export function GetMapRequestFromJSON(json: any): GetMapRequest { return GetMapRequestFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function GetMapRequestToJSON(value?: GetMapRequest | null): any { return value as any; } +export function GetMapRequestToJSONTyped(value: any, ignoreDiscriminator: boolean): GetMapRequest { + return value as GetMapRequest; +} + diff --git a/typescript/src/models/InlineObject.ts b/typescript/src/models/InlineObject.ts new file mode 100644 index 00000000..78eb213b --- /dev/null +++ b/typescript/src/models/InlineObject.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: dev@geoengine.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineObject + */ +export interface InlineObject { + /** + * + * @type {string} + * @memberof InlineObject + */ + url: string; +} + +/** + * Check if a given object implements the InlineObject interface. + */ +export function instanceOfInlineObject(value: object): value is InlineObject { + if (!('url' in value) || value['url'] === undefined) return false; + return true; +} + +export function InlineObjectFromJSON(json: any): InlineObject { + return InlineObjectFromJSONTyped(json, false); +} + +export function InlineObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): InlineObject { + if (json == null) { + return json; + } + return { + + 'url': json['url'], + }; +} + +export function InlineObjectToJSON(json: any): InlineObject { + return InlineObjectToJSONTyped(json, false); +} + +export function InlineObjectToJSONTyped(value?: InlineObject | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'url': value['url'], + }; +} + diff --git a/typescript/src/models/InternalDataId.ts b/typescript/src/models/InternalDataId.ts index d9f81fc1..a3d5d10f 100644 --- a/typescript/src/models/InternalDataId.ts +++ b/typescript/src/models/InternalDataId.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -38,8 +38,7 @@ export interface InternalDataId { * @export */ export const InternalDataIdTypeEnum = { - Internal: 'internal', - External: 'external' + Internal: 'internal' } as const; export type InternalDataIdTypeEnum = typeof InternalDataIdTypeEnum[keyof typeof InternalDataIdTypeEnum]; @@ -47,12 +46,10 @@ export type InternalDataIdTypeEnum = typeof InternalDataIdTypeEnum[keyof typeof /** * Check if a given object implements the InternalDataId interface. */ -export function instanceOfInternalDataId(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "datasetId" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfInternalDataId(value: object): value is InternalDataId { + if (!('datasetId' in value) || value['datasetId'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function InternalDataIdFromJSON(json: any): InternalDataId { @@ -60,7 +57,7 @@ export function InternalDataIdFromJSON(json: any): InternalDataId { } export function InternalDataIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): InternalDataId { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -70,17 +67,19 @@ export function InternalDataIdFromJSONTyped(json: any, ignoreDiscriminator: bool }; } -export function InternalDataIdToJSON(value?: InternalDataId | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function InternalDataIdToJSON(json: any): InternalDataId { + return InternalDataIdToJSONTyped(json, false); +} + +export function InternalDataIdToJSONTyped(value?: InternalDataId | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'datasetId': value.datasetId, - 'type': value.type, + 'datasetId': value['datasetId'], + 'type': value['type'], }; } diff --git a/typescript/src/models/Layer.ts b/typescript/src/models/Layer.ts index 9102779e..99229708 100644 --- a/typescript/src/models/Layer.ts +++ b/typescript/src/models/Layer.ts @@ -12,24 +12,27 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { ProviderLayerId } from './ProviderLayerId'; -import { - ProviderLayerIdFromJSON, - ProviderLayerIdFromJSONTyped, - ProviderLayerIdToJSON, -} from './ProviderLayerId'; +import { mapValues } from '../runtime'; import type { Symbology } from './Symbology'; import { SymbologyFromJSON, SymbologyFromJSONTyped, SymbologyToJSON, + SymbologyToJSONTyped, } from './Symbology'; +import type { ProviderLayerId } from './ProviderLayerId'; +import { + ProviderLayerIdFromJSON, + ProviderLayerIdFromJSONTyped, + ProviderLayerIdToJSON, + ProviderLayerIdToJSONTyped, +} from './ProviderLayerId'; import type { Workflow } from './Workflow'; import { WorkflowFromJSON, WorkflowFromJSONTyped, WorkflowToJSON, + WorkflowToJSONTyped, } from './Workflow'; /** @@ -85,14 +88,12 @@ export interface Layer { /** * Check if a given object implements the Layer interface. */ -export function instanceOfLayer(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - - return isInstance; +export function instanceOfLayer(value: object): value is Layer { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('workflow' in value) || value['workflow'] === undefined) return false; + return true; } export function LayerFromJSON(json: any): Layer { @@ -100,37 +101,39 @@ export function LayerFromJSON(json: any): Layer { } export function LayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): Layer { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'id': ProviderLayerIdFromJSON(json['id']), - 'metadata': !exists(json, 'metadata') ? undefined : json['metadata'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), + 'properties': json['properties'] == null ? undefined : json['properties'], + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), 'workflow': WorkflowFromJSON(json['workflow']), }; } -export function LayerToJSON(value?: Layer | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerToJSON(json: any): Layer { + return LayerToJSONTyped(json, false); +} + +export function LayerToJSONTyped(value?: Layer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'id': ProviderLayerIdToJSON(value.id), - 'metadata': value.metadata, - 'name': value.name, - 'properties': value.properties, - 'symbology': SymbologyToJSON(value.symbology), - 'workflow': WorkflowToJSON(value.workflow), + 'description': value['description'], + 'id': ProviderLayerIdToJSON(value['id']), + 'metadata': value['metadata'], + 'name': value['name'], + 'properties': value['properties'], + 'symbology': SymbologyToJSON(value['symbology']), + 'workflow': WorkflowToJSON(value['workflow']), }; } diff --git a/typescript/src/models/LayerCollection.ts b/typescript/src/models/LayerCollection.ts index 3a2306ab..133cd22a 100644 --- a/typescript/src/models/LayerCollection.ts +++ b/typescript/src/models/LayerCollection.ts @@ -12,18 +12,20 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { CollectionItem } from './CollectionItem'; import { CollectionItemFromJSON, CollectionItemFromJSONTyped, CollectionItemToJSON, + CollectionItemToJSONTyped, } from './CollectionItem'; import type { ProviderLayerCollectionId } from './ProviderLayerCollectionId'; import { ProviderLayerCollectionIdFromJSON, ProviderLayerCollectionIdFromJSONTyped, ProviderLayerCollectionIdToJSON, + ProviderLayerCollectionIdToJSONTyped, } from './ProviderLayerCollectionId'; /** @@ -73,15 +75,13 @@ export interface LayerCollection { /** * Check if a given object implements the LayerCollection interface. */ -export function instanceOfLayerCollection(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "items" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "properties" in value; - - return isInstance; +export function instanceOfLayerCollection(value: object): value is LayerCollection { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('items' in value) || value['items'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('properties' in value) || value['properties'] === undefined) return false; + return true; } export function LayerCollectionFromJSON(json: any): LayerCollection { @@ -89,13 +89,13 @@ export function LayerCollectionFromJSON(json: any): LayerCollection { } export function LayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerCollection { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], - 'entryLabel': !exists(json, 'entryLabel') ? undefined : json['entryLabel'], + 'entryLabel': json['entryLabel'] == null ? undefined : json['entryLabel'], 'id': ProviderLayerCollectionIdFromJSON(json['id']), 'items': ((json['items'] as Array).map(CollectionItemFromJSON)), 'name': json['name'], @@ -103,21 +103,23 @@ export function LayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function LayerCollectionToJSON(value?: LayerCollection | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerCollectionToJSON(json: any): LayerCollection { + return LayerCollectionToJSONTyped(json, false); +} + +export function LayerCollectionToJSONTyped(value?: LayerCollection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'entryLabel': value.entryLabel, - 'id': ProviderLayerCollectionIdToJSON(value.id), - 'items': ((value.items as Array).map(CollectionItemToJSON)), - 'name': value.name, - 'properties': value.properties, + 'description': value['description'], + 'entryLabel': value['entryLabel'], + 'id': ProviderLayerCollectionIdToJSON(value['id']), + 'items': ((value['items'] as Array).map(CollectionItemToJSON)), + 'name': value['name'], + 'properties': value['properties'], }; } diff --git a/typescript/src/models/LayerCollectionListing.ts b/typescript/src/models/LayerCollectionListing.ts index a4b93000..ab40cc5f 100644 --- a/typescript/src/models/LayerCollectionListing.ts +++ b/typescript/src/models/LayerCollectionListing.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { ProviderLayerCollectionId } from './ProviderLayerCollectionId'; import { ProviderLayerCollectionIdFromJSON, ProviderLayerCollectionIdFromJSONTyped, ProviderLayerCollectionIdToJSON, + ProviderLayerCollectionIdToJSONTyped, } from './ProviderLayerCollectionId'; /** @@ -63,8 +64,7 @@ export interface LayerCollectionListing { * @export */ export const LayerCollectionListingTypeEnum = { - Collection: 'collection', - Layer: 'layer' + Collection: 'collection' } as const; export type LayerCollectionListingTypeEnum = typeof LayerCollectionListingTypeEnum[keyof typeof LayerCollectionListingTypeEnum]; @@ -72,14 +72,12 @@ export type LayerCollectionListingTypeEnum = typeof LayerCollectionListingTypeEn /** * Check if a given object implements the LayerCollectionListing interface. */ -export function instanceOfLayerCollectionListing(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfLayerCollectionListing(value: object): value is LayerCollectionListing { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function LayerCollectionListingFromJSON(json: any): LayerCollectionListing { @@ -87,7 +85,7 @@ export function LayerCollectionListingFromJSON(json: any): LayerCollectionListin } export function LayerCollectionListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerCollectionListing { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -95,25 +93,27 @@ export function LayerCollectionListingFromJSONTyped(json: any, ignoreDiscriminat 'description': json['description'], 'id': ProviderLayerCollectionIdFromJSON(json['id']), 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], 'type': json['type'], }; } -export function LayerCollectionListingToJSON(value?: LayerCollectionListing | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerCollectionListingToJSON(json: any): LayerCollectionListing { + return LayerCollectionListingToJSONTyped(json, false); +} + +export function LayerCollectionListingToJSONTyped(value?: LayerCollectionListing | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'id': ProviderLayerCollectionIdToJSON(value.id), - 'name': value.name, - 'properties': value.properties, - 'type': value.type, + 'description': value['description'], + 'id': ProviderLayerCollectionIdToJSON(value['id']), + 'name': value['name'], + 'properties': value['properties'], + 'type': value['type'], }; } diff --git a/typescript/src/models/LayerCollectionResource.ts b/typescript/src/models/LayerCollectionResource.ts index df288bc5..1a692b88 100644 --- a/typescript/src/models/LayerCollectionResource.ts +++ b/typescript/src/models/LayerCollectionResource.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type LayerCollectionResourceTypeEnum = typeof LayerCollectionResourceType /** * Check if a given object implements the LayerCollectionResource interface. */ -export function instanceOfLayerCollectionResource(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfLayerCollectionResource(value: object): value is LayerCollectionResource { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function LayerCollectionResourceFromJSON(json: any): LayerCollectionResource { @@ -59,7 +57,7 @@ export function LayerCollectionResourceFromJSON(json: any): LayerCollectionResou } export function LayerCollectionResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerCollectionResource { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function LayerCollectionResourceFromJSONTyped(json: any, ignoreDiscrimina }; } -export function LayerCollectionResourceToJSON(value?: LayerCollectionResource | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerCollectionResourceToJSON(json: any): LayerCollectionResource { + return LayerCollectionResourceToJSONTyped(json, false); +} + +export function LayerCollectionResourceToJSONTyped(value?: LayerCollectionResource | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/src/models/LayerListing.ts b/typescript/src/models/LayerListing.ts index 34f15c17..6d4801a9 100644 --- a/typescript/src/models/LayerListing.ts +++ b/typescript/src/models/LayerListing.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { ProviderLayerId } from './ProviderLayerId'; import { ProviderLayerIdFromJSON, ProviderLayerIdFromJSONTyped, ProviderLayerIdToJSON, + ProviderLayerIdToJSONTyped, } from './ProviderLayerId'; /** @@ -71,14 +72,12 @@ export type LayerListingTypeEnum = typeof LayerListingTypeEnum[keyof typeof Laye /** * Check if a given object implements the LayerListing interface. */ -export function instanceOfLayerListing(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfLayerListing(value: object): value is LayerListing { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function LayerListingFromJSON(json: any): LayerListing { @@ -86,7 +85,7 @@ export function LayerListingFromJSON(json: any): LayerListing { } export function LayerListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerListing { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -94,25 +93,27 @@ export function LayerListingFromJSONTyped(json: any, ignoreDiscriminator: boolea 'description': json['description'], 'id': ProviderLayerIdFromJSON(json['id']), 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], 'type': json['type'], }; } -export function LayerListingToJSON(value?: LayerListing | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerListingToJSON(json: any): LayerListing { + return LayerListingToJSONTyped(json, false); +} + +export function LayerListingToJSONTyped(value?: LayerListing | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'id': ProviderLayerIdToJSON(value.id), - 'name': value.name, - 'properties': value.properties, - 'type': value.type, + 'description': value['description'], + 'id': ProviderLayerIdToJSON(value['id']), + 'name': value['name'], + 'properties': value['properties'], + 'type': value['type'], }; } diff --git a/typescript/src/models/LayerResource.ts b/typescript/src/models/LayerResource.ts index ce091d55..ceebd59b 100644 --- a/typescript/src/models/LayerResource.ts +++ b/typescript/src/models/LayerResource.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type LayerResourceTypeEnum = typeof LayerResourceTypeEnum[keyof typeof La /** * Check if a given object implements the LayerResource interface. */ -export function instanceOfLayerResource(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfLayerResource(value: object): value is LayerResource { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function LayerResourceFromJSON(json: any): LayerResource { @@ -59,7 +57,7 @@ export function LayerResourceFromJSON(json: any): LayerResource { } export function LayerResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerResource { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function LayerResourceFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function LayerResourceToJSON(value?: LayerResource | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerResourceToJSON(json: any): LayerResource { + return LayerResourceToJSONTyped(json, false); +} + +export function LayerResourceToJSONTyped(value?: LayerResource | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/src/models/LayerUpdate.ts b/typescript/src/models/LayerUpdate.ts index c0f03977..87eaa5b6 100644 --- a/typescript/src/models/LayerUpdate.ts +++ b/typescript/src/models/LayerUpdate.ts @@ -12,15 +12,15 @@ * Do not edit the class manually. */ +import type { ProjectLayer } from './ProjectLayer'; import { - ProjectLayer, instanceOfProjectLayer, ProjectLayerFromJSON, ProjectLayerFromJSONTyped, ProjectLayerToJSON, } from './ProjectLayer'; +import type { ProjectUpdateToken } from './ProjectUpdateToken'; import { - ProjectUpdateToken, instanceOfProjectUpdateToken, ProjectUpdateTokenFromJSON, ProjectUpdateTokenFromJSONTyped, @@ -39,24 +39,26 @@ export function LayerUpdateFromJSON(json: any): LayerUpdate { } export function LayerUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerUpdate { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - if (json === ProjectUpdateToken.None) { - return ProjectUpdateToken.None; - } else if (json === ProjectUpdateToken.Delete) { - return ProjectUpdateToken.Delete; - } else { - return { ...ProjectLayerFromJSONTyped(json, true) }; + if (instanceOfProjectLayer(json)) { + return ProjectLayerFromJSONTyped(json, true); } + if (instanceOfProjectUpdateToken(json)) { + return ProjectUpdateTokenFromJSONTyped(json, true); + } + + return {} as any; } -export function LayerUpdateToJSON(value?: LayerUpdate | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerUpdateToJSON(json: any): any { + return LayerUpdateToJSONTyped(json, false); +} + +export function LayerUpdateToJSONTyped(value?: LayerUpdate | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } if (typeof value === 'object' && instanceOfProjectLayer(value)) { diff --git a/typescript/src/models/LayerVisibility.ts b/typescript/src/models/LayerVisibility.ts index 3722cdab..481b4f01 100644 --- a/typescript/src/models/LayerVisibility.ts +++ b/typescript/src/models/LayerVisibility.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface LayerVisibility { /** * Check if a given object implements the LayerVisibility interface. */ -export function instanceOfLayerVisibility(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "legend" in value; - - return isInstance; +export function instanceOfLayerVisibility(value: object): value is LayerVisibility { + if (!('data' in value) || value['data'] === undefined) return false; + if (!('legend' in value) || value['legend'] === undefined) return false; + return true; } export function LayerVisibilityFromJSON(json: any): LayerVisibility { @@ -49,7 +47,7 @@ export function LayerVisibilityFromJSON(json: any): LayerVisibility { } export function LayerVisibilityFromJSONTyped(json: any, ignoreDiscriminator: boolean): LayerVisibility { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function LayerVisibilityFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function LayerVisibilityToJSON(value?: LayerVisibility | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LayerVisibilityToJSON(json: any): LayerVisibility { + return LayerVisibilityToJSONTyped(json, false); +} + +export function LayerVisibilityToJSONTyped(value?: LayerVisibility | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'data': value.data, - 'legend': value.legend, + 'data': value['data'], + 'legend': value['legend'], }; } diff --git a/typescript/src/models/LineSymbology.ts b/typescript/src/models/LineSymbology.ts index 3b008a26..2e3d24a4 100644 --- a/typescript/src/models/LineSymbology.ts +++ b/typescript/src/models/LineSymbology.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { StrokeParam } from './StrokeParam'; -import { - StrokeParamFromJSON, - StrokeParamFromJSONTyped, - StrokeParamToJSON, -} from './StrokeParam'; +import { mapValues } from '../runtime'; import type { TextSymbology } from './TextSymbology'; import { TextSymbologyFromJSON, TextSymbologyFromJSONTyped, TextSymbologyToJSON, + TextSymbologyToJSONTyped, } from './TextSymbology'; +import type { StrokeParam } from './StrokeParam'; +import { + StrokeParamFromJSON, + StrokeParamFromJSONTyped, + StrokeParamToJSON, + StrokeParamToJSONTyped, +} from './StrokeParam'; /** * @@ -71,13 +73,11 @@ export type LineSymbologyTypeEnum = typeof LineSymbologyTypeEnum[keyof typeof Li /** * Check if a given object implements the LineSymbology interface. */ -export function instanceOfLineSymbology(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "autoSimplified" in value; - isInstance = isInstance && "stroke" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfLineSymbology(value: object): value is LineSymbology { + if (!('autoSimplified' in value) || value['autoSimplified'] === undefined) return false; + if (!('stroke' in value) || value['stroke'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function LineSymbologyFromJSON(json: any): LineSymbology { @@ -85,31 +85,33 @@ export function LineSymbologyFromJSON(json: any): LineSymbology { } export function LineSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): LineSymbology { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'autoSimplified': json['autoSimplified'], 'stroke': StrokeParamFromJSON(json['stroke']), - 'text': !exists(json, 'text') ? undefined : TextSymbologyFromJSON(json['text']), + 'text': json['text'] == null ? undefined : TextSymbologyFromJSON(json['text']), 'type': json['type'], }; } -export function LineSymbologyToJSON(value?: LineSymbology | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LineSymbologyToJSON(json: any): LineSymbology { + return LineSymbologyToJSONTyped(json, false); +} + +export function LineSymbologyToJSONTyped(value?: LineSymbology | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'autoSimplified': value.autoSimplified, - 'stroke': StrokeParamToJSON(value.stroke), - 'text': TextSymbologyToJSON(value.text), - 'type': value.type, + 'autoSimplified': value['autoSimplified'], + 'stroke': StrokeParamToJSON(value['stroke']), + 'text': TextSymbologyToJSON(value['text']), + 'type': value['type'], }; } diff --git a/typescript/src/models/LinearGradient.ts b/typescript/src/models/LinearGradient.ts index 5a1610bf..85d90577 100644 --- a/typescript/src/models/LinearGradient.ts +++ b/typescript/src/models/LinearGradient.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Breakpoint } from './Breakpoint'; import { BreakpointFromJSON, BreakpointFromJSONTyped, BreakpointToJSON, + BreakpointToJSONTyped, } from './Breakpoint'; /** @@ -63,9 +64,7 @@ export interface LinearGradient { * @export */ export const LinearGradientTypeEnum = { - LinearGradient: 'linearGradient', - LogarithmicGradient: 'logarithmicGradient', - Palette: 'palette' + LinearGradient: 'linearGradient' } as const; export type LinearGradientTypeEnum = typeof LinearGradientTypeEnum[keyof typeof LinearGradientTypeEnum]; @@ -73,15 +72,13 @@ export type LinearGradientTypeEnum = typeof LinearGradientTypeEnum[keyof typeof /** * Check if a given object implements the LinearGradient interface. */ -export function instanceOfLinearGradient(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "breakpoints" in value; - isInstance = isInstance && "noDataColor" in value; - isInstance = isInstance && "overColor" in value; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "underColor" in value; - - return isInstance; +export function instanceOfLinearGradient(value: object): value is LinearGradient { + if (!('breakpoints' in value) || value['breakpoints'] === undefined) return false; + if (!('noDataColor' in value) || value['noDataColor'] === undefined) return false; + if (!('overColor' in value) || value['overColor'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + if (!('underColor' in value) || value['underColor'] === undefined) return false; + return true; } export function LinearGradientFromJSON(json: any): LinearGradient { @@ -89,7 +86,7 @@ export function LinearGradientFromJSON(json: any): LinearGradient { } export function LinearGradientFromJSONTyped(json: any, ignoreDiscriminator: boolean): LinearGradient { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -102,20 +99,22 @@ export function LinearGradientFromJSONTyped(json: any, ignoreDiscriminator: bool }; } -export function LinearGradientToJSON(value?: LinearGradient | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LinearGradientToJSON(json: any): LinearGradient { + return LinearGradientToJSONTyped(json, false); +} + +export function LinearGradientToJSONTyped(value?: LinearGradient | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'breakpoints': ((value.breakpoints as Array).map(BreakpointToJSON)), - 'noDataColor': value.noDataColor, - 'overColor': value.overColor, - 'type': value.type, - 'underColor': value.underColor, + 'breakpoints': ((value['breakpoints'] as Array).map(BreakpointToJSON)), + 'noDataColor': value['noDataColor'], + 'overColor': value['overColor'], + 'type': value['type'], + 'underColor': value['underColor'], }; } diff --git a/typescript/src/models/LogarithmicGradient.ts b/typescript/src/models/LogarithmicGradient.ts index 16198af6..9072330c 100644 --- a/typescript/src/models/LogarithmicGradient.ts +++ b/typescript/src/models/LogarithmicGradient.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Breakpoint } from './Breakpoint'; import { BreakpointFromJSON, BreakpointFromJSONTyped, BreakpointToJSON, + BreakpointToJSONTyped, } from './Breakpoint'; /** @@ -71,15 +72,13 @@ export type LogarithmicGradientTypeEnum = typeof LogarithmicGradientTypeEnum[key /** * Check if a given object implements the LogarithmicGradient interface. */ -export function instanceOfLogarithmicGradient(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "breakpoints" in value; - isInstance = isInstance && "noDataColor" in value; - isInstance = isInstance && "overColor" in value; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "underColor" in value; - - return isInstance; +export function instanceOfLogarithmicGradient(value: object): value is LogarithmicGradient { + if (!('breakpoints' in value) || value['breakpoints'] === undefined) return false; + if (!('noDataColor' in value) || value['noDataColor'] === undefined) return false; + if (!('overColor' in value) || value['overColor'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + if (!('underColor' in value) || value['underColor'] === undefined) return false; + return true; } export function LogarithmicGradientFromJSON(json: any): LogarithmicGradient { @@ -87,7 +86,7 @@ export function LogarithmicGradientFromJSON(json: any): LogarithmicGradient { } export function LogarithmicGradientFromJSONTyped(json: any, ignoreDiscriminator: boolean): LogarithmicGradient { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -100,20 +99,22 @@ export function LogarithmicGradientFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function LogarithmicGradientToJSON(value?: LogarithmicGradient | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function LogarithmicGradientToJSON(json: any): LogarithmicGradient { + return LogarithmicGradientToJSONTyped(json, false); +} + +export function LogarithmicGradientToJSONTyped(value?: LogarithmicGradient | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'breakpoints': ((value.breakpoints as Array).map(BreakpointToJSON)), - 'noDataColor': value.noDataColor, - 'overColor': value.overColor, - 'type': value.type, - 'underColor': value.underColor, + 'breakpoints': ((value['breakpoints'] as Array).map(BreakpointToJSON)), + 'noDataColor': value['noDataColor'], + 'overColor': value['overColor'], + 'type': value['type'], + 'underColor': value['underColor'], }; } diff --git a/typescript/src/models/Measurement.ts b/typescript/src/models/Measurement.ts index 8eeb9818..41b18095 100644 --- a/typescript/src/models/Measurement.ts +++ b/typescript/src/models/Measurement.ts @@ -12,22 +12,22 @@ * Do not edit the class manually. */ +import type { ClassificationMeasurement } from './ClassificationMeasurement'; import { - ClassificationMeasurement, instanceOfClassificationMeasurement, ClassificationMeasurementFromJSON, ClassificationMeasurementFromJSONTyped, ClassificationMeasurementToJSON, } from './ClassificationMeasurement'; +import type { ContinuousMeasurement } from './ContinuousMeasurement'; import { - ContinuousMeasurement, instanceOfContinuousMeasurement, ContinuousMeasurementFromJSON, ContinuousMeasurementFromJSONTyped, ContinuousMeasurementToJSON, } from './ContinuousMeasurement'; +import type { UnitlessMeasurement } from './UnitlessMeasurement'; import { - UnitlessMeasurement, instanceOfUnitlessMeasurement, UnitlessMeasurementFromJSON, UnitlessMeasurementFromJSONTyped, @@ -46,35 +46,36 @@ export function MeasurementFromJSON(json: any): Measurement { } export function MeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): Measurement { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'classification': - return {...ClassificationMeasurementFromJSONTyped(json, true), type: 'classification'}; + return Object.assign({}, ClassificationMeasurementFromJSONTyped(json, true), { type: 'classification' } as const); case 'continuous': - return {...ContinuousMeasurementFromJSONTyped(json, true), type: 'continuous'}; + return Object.assign({}, ContinuousMeasurementFromJSONTyped(json, true), { type: 'continuous' } as const); case 'unitless': - return {...UnitlessMeasurementFromJSONTyped(json, true), type: 'unitless'}; + return Object.assign({}, UnitlessMeasurementFromJSONTyped(json, true), { type: 'unitless' } as const); default: throw new Error(`No variant of Measurement exists with 'type=${json['type']}'`); } } -export function MeasurementToJSON(value?: Measurement | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MeasurementToJSON(json: any): any { + return MeasurementToJSONTyped(json, false); +} + +export function MeasurementToJSONTyped(value?: Measurement | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'classification': - return ClassificationMeasurementToJSON(value); + return Object.assign({}, ClassificationMeasurementToJSON(value), { type: 'classification' } as const); case 'continuous': - return ContinuousMeasurementToJSON(value); + return Object.assign({}, ContinuousMeasurementToJSON(value), { type: 'continuous' } as const); case 'unitless': - return UnitlessMeasurementToJSON(value); + return Object.assign({}, UnitlessMeasurementToJSON(value), { type: 'unitless' } as const); default: throw new Error(`No variant of Measurement exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/MetaDataDefinition.ts b/typescript/src/models/MetaDataDefinition.ts index 8dd9957f..3d9b6fcc 100644 --- a/typescript/src/models/MetaDataDefinition.ts +++ b/typescript/src/models/MetaDataDefinition.ts @@ -12,43 +12,43 @@ * Do not edit the class manually. */ +import type { GdalMetaDataList } from './GdalMetaDataList'; import { - GdalMetaDataList, instanceOfGdalMetaDataList, GdalMetaDataListFromJSON, GdalMetaDataListFromJSONTyped, GdalMetaDataListToJSON, } from './GdalMetaDataList'; +import type { GdalMetaDataRegular } from './GdalMetaDataRegular'; import { - GdalMetaDataRegular, instanceOfGdalMetaDataRegular, GdalMetaDataRegularFromJSON, GdalMetaDataRegularFromJSONTyped, GdalMetaDataRegularToJSON, } from './GdalMetaDataRegular'; +import type { GdalMetaDataStatic } from './GdalMetaDataStatic'; import { - GdalMetaDataStatic, instanceOfGdalMetaDataStatic, GdalMetaDataStaticFromJSON, GdalMetaDataStaticFromJSONTyped, GdalMetaDataStaticToJSON, } from './GdalMetaDataStatic'; +import type { GdalMetadataNetCdfCf } from './GdalMetadataNetCdfCf'; import { - GdalMetadataNetCdfCf, instanceOfGdalMetadataNetCdfCf, GdalMetadataNetCdfCfFromJSON, GdalMetadataNetCdfCfFromJSONTyped, GdalMetadataNetCdfCfToJSON, } from './GdalMetadataNetCdfCf'; +import type { MockMetaData } from './MockMetaData'; import { - MockMetaData, instanceOfMockMetaData, MockMetaDataFromJSON, MockMetaDataFromJSONTyped, MockMetaDataToJSON, } from './MockMetaData'; +import type { OgrMetaData } from './OgrMetaData'; import { - OgrMetaData, instanceOfOgrMetaData, OgrMetaDataFromJSON, OgrMetaDataFromJSONTyped, @@ -67,47 +67,48 @@ export function MetaDataDefinitionFromJSON(json: any): MetaDataDefinition { } export function MetaDataDefinitionFromJSONTyped(json: any, ignoreDiscriminator: boolean): MetaDataDefinition { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'GdalMetaDataList': - return {...GdalMetaDataListFromJSONTyped(json, true), type: 'GdalMetaDataList'}; + return Object.assign({}, GdalMetaDataListFromJSONTyped(json, true), { type: 'GdalMetaDataList' } as const); case 'GdalMetaDataRegular': - return {...GdalMetaDataRegularFromJSONTyped(json, true), type: 'GdalMetaDataRegular'}; + return Object.assign({}, GdalMetaDataRegularFromJSONTyped(json, true), { type: 'GdalMetaDataRegular' } as const); case 'GdalMetadataNetCdfCf': - return {...GdalMetadataNetCdfCfFromJSONTyped(json, true), type: 'GdalMetadataNetCdfCf'}; + return Object.assign({}, GdalMetadataNetCdfCfFromJSONTyped(json, true), { type: 'GdalMetadataNetCdfCf' } as const); case 'GdalStatic': - return {...GdalMetaDataStaticFromJSONTyped(json, true), type: 'GdalStatic'}; + return Object.assign({}, GdalMetaDataStaticFromJSONTyped(json, true), { type: 'GdalStatic' } as const); case 'MockMetaData': - return {...MockMetaDataFromJSONTyped(json, true), type: 'MockMetaData'}; + return Object.assign({}, MockMetaDataFromJSONTyped(json, true), { type: 'MockMetaData' } as const); case 'OgrMetaData': - return {...OgrMetaDataFromJSONTyped(json, true), type: 'OgrMetaData'}; + return Object.assign({}, OgrMetaDataFromJSONTyped(json, true), { type: 'OgrMetaData' } as const); default: throw new Error(`No variant of MetaDataDefinition exists with 'type=${json['type']}'`); } } -export function MetaDataDefinitionToJSON(value?: MetaDataDefinition | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MetaDataDefinitionToJSON(json: any): any { + return MetaDataDefinitionToJSONTyped(json, false); +} + +export function MetaDataDefinitionToJSONTyped(value?: MetaDataDefinition | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'GdalMetaDataList': - return GdalMetaDataListToJSON(value); + return Object.assign({}, GdalMetaDataListToJSON(value), { type: 'GdalMetaDataList' } as const); case 'GdalMetaDataRegular': - return GdalMetaDataRegularToJSON(value); + return Object.assign({}, GdalMetaDataRegularToJSON(value), { type: 'GdalMetaDataRegular' } as const); case 'GdalMetadataNetCdfCf': - return GdalMetadataNetCdfCfToJSON(value); + return Object.assign({}, GdalMetadataNetCdfCfToJSON(value), { type: 'GdalMetadataNetCdfCf' } as const); case 'GdalStatic': - return GdalMetaDataStaticToJSON(value); + return Object.assign({}, GdalMetaDataStaticToJSON(value), { type: 'GdalStatic' } as const); case 'MockMetaData': - return MockMetaDataToJSON(value); + return Object.assign({}, MockMetaDataToJSON(value), { type: 'MockMetaData' } as const); case 'OgrMetaData': - return OgrMetaDataToJSON(value); + return Object.assign({}, OgrMetaDataToJSON(value), { type: 'OgrMetaData' } as const); default: throw new Error(`No variant of MetaDataDefinition exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/MetaDataSuggestion.ts b/typescript/src/models/MetaDataSuggestion.ts index 8b0e637c..3df0037a 100644 --- a/typescript/src/models/MetaDataSuggestion.ts +++ b/typescript/src/models/MetaDataSuggestion.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { MetaDataDefinition } from './MetaDataDefinition'; import { MetaDataDefinitionFromJSON, MetaDataDefinitionFromJSONTyped, MetaDataDefinitionToJSON, + MetaDataDefinitionToJSONTyped, } from './MetaDataDefinition'; /** @@ -49,13 +50,11 @@ export interface MetaDataSuggestion { /** * Check if a given object implements the MetaDataSuggestion interface. */ -export function instanceOfMetaDataSuggestion(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "layerName" in value; - isInstance = isInstance && "mainFile" in value; - isInstance = isInstance && "metaData" in value; - - return isInstance; +export function instanceOfMetaDataSuggestion(value: object): value is MetaDataSuggestion { + if (!('layerName' in value) || value['layerName'] === undefined) return false; + if (!('mainFile' in value) || value['mainFile'] === undefined) return false; + if (!('metaData' in value) || value['metaData'] === undefined) return false; + return true; } export function MetaDataSuggestionFromJSON(json: any): MetaDataSuggestion { @@ -63,7 +62,7 @@ export function MetaDataSuggestionFromJSON(json: any): MetaDataSuggestion { } export function MetaDataSuggestionFromJSONTyped(json: any, ignoreDiscriminator: boolean): MetaDataSuggestion { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -74,18 +73,20 @@ export function MetaDataSuggestionFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function MetaDataSuggestionToJSON(value?: MetaDataSuggestion | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MetaDataSuggestionToJSON(json: any): MetaDataSuggestion { + return MetaDataSuggestionToJSONTyped(json, false); +} + +export function MetaDataSuggestionToJSONTyped(value?: MetaDataSuggestion | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'layerName': value.layerName, - 'mainFile': value.mainFile, - 'metaData': MetaDataDefinitionToJSON(value.metaData), + 'layerName': value['layerName'], + 'mainFile': value['mainFile'], + 'metaData': MetaDataDefinitionToJSON(value['metaData']), }; } diff --git a/typescript/src/models/MlModel.ts b/typescript/src/models/MlModel.ts index 36e5d4cb..b1309eb8 100644 --- a/typescript/src/models/MlModel.ts +++ b/typescript/src/models/MlModel.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { MlModelMetadata } from './MlModelMetadata'; import { MlModelMetadataFromJSON, MlModelMetadataFromJSONTyped, MlModelMetadataToJSON, + MlModelMetadataToJSONTyped, } from './MlModelMetadata'; /** @@ -61,15 +62,13 @@ export interface MlModel { /** * Check if a given object implements the MlModel interface. */ -export function instanceOfMlModel(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "metadata" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "upload" in value; - - return isInstance; +export function instanceOfMlModel(value: object): value is MlModel { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('metadata' in value) || value['metadata'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('upload' in value) || value['upload'] === undefined) return false; + return true; } export function MlModelFromJSON(json: any): MlModel { @@ -77,7 +76,7 @@ export function MlModelFromJSON(json: any): MlModel { } export function MlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModel { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -90,20 +89,22 @@ export function MlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): M }; } -export function MlModelToJSON(value?: MlModel | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MlModelToJSON(json: any): MlModel { + return MlModelToJSONTyped(json, false); +} + +export function MlModelToJSONTyped(value?: MlModel | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'displayName': value.displayName, - 'metadata': MlModelMetadataToJSON(value.metadata), - 'name': value.name, - 'upload': value.upload, + 'description': value['description'], + 'displayName': value['displayName'], + 'metadata': MlModelMetadataToJSON(value['metadata']), + 'name': value['name'], + 'upload': value['upload'], }; } diff --git a/typescript/src/models/MlModelMetadata.ts b/typescript/src/models/MlModelMetadata.ts index c0d2f9e8..b6185c64 100644 --- a/typescript/src/models/MlModelMetadata.ts +++ b/typescript/src/models/MlModelMetadata.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { RasterDataType } from './RasterDataType'; import { RasterDataTypeFromJSON, RasterDataTypeFromJSONTyped, RasterDataTypeToJSON, + RasterDataTypeToJSONTyped, } from './RasterDataType'; /** @@ -52,17 +53,17 @@ export interface MlModelMetadata { outputType: RasterDataType; } + + /** * Check if a given object implements the MlModelMetadata interface. */ -export function instanceOfMlModelMetadata(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "fileName" in value; - isInstance = isInstance && "inputType" in value; - isInstance = isInstance && "numInputBands" in value; - isInstance = isInstance && "outputType" in value; - - return isInstance; +export function instanceOfMlModelMetadata(value: object): value is MlModelMetadata { + if (!('fileName' in value) || value['fileName'] === undefined) return false; + if (!('inputType' in value) || value['inputType'] === undefined) return false; + if (!('numInputBands' in value) || value['numInputBands'] === undefined) return false; + if (!('outputType' in value) || value['outputType'] === undefined) return false; + return true; } export function MlModelMetadataFromJSON(json: any): MlModelMetadata { @@ -70,7 +71,7 @@ export function MlModelMetadataFromJSON(json: any): MlModelMetadata { } export function MlModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelMetadata { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -82,19 +83,21 @@ export function MlModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function MlModelMetadataToJSON(value?: MlModelMetadata | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MlModelMetadataToJSON(json: any): MlModelMetadata { + return MlModelMetadataToJSONTyped(json, false); +} + +export function MlModelMetadataToJSONTyped(value?: MlModelMetadata | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'fileName': value.fileName, - 'inputType': RasterDataTypeToJSON(value.inputType), - 'numInputBands': value.numInputBands, - 'outputType': RasterDataTypeToJSON(value.outputType), + 'fileName': value['fileName'], + 'inputType': RasterDataTypeToJSON(value['inputType']), + 'numInputBands': value['numInputBands'], + 'outputType': RasterDataTypeToJSON(value['outputType']), }; } diff --git a/typescript/src/models/MlModelNameResponse.ts b/typescript/src/models/MlModelNameResponse.ts index fa7016ed..3df434cc 100644 --- a/typescript/src/models/MlModelNameResponse.ts +++ b/typescript/src/models/MlModelNameResponse.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface MlModelNameResponse { /** * Check if a given object implements the MlModelNameResponse interface. */ -export function instanceOfMlModelNameResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "mlModelName" in value; - - return isInstance; +export function instanceOfMlModelNameResponse(value: object): value is MlModelNameResponse { + if (!('mlModelName' in value) || value['mlModelName'] === undefined) return false; + return true; } export function MlModelNameResponseFromJSON(json: any): MlModelNameResponse { @@ -42,7 +40,7 @@ export function MlModelNameResponseFromJSON(json: any): MlModelNameResponse { } export function MlModelNameResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelNameResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function MlModelNameResponseFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function MlModelNameResponseToJSON(value?: MlModelNameResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MlModelNameResponseToJSON(json: any): MlModelNameResponse { + return MlModelNameResponseToJSONTyped(json, false); +} + +export function MlModelNameResponseToJSONTyped(value?: MlModelNameResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'mlModelName': value.mlModelName, + 'mlModelName': value['mlModelName'], }; } diff --git a/typescript/src/models/MlModelResource.ts b/typescript/src/models/MlModelResource.ts index 05805981..13020cc6 100644 --- a/typescript/src/models/MlModelResource.ts +++ b/typescript/src/models/MlModelResource.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type MlModelResourceTypeEnum = typeof MlModelResourceTypeEnum[keyof typeo /** * Check if a given object implements the MlModelResource interface. */ -export function instanceOfMlModelResource(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfMlModelResource(value: object): value is MlModelResource { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function MlModelResourceFromJSON(json: any): MlModelResource { @@ -59,7 +57,7 @@ export function MlModelResourceFromJSON(json: any): MlModelResource { } export function MlModelResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelResource { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function MlModelResourceFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function MlModelResourceToJSON(value?: MlModelResource | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MlModelResourceToJSON(json: any): MlModelResource { + return MlModelResourceToJSONTyped(json, false); +} + +export function MlModelResourceToJSONTyped(value?: MlModelResource | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/src/models/MockDatasetDataSourceLoadingInfo.ts b/typescript/src/models/MockDatasetDataSourceLoadingInfo.ts index 179973ea..f7d603d3 100644 --- a/typescript/src/models/MockDatasetDataSourceLoadingInfo.ts +++ b/typescript/src/models/MockDatasetDataSourceLoadingInfo.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Coordinate2D } from './Coordinate2D'; import { Coordinate2DFromJSON, Coordinate2DFromJSONTyped, Coordinate2DToJSON, + Coordinate2DToJSONTyped, } from './Coordinate2D'; /** @@ -37,11 +38,9 @@ export interface MockDatasetDataSourceLoadingInfo { /** * Check if a given object implements the MockDatasetDataSourceLoadingInfo interface. */ -export function instanceOfMockDatasetDataSourceLoadingInfo(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "points" in value; - - return isInstance; +export function instanceOfMockDatasetDataSourceLoadingInfo(value: object): value is MockDatasetDataSourceLoadingInfo { + if (!('points' in value) || value['points'] === undefined) return false; + return true; } export function MockDatasetDataSourceLoadingInfoFromJSON(json: any): MockDatasetDataSourceLoadingInfo { @@ -49,7 +48,7 @@ export function MockDatasetDataSourceLoadingInfoFromJSON(json: any): MockDataset } export function MockDatasetDataSourceLoadingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): MockDatasetDataSourceLoadingInfo { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function MockDatasetDataSourceLoadingInfoFromJSONTyped(json: any, ignoreD }; } -export function MockDatasetDataSourceLoadingInfoToJSON(value?: MockDatasetDataSourceLoadingInfo | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MockDatasetDataSourceLoadingInfoToJSON(json: any): MockDatasetDataSourceLoadingInfo { + return MockDatasetDataSourceLoadingInfoToJSONTyped(json, false); +} + +export function MockDatasetDataSourceLoadingInfoToJSONTyped(value?: MockDatasetDataSourceLoadingInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'points': ((value.points as Array).map(Coordinate2DToJSON)), + 'points': ((value['points'] as Array).map(Coordinate2DToJSON)), }; } diff --git a/typescript/src/models/MockMetaData.ts b/typescript/src/models/MockMetaData.ts index 6c881f01..12dc72cf 100644 --- a/typescript/src/models/MockMetaData.ts +++ b/typescript/src/models/MockMetaData.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { MockDatasetDataSourceLoadingInfo } from './MockDatasetDataSourceLoadingInfo'; -import { - MockDatasetDataSourceLoadingInfoFromJSON, - MockDatasetDataSourceLoadingInfoFromJSONTyped, - MockDatasetDataSourceLoadingInfoToJSON, -} from './MockDatasetDataSourceLoadingInfo'; +import { mapValues } from '../runtime'; import type { VectorResultDescriptor } from './VectorResultDescriptor'; import { VectorResultDescriptorFromJSON, VectorResultDescriptorFromJSONTyped, VectorResultDescriptorToJSON, + VectorResultDescriptorToJSONTyped, } from './VectorResultDescriptor'; +import type { MockDatasetDataSourceLoadingInfo } from './MockDatasetDataSourceLoadingInfo'; +import { + MockDatasetDataSourceLoadingInfoFromJSON, + MockDatasetDataSourceLoadingInfoFromJSONTyped, + MockDatasetDataSourceLoadingInfoToJSON, + MockDatasetDataSourceLoadingInfoToJSONTyped, +} from './MockDatasetDataSourceLoadingInfo'; /** * @@ -57,12 +59,7 @@ export interface MockMetaData { * @export */ export const MockMetaDataTypeEnum = { - MockMetaData: 'MockMetaData', - OgrMetaData: 'OgrMetaData', - GdalMetaDataRegular: 'GdalMetaDataRegular', - GdalStatic: 'GdalStatic', - GdalMetadataNetCdfCf: 'GdalMetadataNetCdfCf', - GdalMetaDataList: 'GdalMetaDataList' + MockMetaData: 'MockMetaData' } as const; export type MockMetaDataTypeEnum = typeof MockMetaDataTypeEnum[keyof typeof MockMetaDataTypeEnum]; @@ -70,13 +67,11 @@ export type MockMetaDataTypeEnum = typeof MockMetaDataTypeEnum[keyof typeof Mock /** * Check if a given object implements the MockMetaData interface. */ -export function instanceOfMockMetaData(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "loadingInfo" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfMockMetaData(value: object): value is MockMetaData { + if (!('loadingInfo' in value) || value['loadingInfo'] === undefined) return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function MockMetaDataFromJSON(json: any): MockMetaData { @@ -84,7 +79,7 @@ export function MockMetaDataFromJSON(json: any): MockMetaData { } export function MockMetaDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): MockMetaData { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -95,18 +90,20 @@ export function MockMetaDataFromJSONTyped(json: any, ignoreDiscriminator: boolea }; } -export function MockMetaDataToJSON(value?: MockMetaData | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MockMetaDataToJSON(json: any): MockMetaData { + return MockMetaDataToJSONTyped(json, false); +} + +export function MockMetaDataToJSONTyped(value?: MockMetaData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'loadingInfo': MockDatasetDataSourceLoadingInfoToJSON(value.loadingInfo), - 'resultDescriptor': VectorResultDescriptorToJSON(value.resultDescriptor), - 'type': value.type, + 'loadingInfo': MockDatasetDataSourceLoadingInfoToJSON(value['loadingInfo']), + 'resultDescriptor': VectorResultDescriptorToJSON(value['resultDescriptor']), + 'type': value['type'], }; } diff --git a/typescript/src/models/MultiBandRasterColorizer.ts b/typescript/src/models/MultiBandRasterColorizer.ts index c4d0e9aa..35013af2 100644 --- a/typescript/src/models/MultiBandRasterColorizer.ts +++ b/typescript/src/models/MultiBandRasterColorizer.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -118,20 +118,18 @@ export type MultiBandRasterColorizerTypeEnum = typeof MultiBandRasterColorizerTy /** * Check if a given object implements the MultiBandRasterColorizer interface. */ -export function instanceOfMultiBandRasterColorizer(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "blueBand" in value; - isInstance = isInstance && "blueMax" in value; - isInstance = isInstance && "blueMin" in value; - isInstance = isInstance && "greenBand" in value; - isInstance = isInstance && "greenMax" in value; - isInstance = isInstance && "greenMin" in value; - isInstance = isInstance && "redBand" in value; - isInstance = isInstance && "redMax" in value; - isInstance = isInstance && "redMin" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfMultiBandRasterColorizer(value: object): value is MultiBandRasterColorizer { + if (!('blueBand' in value) || value['blueBand'] === undefined) return false; + if (!('blueMax' in value) || value['blueMax'] === undefined) return false; + if (!('blueMin' in value) || value['blueMin'] === undefined) return false; + if (!('greenBand' in value) || value['greenBand'] === undefined) return false; + if (!('greenMax' in value) || value['greenMax'] === undefined) return false; + if (!('greenMin' in value) || value['greenMin'] === undefined) return false; + if (!('redBand' in value) || value['redBand'] === undefined) return false; + if (!('redMax' in value) || value['redMax'] === undefined) return false; + if (!('redMin' in value) || value['redMin'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function MultiBandRasterColorizerFromJSON(json: any): MultiBandRasterColorizer { @@ -139,7 +137,7 @@ export function MultiBandRasterColorizerFromJSON(json: any): MultiBandRasterColo } export function MultiBandRasterColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiBandRasterColorizer { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -147,43 +145,45 @@ export function MultiBandRasterColorizerFromJSONTyped(json: any, ignoreDiscrimin 'blueBand': json['blueBand'], 'blueMax': json['blueMax'], 'blueMin': json['blueMin'], - 'blueScale': !exists(json, 'blueScale') ? undefined : json['blueScale'], + 'blueScale': json['blueScale'] == null ? undefined : json['blueScale'], 'greenBand': json['greenBand'], 'greenMax': json['greenMax'], 'greenMin': json['greenMin'], - 'greenScale': !exists(json, 'greenScale') ? undefined : json['greenScale'], - 'noDataColor': !exists(json, 'noDataColor') ? undefined : json['noDataColor'], + 'greenScale': json['greenScale'] == null ? undefined : json['greenScale'], + 'noDataColor': json['noDataColor'] == null ? undefined : json['noDataColor'], 'redBand': json['redBand'], 'redMax': json['redMax'], 'redMin': json['redMin'], - 'redScale': !exists(json, 'redScale') ? undefined : json['redScale'], + 'redScale': json['redScale'] == null ? undefined : json['redScale'], 'type': json['type'], }; } -export function MultiBandRasterColorizerToJSON(value?: MultiBandRasterColorizer | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MultiBandRasterColorizerToJSON(json: any): MultiBandRasterColorizer { + return MultiBandRasterColorizerToJSONTyped(json, false); +} + +export function MultiBandRasterColorizerToJSONTyped(value?: MultiBandRasterColorizer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'blueBand': value.blueBand, - 'blueMax': value.blueMax, - 'blueMin': value.blueMin, - 'blueScale': value.blueScale, - 'greenBand': value.greenBand, - 'greenMax': value.greenMax, - 'greenMin': value.greenMin, - 'greenScale': value.greenScale, - 'noDataColor': value.noDataColor, - 'redBand': value.redBand, - 'redMax': value.redMax, - 'redMin': value.redMin, - 'redScale': value.redScale, - 'type': value.type, + 'blueBand': value['blueBand'], + 'blueMax': value['blueMax'], + 'blueMin': value['blueMin'], + 'blueScale': value['blueScale'], + 'greenBand': value['greenBand'], + 'greenMax': value['greenMax'], + 'greenMin': value['greenMin'], + 'greenScale': value['greenScale'], + 'noDataColor': value['noDataColor'], + 'redBand': value['redBand'], + 'redMax': value['redMax'], + 'redMin': value['redMin'], + 'redScale': value['redScale'], + 'type': value['type'], }; } diff --git a/typescript/src/models/MultiLineString.ts b/typescript/src/models/MultiLineString.ts index dc64448d..4a470322 100644 --- a/typescript/src/models/MultiLineString.ts +++ b/typescript/src/models/MultiLineString.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Coordinate2D } from './Coordinate2D'; import { Coordinate2DFromJSON, Coordinate2DFromJSONTyped, Coordinate2DToJSON, + Coordinate2DToJSONTyped, } from './Coordinate2D'; /** @@ -37,11 +38,9 @@ export interface MultiLineString { /** * Check if a given object implements the MultiLineString interface. */ -export function instanceOfMultiLineString(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "coordinates" in value; - - return isInstance; +export function instanceOfMultiLineString(value: object): value is MultiLineString { + if (!('coordinates' in value) || value['coordinates'] === undefined) return false; + return true; } export function MultiLineStringFromJSON(json: any): MultiLineString { @@ -49,7 +48,7 @@ export function MultiLineStringFromJSON(json: any): MultiLineString { } export function MultiLineStringFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiLineString { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function MultiLineStringFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function MultiLineStringToJSON(value?: MultiLineString | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MultiLineStringToJSON(json: any): MultiLineString { + return MultiLineStringToJSONTyped(json, false); +} + +export function MultiLineStringToJSONTyped(value?: MultiLineString | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'coordinates': value.coordinates, + 'coordinates': value['coordinates'], }; } diff --git a/typescript/src/models/MultiPoint.ts b/typescript/src/models/MultiPoint.ts index 24221f3b..9c82816f 100644 --- a/typescript/src/models/MultiPoint.ts +++ b/typescript/src/models/MultiPoint.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Coordinate2D } from './Coordinate2D'; import { Coordinate2DFromJSON, Coordinate2DFromJSONTyped, Coordinate2DToJSON, + Coordinate2DToJSONTyped, } from './Coordinate2D'; /** @@ -37,11 +38,9 @@ export interface MultiPoint { /** * Check if a given object implements the MultiPoint interface. */ -export function instanceOfMultiPoint(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "coordinates" in value; - - return isInstance; +export function instanceOfMultiPoint(value: object): value is MultiPoint { + if (!('coordinates' in value) || value['coordinates'] === undefined) return false; + return true; } export function MultiPointFromJSON(json: any): MultiPoint { @@ -49,7 +48,7 @@ export function MultiPointFromJSON(json: any): MultiPoint { } export function MultiPointFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiPoint { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function MultiPointFromJSONTyped(json: any, ignoreDiscriminator: boolean) }; } -export function MultiPointToJSON(value?: MultiPoint | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MultiPointToJSON(json: any): MultiPoint { + return MultiPointToJSONTyped(json, false); +} + +export function MultiPointToJSONTyped(value?: MultiPoint | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'coordinates': ((value.coordinates as Array).map(Coordinate2DToJSON)), + 'coordinates': ((value['coordinates'] as Array).map(Coordinate2DToJSON)), }; } diff --git a/typescript/src/models/MultiPolygon.ts b/typescript/src/models/MultiPolygon.ts index ee4635b2..211bf923 100644 --- a/typescript/src/models/MultiPolygon.ts +++ b/typescript/src/models/MultiPolygon.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Coordinate2D } from './Coordinate2D'; import { Coordinate2DFromJSON, Coordinate2DFromJSONTyped, Coordinate2DToJSON, + Coordinate2DToJSONTyped, } from './Coordinate2D'; /** @@ -37,11 +38,9 @@ export interface MultiPolygon { /** * Check if a given object implements the MultiPolygon interface. */ -export function instanceOfMultiPolygon(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "polygons" in value; - - return isInstance; +export function instanceOfMultiPolygon(value: object): value is MultiPolygon { + if (!('polygons' in value) || value['polygons'] === undefined) return false; + return true; } export function MultiPolygonFromJSON(json: any): MultiPolygon { @@ -49,7 +48,7 @@ export function MultiPolygonFromJSON(json: any): MultiPolygon { } export function MultiPolygonFromJSONTyped(json: any, ignoreDiscriminator: boolean): MultiPolygon { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function MultiPolygonFromJSONTyped(json: any, ignoreDiscriminator: boolea }; } -export function MultiPolygonToJSON(value?: MultiPolygon | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function MultiPolygonToJSON(json: any): MultiPolygon { + return MultiPolygonToJSONTyped(json, false); +} + +export function MultiPolygonToJSONTyped(value?: MultiPolygon | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'polygons': value.polygons, + 'polygons': value['polygons'], }; } diff --git a/typescript/src/models/NumberParam.ts b/typescript/src/models/NumberParam.ts index 7605eb85..6d8aa8b5 100644 --- a/typescript/src/models/NumberParam.ts +++ b/typescript/src/models/NumberParam.ts @@ -12,15 +12,15 @@ * Do not edit the class manually. */ +import type { DerivedNumber } from './DerivedNumber'; import { - DerivedNumber, instanceOfDerivedNumber, DerivedNumberFromJSON, DerivedNumberFromJSONTyped, DerivedNumberToJSON, } from './DerivedNumber'; +import type { StaticNumberParam } from './StaticNumberParam'; import { - StaticNumberParam, instanceOfStaticNumberParam, StaticNumberParamFromJSON, StaticNumberParamFromJSONTyped, @@ -39,31 +39,32 @@ export function NumberParamFromJSON(json: any): NumberParam { } export function NumberParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): NumberParam { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'derived': - return {...DerivedNumberFromJSONTyped(json, true), type: 'derived'}; + return Object.assign({}, DerivedNumberFromJSONTyped(json, true), { type: 'derived' } as const); case 'static': - return {...StaticNumberParamFromJSONTyped(json, true), type: 'static'}; + return Object.assign({}, StaticNumberParamFromJSONTyped(json, true), { type: 'static' } as const); default: throw new Error(`No variant of NumberParam exists with 'type=${json['type']}'`); } } -export function NumberParamToJSON(value?: NumberParam | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function NumberParamToJSON(json: any): any { + return NumberParamToJSONTyped(json, false); +} + +export function NumberParamToJSONTyped(value?: NumberParam | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'derived': - return DerivedNumberToJSON(value); + return Object.assign({}, DerivedNumberToJSON(value), { type: 'derived' } as const); case 'static': - return StaticNumberParamToJSON(value); + return Object.assign({}, StaticNumberParamToJSON(value), { type: 'static' } as const); default: throw new Error(`No variant of NumberParam exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/OgrMetaData.ts b/typescript/src/models/OgrMetaData.ts index f4e87c06..b3707724 100644 --- a/typescript/src/models/OgrMetaData.ts +++ b/typescript/src/models/OgrMetaData.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { OgrSourceDataset } from './OgrSourceDataset'; -import { - OgrSourceDatasetFromJSON, - OgrSourceDatasetFromJSONTyped, - OgrSourceDatasetToJSON, -} from './OgrSourceDataset'; +import { mapValues } from '../runtime'; import type { VectorResultDescriptor } from './VectorResultDescriptor'; import { VectorResultDescriptorFromJSON, VectorResultDescriptorFromJSONTyped, VectorResultDescriptorToJSON, + VectorResultDescriptorToJSONTyped, } from './VectorResultDescriptor'; +import type { OgrSourceDataset } from './OgrSourceDataset'; +import { + OgrSourceDatasetFromJSON, + OgrSourceDatasetFromJSONTyped, + OgrSourceDatasetToJSON, + OgrSourceDatasetToJSONTyped, +} from './OgrSourceDataset'; /** * @@ -65,13 +67,11 @@ export type OgrMetaDataTypeEnum = typeof OgrMetaDataTypeEnum[keyof typeof OgrMet /** * Check if a given object implements the OgrMetaData interface. */ -export function instanceOfOgrMetaData(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "loadingInfo" in value; - isInstance = isInstance && "resultDescriptor" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfOgrMetaData(value: object): value is OgrMetaData { + if (!('loadingInfo' in value) || value['loadingInfo'] === undefined) return false; + if (!('resultDescriptor' in value) || value['resultDescriptor'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function OgrMetaDataFromJSON(json: any): OgrMetaData { @@ -79,7 +79,7 @@ export function OgrMetaDataFromJSON(json: any): OgrMetaData { } export function OgrMetaDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrMetaData { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -90,18 +90,20 @@ export function OgrMetaDataFromJSONTyped(json: any, ignoreDiscriminator: boolean }; } -export function OgrMetaDataToJSON(value?: OgrMetaData | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrMetaDataToJSON(json: any): OgrMetaData { + return OgrMetaDataToJSONTyped(json, false); +} + +export function OgrMetaDataToJSONTyped(value?: OgrMetaData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'loadingInfo': OgrSourceDatasetToJSON(value.loadingInfo), - 'resultDescriptor': VectorResultDescriptorToJSON(value.resultDescriptor), - 'type': value.type, + 'loadingInfo': OgrSourceDatasetToJSON(value['loadingInfo']), + 'resultDescriptor': VectorResultDescriptorToJSON(value['resultDescriptor']), + 'type': value['type'], }; } diff --git a/typescript/src/models/OgrSourceColumnSpec.ts b/typescript/src/models/OgrSourceColumnSpec.ts index eff0c21d..558966b8 100644 --- a/typescript/src/models/OgrSourceColumnSpec.ts +++ b/typescript/src/models/OgrSourceColumnSpec.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { FormatSpecifics } from './FormatSpecifics'; import { FormatSpecificsFromJSON, FormatSpecificsFromJSONTyped, FormatSpecificsToJSON, + FormatSpecificsToJSONTyped, } from './FormatSpecifics'; /** @@ -85,11 +86,9 @@ export interface OgrSourceColumnSpec { /** * Check if a given object implements the OgrSourceColumnSpec interface. */ -export function instanceOfOgrSourceColumnSpec(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "x" in value; - - return isInstance; +export function instanceOfOgrSourceColumnSpec(value: object): value is OgrSourceColumnSpec { + if (!('x' in value) || value['x'] === undefined) return false; + return true; } export function OgrSourceColumnSpecFromJSON(json: any): OgrSourceColumnSpec { @@ -97,41 +96,43 @@ export function OgrSourceColumnSpecFromJSON(json: any): OgrSourceColumnSpec { } export function OgrSourceColumnSpecFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceColumnSpec { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bool': !exists(json, 'bool') ? undefined : json['bool'], - 'datetime': !exists(json, 'datetime') ? undefined : json['datetime'], - '_float': !exists(json, 'float') ? undefined : json['float'], - 'formatSpecifics': !exists(json, 'formatSpecifics') ? undefined : FormatSpecificsFromJSON(json['formatSpecifics']), - '_int': !exists(json, 'int') ? undefined : json['int'], - 'rename': !exists(json, 'rename') ? undefined : json['rename'], - 'text': !exists(json, 'text') ? undefined : json['text'], + 'bool': json['bool'] == null ? undefined : json['bool'], + 'datetime': json['datetime'] == null ? undefined : json['datetime'], + '_float': json['float'] == null ? undefined : json['float'], + 'formatSpecifics': json['formatSpecifics'] == null ? undefined : FormatSpecificsFromJSON(json['formatSpecifics']), + '_int': json['int'] == null ? undefined : json['int'], + 'rename': json['rename'] == null ? undefined : json['rename'], + 'text': json['text'] == null ? undefined : json['text'], 'x': json['x'], - 'y': !exists(json, 'y') ? undefined : json['y'], + 'y': json['y'] == null ? undefined : json['y'], }; } -export function OgrSourceColumnSpecToJSON(value?: OgrSourceColumnSpec | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceColumnSpecToJSON(json: any): OgrSourceColumnSpec { + return OgrSourceColumnSpecToJSONTyped(json, false); +} + +export function OgrSourceColumnSpecToJSONTyped(value?: OgrSourceColumnSpec | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bool': value.bool, - 'datetime': value.datetime, - 'float': value._float, - 'formatSpecifics': FormatSpecificsToJSON(value.formatSpecifics), - 'int': value._int, - 'rename': value.rename, - 'text': value.text, - 'x': value.x, - 'y': value.y, + 'bool': value['bool'], + 'datetime': value['datetime'], + 'float': value['_float'], + 'formatSpecifics': FormatSpecificsToJSON(value['formatSpecifics']), + 'int': value['_int'], + 'rename': value['rename'], + 'text': value['text'], + 'x': value['x'], + 'y': value['y'], }; } diff --git a/typescript/src/models/OgrSourceDataset.ts b/typescript/src/models/OgrSourceDataset.ts index 4b28354e..fbcfb08d 100644 --- a/typescript/src/models/OgrSourceDataset.ts +++ b/typescript/src/models/OgrSourceDataset.ts @@ -12,37 +12,42 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { OgrSourceColumnSpec } from './OgrSourceColumnSpec'; -import { - OgrSourceColumnSpecFromJSON, - OgrSourceColumnSpecFromJSONTyped, - OgrSourceColumnSpecToJSON, -} from './OgrSourceColumnSpec'; -import type { OgrSourceDatasetTimeType } from './OgrSourceDatasetTimeType'; -import { - OgrSourceDatasetTimeTypeFromJSON, - OgrSourceDatasetTimeTypeFromJSONTyped, - OgrSourceDatasetTimeTypeToJSON, -} from './OgrSourceDatasetTimeType'; +import { mapValues } from '../runtime'; import type { OgrSourceErrorSpec } from './OgrSourceErrorSpec'; import { OgrSourceErrorSpecFromJSON, OgrSourceErrorSpecFromJSONTyped, OgrSourceErrorSpecToJSON, + OgrSourceErrorSpecToJSONTyped, } from './OgrSourceErrorSpec'; +import type { VectorDataType } from './VectorDataType'; +import { + VectorDataTypeFromJSON, + VectorDataTypeFromJSONTyped, + VectorDataTypeToJSON, + VectorDataTypeToJSONTyped, +} from './VectorDataType'; import type { TypedGeometry } from './TypedGeometry'; import { TypedGeometryFromJSON, TypedGeometryFromJSONTyped, TypedGeometryToJSON, + TypedGeometryToJSONTyped, } from './TypedGeometry'; -import type { VectorDataType } from './VectorDataType'; +import type { OgrSourceColumnSpec } from './OgrSourceColumnSpec'; import { - VectorDataTypeFromJSON, - VectorDataTypeFromJSONTyped, - VectorDataTypeToJSON, -} from './VectorDataType'; + OgrSourceColumnSpecFromJSON, + OgrSourceColumnSpecFromJSONTyped, + OgrSourceColumnSpecToJSON, + OgrSourceColumnSpecToJSONTyped, +} from './OgrSourceColumnSpec'; +import type { OgrSourceDatasetTimeType } from './OgrSourceDatasetTimeType'; +import { + OgrSourceDatasetTimeTypeFromJSON, + OgrSourceDatasetTimeTypeFromJSONTyped, + OgrSourceDatasetTimeTypeToJSON, + OgrSourceDatasetTimeTypeToJSONTyped, +} from './OgrSourceDatasetTimeType'; /** * @@ -124,16 +129,16 @@ export interface OgrSourceDataset { time?: OgrSourceDatasetTimeType; } + + /** * Check if a given object implements the OgrSourceDataset interface. */ -export function instanceOfOgrSourceDataset(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "fileName" in value; - isInstance = isInstance && "layerName" in value; - isInstance = isInstance && "onError" in value; - - return isInstance; +export function instanceOfOgrSourceDataset(value: object): value is OgrSourceDataset { + if (!('fileName' in value) || value['fileName'] === undefined) return false; + if (!('layerName' in value) || value['layerName'] === undefined) return false; + if (!('onError' in value) || value['onError'] === undefined) return false; + return true; } export function OgrSourceDatasetFromJSON(json: any): OgrSourceDataset { @@ -141,47 +146,49 @@ export function OgrSourceDatasetFromJSON(json: any): OgrSourceDataset { } export function OgrSourceDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDataset { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'attributeQuery': !exists(json, 'attributeQuery') ? undefined : json['attributeQuery'], - 'cacheTtl': !exists(json, 'cacheTtl') ? undefined : json['cacheTtl'], - 'columns': !exists(json, 'columns') ? undefined : OgrSourceColumnSpecFromJSON(json['columns']), - 'dataType': !exists(json, 'dataType') ? undefined : VectorDataTypeFromJSON(json['dataType']), - 'defaultGeometry': !exists(json, 'defaultGeometry') ? undefined : TypedGeometryFromJSON(json['defaultGeometry']), + 'attributeQuery': json['attributeQuery'] == null ? undefined : json['attributeQuery'], + 'cacheTtl': json['cacheTtl'] == null ? undefined : json['cacheTtl'], + 'columns': json['columns'] == null ? undefined : OgrSourceColumnSpecFromJSON(json['columns']), + 'dataType': json['dataType'] == null ? undefined : VectorDataTypeFromJSON(json['dataType']), + 'defaultGeometry': json['defaultGeometry'] == null ? undefined : TypedGeometryFromJSON(json['defaultGeometry']), 'fileName': json['fileName'], - 'forceOgrSpatialFilter': !exists(json, 'forceOgrSpatialFilter') ? undefined : json['forceOgrSpatialFilter'], - 'forceOgrTimeFilter': !exists(json, 'forceOgrTimeFilter') ? undefined : json['forceOgrTimeFilter'], + 'forceOgrSpatialFilter': json['forceOgrSpatialFilter'] == null ? undefined : json['forceOgrSpatialFilter'], + 'forceOgrTimeFilter': json['forceOgrTimeFilter'] == null ? undefined : json['forceOgrTimeFilter'], 'layerName': json['layerName'], 'onError': OgrSourceErrorSpecFromJSON(json['onError']), - 'sqlQuery': !exists(json, 'sqlQuery') ? undefined : json['sqlQuery'], - 'time': !exists(json, 'time') ? undefined : OgrSourceDatasetTimeTypeFromJSON(json['time']), + 'sqlQuery': json['sqlQuery'] == null ? undefined : json['sqlQuery'], + 'time': json['time'] == null ? undefined : OgrSourceDatasetTimeTypeFromJSON(json['time']), }; } -export function OgrSourceDatasetToJSON(value?: OgrSourceDataset | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetToJSON(json: any): OgrSourceDataset { + return OgrSourceDatasetToJSONTyped(json, false); +} + +export function OgrSourceDatasetToJSONTyped(value?: OgrSourceDataset | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'attributeQuery': value.attributeQuery, - 'cacheTtl': value.cacheTtl, - 'columns': OgrSourceColumnSpecToJSON(value.columns), - 'dataType': VectorDataTypeToJSON(value.dataType), - 'defaultGeometry': TypedGeometryToJSON(value.defaultGeometry), - 'fileName': value.fileName, - 'forceOgrSpatialFilter': value.forceOgrSpatialFilter, - 'forceOgrTimeFilter': value.forceOgrTimeFilter, - 'layerName': value.layerName, - 'onError': OgrSourceErrorSpecToJSON(value.onError), - 'sqlQuery': value.sqlQuery, - 'time': OgrSourceDatasetTimeTypeToJSON(value.time), + 'attributeQuery': value['attributeQuery'], + 'cacheTtl': value['cacheTtl'], + 'columns': OgrSourceColumnSpecToJSON(value['columns']), + 'dataType': VectorDataTypeToJSON(value['dataType']), + 'defaultGeometry': TypedGeometryToJSON(value['defaultGeometry']), + 'fileName': value['fileName'], + 'forceOgrSpatialFilter': value['forceOgrSpatialFilter'], + 'forceOgrTimeFilter': value['forceOgrTimeFilter'], + 'layerName': value['layerName'], + 'onError': OgrSourceErrorSpecToJSON(value['onError']), + 'sqlQuery': value['sqlQuery'], + 'time': OgrSourceDatasetTimeTypeToJSON(value['time']), }; } diff --git a/typescript/src/models/OgrSourceDatasetTimeType.ts b/typescript/src/models/OgrSourceDatasetTimeType.ts index 3763ba97..478b4d44 100644 --- a/typescript/src/models/OgrSourceDatasetTimeType.ts +++ b/typescript/src/models/OgrSourceDatasetTimeType.ts @@ -12,29 +12,29 @@ * Do not edit the class manually. */ +import type { OgrSourceDatasetTimeTypeNone } from './OgrSourceDatasetTimeTypeNone'; import { - OgrSourceDatasetTimeTypeNone, instanceOfOgrSourceDatasetTimeTypeNone, OgrSourceDatasetTimeTypeNoneFromJSON, OgrSourceDatasetTimeTypeNoneFromJSONTyped, OgrSourceDatasetTimeTypeNoneToJSON, } from './OgrSourceDatasetTimeTypeNone'; +import type { OgrSourceDatasetTimeTypeStart } from './OgrSourceDatasetTimeTypeStart'; import { - OgrSourceDatasetTimeTypeStart, instanceOfOgrSourceDatasetTimeTypeStart, OgrSourceDatasetTimeTypeStartFromJSON, OgrSourceDatasetTimeTypeStartFromJSONTyped, OgrSourceDatasetTimeTypeStartToJSON, } from './OgrSourceDatasetTimeTypeStart'; +import type { OgrSourceDatasetTimeTypeStartDuration } from './OgrSourceDatasetTimeTypeStartDuration'; import { - OgrSourceDatasetTimeTypeStartDuration, instanceOfOgrSourceDatasetTimeTypeStartDuration, OgrSourceDatasetTimeTypeStartDurationFromJSON, OgrSourceDatasetTimeTypeStartDurationFromJSONTyped, OgrSourceDatasetTimeTypeStartDurationToJSON, } from './OgrSourceDatasetTimeTypeStartDuration'; +import type { OgrSourceDatasetTimeTypeStartEnd } from './OgrSourceDatasetTimeTypeStartEnd'; import { - OgrSourceDatasetTimeTypeStartEnd, instanceOfOgrSourceDatasetTimeTypeStartEnd, OgrSourceDatasetTimeTypeStartEndFromJSON, OgrSourceDatasetTimeTypeStartEndFromJSONTyped, @@ -53,39 +53,40 @@ export function OgrSourceDatasetTimeTypeFromJSON(json: any): OgrSourceDatasetTim } export function OgrSourceDatasetTimeTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeType { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'none': - return {...OgrSourceDatasetTimeTypeNoneFromJSONTyped(json, true), type: 'none'}; + return Object.assign({}, OgrSourceDatasetTimeTypeNoneFromJSONTyped(json, true), { type: 'none' } as const); case 'start': - return {...OgrSourceDatasetTimeTypeStartFromJSONTyped(json, true), type: 'start'}; + return Object.assign({}, OgrSourceDatasetTimeTypeStartFromJSONTyped(json, true), { type: 'start' } as const); case 'start+duration': - return {...OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json, true), type: 'start+duration'}; + return Object.assign({}, OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json, true), { type: 'start+duration' } as const); case 'start+end': - return {...OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json, true), type: 'start+end'}; + return Object.assign({}, OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json, true), { type: 'start+end' } as const); default: throw new Error(`No variant of OgrSourceDatasetTimeType exists with 'type=${json['type']}'`); } } -export function OgrSourceDatasetTimeTypeToJSON(value?: OgrSourceDatasetTimeType | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetTimeTypeToJSON(json: any): any { + return OgrSourceDatasetTimeTypeToJSONTyped(json, false); +} + +export function OgrSourceDatasetTimeTypeToJSONTyped(value?: OgrSourceDatasetTimeType | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'none': - return OgrSourceDatasetTimeTypeNoneToJSON(value); + return Object.assign({}, OgrSourceDatasetTimeTypeNoneToJSON(value), { type: 'none' } as const); case 'start': - return OgrSourceDatasetTimeTypeStartToJSON(value); + return Object.assign({}, OgrSourceDatasetTimeTypeStartToJSON(value), { type: 'start' } as const); case 'start+duration': - return OgrSourceDatasetTimeTypeStartDurationToJSON(value); + return Object.assign({}, OgrSourceDatasetTimeTypeStartDurationToJSON(value), { type: 'start+duration' } as const); case 'start+end': - return OgrSourceDatasetTimeTypeStartEndToJSON(value); + return Object.assign({}, OgrSourceDatasetTimeTypeStartEndToJSON(value), { type: 'start+end' } as const); default: throw new Error(`No variant of OgrSourceDatasetTimeType exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/OgrSourceDatasetTimeTypeNone.ts b/typescript/src/models/OgrSourceDatasetTimeTypeNone.ts index 6950cd06..ff6b6c4a 100644 --- a/typescript/src/models/OgrSourceDatasetTimeTypeNone.ts +++ b/typescript/src/models/OgrSourceDatasetTimeTypeNone.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -32,10 +32,7 @@ export interface OgrSourceDatasetTimeTypeNone { * @export */ export const OgrSourceDatasetTimeTypeNoneTypeEnum = { - None: 'none', - Start: 'start', - Startend: 'start+end', - Startduration: 'start+duration' + None: 'none' } as const; export type OgrSourceDatasetTimeTypeNoneTypeEnum = typeof OgrSourceDatasetTimeTypeNoneTypeEnum[keyof typeof OgrSourceDatasetTimeTypeNoneTypeEnum]; @@ -43,11 +40,9 @@ export type OgrSourceDatasetTimeTypeNoneTypeEnum = typeof OgrSourceDatasetTimeTy /** * Check if a given object implements the OgrSourceDatasetTimeTypeNone interface. */ -export function instanceOfOgrSourceDatasetTimeTypeNone(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfOgrSourceDatasetTimeTypeNone(value: object): value is OgrSourceDatasetTimeTypeNone { + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function OgrSourceDatasetTimeTypeNoneFromJSON(json: any): OgrSourceDatasetTimeTypeNone { @@ -55,7 +50,7 @@ export function OgrSourceDatasetTimeTypeNoneFromJSON(json: any): OgrSourceDatase } export function OgrSourceDatasetTimeTypeNoneFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeNone { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -64,16 +59,18 @@ export function OgrSourceDatasetTimeTypeNoneFromJSONTyped(json: any, ignoreDiscr }; } -export function OgrSourceDatasetTimeTypeNoneToJSON(value?: OgrSourceDatasetTimeTypeNone | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetTimeTypeNoneToJSON(json: any): OgrSourceDatasetTimeTypeNone { + return OgrSourceDatasetTimeTypeNoneToJSONTyped(json, false); +} + +export function OgrSourceDatasetTimeTypeNoneToJSONTyped(value?: OgrSourceDatasetTimeTypeNone | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'type': value.type, + 'type': value['type'], }; } diff --git a/typescript/src/models/OgrSourceDatasetTimeTypeStart.ts b/typescript/src/models/OgrSourceDatasetTimeTypeStart.ts index e0cb022d..0893a8b3 100644 --- a/typescript/src/models/OgrSourceDatasetTimeTypeStart.ts +++ b/typescript/src/models/OgrSourceDatasetTimeTypeStart.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { OgrSourceDurationSpec } from './OgrSourceDurationSpec'; -import { - OgrSourceDurationSpecFromJSON, - OgrSourceDurationSpecFromJSONTyped, - OgrSourceDurationSpecToJSON, -} from './OgrSourceDurationSpec'; +import { mapValues } from '../runtime'; import type { OgrSourceTimeFormat } from './OgrSourceTimeFormat'; import { OgrSourceTimeFormatFromJSON, OgrSourceTimeFormatFromJSONTyped, OgrSourceTimeFormatToJSON, + OgrSourceTimeFormatToJSONTyped, } from './OgrSourceTimeFormat'; +import type { OgrSourceDurationSpec } from './OgrSourceDurationSpec'; +import { + OgrSourceDurationSpecFromJSON, + OgrSourceDurationSpecFromJSONTyped, + OgrSourceDurationSpecToJSON, + OgrSourceDurationSpecToJSONTyped, +} from './OgrSourceDurationSpec'; /** * @@ -71,14 +73,12 @@ export type OgrSourceDatasetTimeTypeStartTypeEnum = typeof OgrSourceDatasetTimeT /** * Check if a given object implements the OgrSourceDatasetTimeTypeStart interface. */ -export function instanceOfOgrSourceDatasetTimeTypeStart(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "duration" in value; - isInstance = isInstance && "startField" in value; - isInstance = isInstance && "startFormat" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfOgrSourceDatasetTimeTypeStart(value: object): value is OgrSourceDatasetTimeTypeStart { + if (!('duration' in value) || value['duration'] === undefined) return false; + if (!('startField' in value) || value['startField'] === undefined) return false; + if (!('startFormat' in value) || value['startFormat'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function OgrSourceDatasetTimeTypeStartFromJSON(json: any): OgrSourceDatasetTimeTypeStart { @@ -86,7 +86,7 @@ export function OgrSourceDatasetTimeTypeStartFromJSON(json: any): OgrSourceDatas } export function OgrSourceDatasetTimeTypeStartFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeStart { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -98,19 +98,21 @@ export function OgrSourceDatasetTimeTypeStartFromJSONTyped(json: any, ignoreDisc }; } -export function OgrSourceDatasetTimeTypeStartToJSON(value?: OgrSourceDatasetTimeTypeStart | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetTimeTypeStartToJSON(json: any): OgrSourceDatasetTimeTypeStart { + return OgrSourceDatasetTimeTypeStartToJSONTyped(json, false); +} + +export function OgrSourceDatasetTimeTypeStartToJSONTyped(value?: OgrSourceDatasetTimeTypeStart | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'duration': OgrSourceDurationSpecToJSON(value.duration), - 'startField': value.startField, - 'startFormat': OgrSourceTimeFormatToJSON(value.startFormat), - 'type': value.type, + 'duration': OgrSourceDurationSpecToJSON(value['duration']), + 'startField': value['startField'], + 'startFormat': OgrSourceTimeFormatToJSON(value['startFormat']), + 'type': value['type'], }; } diff --git a/typescript/src/models/OgrSourceDatasetTimeTypeStartDuration.ts b/typescript/src/models/OgrSourceDatasetTimeTypeStartDuration.ts index 06b18e1d..3eaf4411 100644 --- a/typescript/src/models/OgrSourceDatasetTimeTypeStartDuration.ts +++ b/typescript/src/models/OgrSourceDatasetTimeTypeStartDuration.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { OgrSourceTimeFormat } from './OgrSourceTimeFormat'; import { OgrSourceTimeFormatFromJSON, OgrSourceTimeFormatFromJSONTyped, OgrSourceTimeFormatToJSON, + OgrSourceTimeFormatToJSONTyped, } from './OgrSourceTimeFormat'; /** @@ -65,14 +66,12 @@ export type OgrSourceDatasetTimeTypeStartDurationTypeEnum = typeof OgrSourceData /** * Check if a given object implements the OgrSourceDatasetTimeTypeStartDuration interface. */ -export function instanceOfOgrSourceDatasetTimeTypeStartDuration(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "durationField" in value; - isInstance = isInstance && "startField" in value; - isInstance = isInstance && "startFormat" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfOgrSourceDatasetTimeTypeStartDuration(value: object): value is OgrSourceDatasetTimeTypeStartDuration { + if (!('durationField' in value) || value['durationField'] === undefined) return false; + if (!('startField' in value) || value['startField'] === undefined) return false; + if (!('startFormat' in value) || value['startFormat'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function OgrSourceDatasetTimeTypeStartDurationFromJSON(json: any): OgrSourceDatasetTimeTypeStartDuration { @@ -80,7 +79,7 @@ export function OgrSourceDatasetTimeTypeStartDurationFromJSON(json: any): OgrSou } export function OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeStartDuration { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -92,19 +91,21 @@ export function OgrSourceDatasetTimeTypeStartDurationFromJSONTyped(json: any, ig }; } -export function OgrSourceDatasetTimeTypeStartDurationToJSON(value?: OgrSourceDatasetTimeTypeStartDuration | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetTimeTypeStartDurationToJSON(json: any): OgrSourceDatasetTimeTypeStartDuration { + return OgrSourceDatasetTimeTypeStartDurationToJSONTyped(json, false); +} + +export function OgrSourceDatasetTimeTypeStartDurationToJSONTyped(value?: OgrSourceDatasetTimeTypeStartDuration | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'durationField': value.durationField, - 'startField': value.startField, - 'startFormat': OgrSourceTimeFormatToJSON(value.startFormat), - 'type': value.type, + 'durationField': value['durationField'], + 'startField': value['startField'], + 'startFormat': OgrSourceTimeFormatToJSON(value['startFormat']), + 'type': value['type'], }; } diff --git a/typescript/src/models/OgrSourceDatasetTimeTypeStartEnd.ts b/typescript/src/models/OgrSourceDatasetTimeTypeStartEnd.ts index b0226de2..b6e419b8 100644 --- a/typescript/src/models/OgrSourceDatasetTimeTypeStartEnd.ts +++ b/typescript/src/models/OgrSourceDatasetTimeTypeStartEnd.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { OgrSourceTimeFormat } from './OgrSourceTimeFormat'; import { OgrSourceTimeFormatFromJSON, OgrSourceTimeFormatFromJSONTyped, OgrSourceTimeFormatToJSON, + OgrSourceTimeFormatToJSONTyped, } from './OgrSourceTimeFormat'; /** @@ -71,15 +72,13 @@ export type OgrSourceDatasetTimeTypeStartEndTypeEnum = typeof OgrSourceDatasetTi /** * Check if a given object implements the OgrSourceDatasetTimeTypeStartEnd interface. */ -export function instanceOfOgrSourceDatasetTimeTypeStartEnd(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "endField" in value; - isInstance = isInstance && "endFormat" in value; - isInstance = isInstance && "startField" in value; - isInstance = isInstance && "startFormat" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfOgrSourceDatasetTimeTypeStartEnd(value: object): value is OgrSourceDatasetTimeTypeStartEnd { + if (!('endField' in value) || value['endField'] === undefined) return false; + if (!('endFormat' in value) || value['endFormat'] === undefined) return false; + if (!('startField' in value) || value['startField'] === undefined) return false; + if (!('startFormat' in value) || value['startFormat'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function OgrSourceDatasetTimeTypeStartEndFromJSON(json: any): OgrSourceDatasetTimeTypeStartEnd { @@ -87,7 +86,7 @@ export function OgrSourceDatasetTimeTypeStartEndFromJSON(json: any): OgrSourceDa } export function OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDatasetTimeTypeStartEnd { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -100,20 +99,22 @@ export function OgrSourceDatasetTimeTypeStartEndFromJSONTyped(json: any, ignoreD }; } -export function OgrSourceDatasetTimeTypeStartEndToJSON(value?: OgrSourceDatasetTimeTypeStartEnd | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDatasetTimeTypeStartEndToJSON(json: any): OgrSourceDatasetTimeTypeStartEnd { + return OgrSourceDatasetTimeTypeStartEndToJSONTyped(json, false); +} + +export function OgrSourceDatasetTimeTypeStartEndToJSONTyped(value?: OgrSourceDatasetTimeTypeStartEnd | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'endField': value.endField, - 'endFormat': OgrSourceTimeFormatToJSON(value.endFormat), - 'startField': value.startField, - 'startFormat': OgrSourceTimeFormatToJSON(value.startFormat), - 'type': value.type, + 'endField': value['endField'], + 'endFormat': OgrSourceTimeFormatToJSON(value['endFormat']), + 'startField': value['startField'], + 'startFormat': OgrSourceTimeFormatToJSON(value['startFormat']), + 'type': value['type'], }; } diff --git a/typescript/src/models/OgrSourceDurationSpec.ts b/typescript/src/models/OgrSourceDurationSpec.ts index f607836a..a7e739e4 100644 --- a/typescript/src/models/OgrSourceDurationSpec.ts +++ b/typescript/src/models/OgrSourceDurationSpec.ts @@ -12,22 +12,22 @@ * Do not edit the class manually. */ +import type { OgrSourceDurationSpecInfinite } from './OgrSourceDurationSpecInfinite'; import { - OgrSourceDurationSpecInfinite, instanceOfOgrSourceDurationSpecInfinite, OgrSourceDurationSpecInfiniteFromJSON, OgrSourceDurationSpecInfiniteFromJSONTyped, OgrSourceDurationSpecInfiniteToJSON, } from './OgrSourceDurationSpecInfinite'; +import type { OgrSourceDurationSpecValue } from './OgrSourceDurationSpecValue'; import { - OgrSourceDurationSpecValue, instanceOfOgrSourceDurationSpecValue, OgrSourceDurationSpecValueFromJSON, OgrSourceDurationSpecValueFromJSONTyped, OgrSourceDurationSpecValueToJSON, } from './OgrSourceDurationSpecValue'; +import type { OgrSourceDurationSpecZero } from './OgrSourceDurationSpecZero'; import { - OgrSourceDurationSpecZero, instanceOfOgrSourceDurationSpecZero, OgrSourceDurationSpecZeroFromJSON, OgrSourceDurationSpecZeroFromJSONTyped, @@ -46,35 +46,36 @@ export function OgrSourceDurationSpecFromJSON(json: any): OgrSourceDurationSpec } export function OgrSourceDurationSpecFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpec { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'infinite': - return {...OgrSourceDurationSpecInfiniteFromJSONTyped(json, true), type: 'infinite'}; + return Object.assign({}, OgrSourceDurationSpecInfiniteFromJSONTyped(json, true), { type: 'infinite' } as const); case 'value': - return {...OgrSourceDurationSpecValueFromJSONTyped(json, true), type: 'value'}; + return Object.assign({}, OgrSourceDurationSpecValueFromJSONTyped(json, true), { type: 'value' } as const); case 'zero': - return {...OgrSourceDurationSpecZeroFromJSONTyped(json, true), type: 'zero'}; + return Object.assign({}, OgrSourceDurationSpecZeroFromJSONTyped(json, true), { type: 'zero' } as const); default: throw new Error(`No variant of OgrSourceDurationSpec exists with 'type=${json['type']}'`); } } -export function OgrSourceDurationSpecToJSON(value?: OgrSourceDurationSpec | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDurationSpecToJSON(json: any): any { + return OgrSourceDurationSpecToJSONTyped(json, false); +} + +export function OgrSourceDurationSpecToJSONTyped(value?: OgrSourceDurationSpec | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'infinite': - return OgrSourceDurationSpecInfiniteToJSON(value); + return Object.assign({}, OgrSourceDurationSpecInfiniteToJSON(value), { type: 'infinite' } as const); case 'value': - return OgrSourceDurationSpecValueToJSON(value); + return Object.assign({}, OgrSourceDurationSpecValueToJSON(value), { type: 'value' } as const); case 'zero': - return OgrSourceDurationSpecZeroToJSON(value); + return Object.assign({}, OgrSourceDurationSpecZeroToJSON(value), { type: 'zero' } as const); default: throw new Error(`No variant of OgrSourceDurationSpec exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/OgrSourceDurationSpecInfinite.ts b/typescript/src/models/OgrSourceDurationSpecInfinite.ts index 9eaebbf5..9164fce5 100644 --- a/typescript/src/models/OgrSourceDurationSpecInfinite.ts +++ b/typescript/src/models/OgrSourceDurationSpecInfinite.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -32,9 +32,7 @@ export interface OgrSourceDurationSpecInfinite { * @export */ export const OgrSourceDurationSpecInfiniteTypeEnum = { - Infinite: 'infinite', - Zero: 'zero', - Value: 'value' + Infinite: 'infinite' } as const; export type OgrSourceDurationSpecInfiniteTypeEnum = typeof OgrSourceDurationSpecInfiniteTypeEnum[keyof typeof OgrSourceDurationSpecInfiniteTypeEnum]; @@ -42,11 +40,9 @@ export type OgrSourceDurationSpecInfiniteTypeEnum = typeof OgrSourceDurationSpec /** * Check if a given object implements the OgrSourceDurationSpecInfinite interface. */ -export function instanceOfOgrSourceDurationSpecInfinite(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfOgrSourceDurationSpecInfinite(value: object): value is OgrSourceDurationSpecInfinite { + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function OgrSourceDurationSpecInfiniteFromJSON(json: any): OgrSourceDurationSpecInfinite { @@ -54,7 +50,7 @@ export function OgrSourceDurationSpecInfiniteFromJSON(json: any): OgrSourceDurat } export function OgrSourceDurationSpecInfiniteFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpecInfinite { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -63,16 +59,18 @@ export function OgrSourceDurationSpecInfiniteFromJSONTyped(json: any, ignoreDisc }; } -export function OgrSourceDurationSpecInfiniteToJSON(value?: OgrSourceDurationSpecInfinite | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDurationSpecInfiniteToJSON(json: any): OgrSourceDurationSpecInfinite { + return OgrSourceDurationSpecInfiniteToJSONTyped(json, false); +} + +export function OgrSourceDurationSpecInfiniteToJSONTyped(value?: OgrSourceDurationSpecInfinite | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'type': value.type, + 'type': value['type'], }; } diff --git a/typescript/src/models/OgrSourceDurationSpecValue.ts b/typescript/src/models/OgrSourceDurationSpecValue.ts index 65fb2d84..2e621192 100644 --- a/typescript/src/models/OgrSourceDurationSpecValue.ts +++ b/typescript/src/models/OgrSourceDurationSpecValue.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TimeGranularity } from './TimeGranularity'; import { TimeGranularityFromJSON, TimeGranularityFromJSONTyped, TimeGranularityToJSON, + TimeGranularityToJSONTyped, } from './TimeGranularity'; /** @@ -59,13 +60,11 @@ export type OgrSourceDurationSpecValueTypeEnum = typeof OgrSourceDurationSpecVal /** * Check if a given object implements the OgrSourceDurationSpecValue interface. */ -export function instanceOfOgrSourceDurationSpecValue(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "granularity" in value; - isInstance = isInstance && "step" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfOgrSourceDurationSpecValue(value: object): value is OgrSourceDurationSpecValue { + if (!('granularity' in value) || value['granularity'] === undefined) return false; + if (!('step' in value) || value['step'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function OgrSourceDurationSpecValueFromJSON(json: any): OgrSourceDurationSpecValue { @@ -73,7 +72,7 @@ export function OgrSourceDurationSpecValueFromJSON(json: any): OgrSourceDuration } export function OgrSourceDurationSpecValueFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpecValue { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -84,18 +83,20 @@ export function OgrSourceDurationSpecValueFromJSONTyped(json: any, ignoreDiscrim }; } -export function OgrSourceDurationSpecValueToJSON(value?: OgrSourceDurationSpecValue | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDurationSpecValueToJSON(json: any): OgrSourceDurationSpecValue { + return OgrSourceDurationSpecValueToJSONTyped(json, false); +} + +export function OgrSourceDurationSpecValueToJSONTyped(value?: OgrSourceDurationSpecValue | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'granularity': TimeGranularityToJSON(value.granularity), - 'step': value.step, - 'type': value.type, + 'granularity': TimeGranularityToJSON(value['granularity']), + 'step': value['step'], + 'type': value['type'], }; } diff --git a/typescript/src/models/OgrSourceDurationSpecZero.ts b/typescript/src/models/OgrSourceDurationSpecZero.ts index fb15487c..f6147217 100644 --- a/typescript/src/models/OgrSourceDurationSpecZero.ts +++ b/typescript/src/models/OgrSourceDurationSpecZero.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -40,11 +40,9 @@ export type OgrSourceDurationSpecZeroTypeEnum = typeof OgrSourceDurationSpecZero /** * Check if a given object implements the OgrSourceDurationSpecZero interface. */ -export function instanceOfOgrSourceDurationSpecZero(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfOgrSourceDurationSpecZero(value: object): value is OgrSourceDurationSpecZero { + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function OgrSourceDurationSpecZeroFromJSON(json: any): OgrSourceDurationSpecZero { @@ -52,7 +50,7 @@ export function OgrSourceDurationSpecZeroFromJSON(json: any): OgrSourceDurationS } export function OgrSourceDurationSpecZeroFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceDurationSpecZero { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -61,16 +59,18 @@ export function OgrSourceDurationSpecZeroFromJSONTyped(json: any, ignoreDiscrimi }; } -export function OgrSourceDurationSpecZeroToJSON(value?: OgrSourceDurationSpecZero | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceDurationSpecZeroToJSON(json: any): OgrSourceDurationSpecZero { + return OgrSourceDurationSpecZeroToJSONTyped(json, false); +} + +export function OgrSourceDurationSpecZeroToJSONTyped(value?: OgrSourceDurationSpecZero | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'type': value.type, + 'type': value['type'], }; } diff --git a/typescript/src/models/OgrSourceErrorSpec.ts b/typescript/src/models/OgrSourceErrorSpec.ts index e8d52b4d..6121ebae 100644 --- a/typescript/src/models/OgrSourceErrorSpec.ts +++ b/typescript/src/models/OgrSourceErrorSpec.ts @@ -24,6 +24,17 @@ export const OgrSourceErrorSpec = { export type OgrSourceErrorSpec = typeof OgrSourceErrorSpec[keyof typeof OgrSourceErrorSpec]; +export function instanceOfOgrSourceErrorSpec(value: any): boolean { + for (const key in OgrSourceErrorSpec) { + if (Object.prototype.hasOwnProperty.call(OgrSourceErrorSpec, key)) { + if (OgrSourceErrorSpec[key as keyof typeof OgrSourceErrorSpec] === value) { + return true; + } + } + } + return false; +} + export function OgrSourceErrorSpecFromJSON(json: any): OgrSourceErrorSpec { return OgrSourceErrorSpecFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function OgrSourceErrorSpecToJSON(value?: OgrSourceErrorSpec | null): any return value as any; } +export function OgrSourceErrorSpecToJSONTyped(value: any, ignoreDiscriminator: boolean): OgrSourceErrorSpec { + return value as OgrSourceErrorSpec; +} + diff --git a/typescript/src/models/OgrSourceTimeFormat.ts b/typescript/src/models/OgrSourceTimeFormat.ts index e103fe63..f65d8a62 100644 --- a/typescript/src/models/OgrSourceTimeFormat.ts +++ b/typescript/src/models/OgrSourceTimeFormat.ts @@ -12,22 +12,22 @@ * Do not edit the class manually. */ +import type { OgrSourceTimeFormatAuto } from './OgrSourceTimeFormatAuto'; import { - OgrSourceTimeFormatAuto, instanceOfOgrSourceTimeFormatAuto, OgrSourceTimeFormatAutoFromJSON, OgrSourceTimeFormatAutoFromJSONTyped, OgrSourceTimeFormatAutoToJSON, } from './OgrSourceTimeFormatAuto'; +import type { OgrSourceTimeFormatCustom } from './OgrSourceTimeFormatCustom'; import { - OgrSourceTimeFormatCustom, instanceOfOgrSourceTimeFormatCustom, OgrSourceTimeFormatCustomFromJSON, OgrSourceTimeFormatCustomFromJSONTyped, OgrSourceTimeFormatCustomToJSON, } from './OgrSourceTimeFormatCustom'; +import type { OgrSourceTimeFormatUnixTimeStamp } from './OgrSourceTimeFormatUnixTimeStamp'; import { - OgrSourceTimeFormatUnixTimeStamp, instanceOfOgrSourceTimeFormatUnixTimeStamp, OgrSourceTimeFormatUnixTimeStampFromJSON, OgrSourceTimeFormatUnixTimeStampFromJSONTyped, @@ -46,35 +46,36 @@ export function OgrSourceTimeFormatFromJSON(json: any): OgrSourceTimeFormat { } export function OgrSourceTimeFormatFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormat { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['format']) { case 'auto': - return {...OgrSourceTimeFormatAutoFromJSONTyped(json, true), format: 'auto'}; + return Object.assign({}, OgrSourceTimeFormatAutoFromJSONTyped(json, true), { format: 'auto' } as const); case 'custom': - return {...OgrSourceTimeFormatCustomFromJSONTyped(json, true), format: 'custom'}; + return Object.assign({}, OgrSourceTimeFormatCustomFromJSONTyped(json, true), { format: 'custom' } as const); case 'unixTimeStamp': - return {...OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json, true), format: 'unixTimeStamp'}; + return Object.assign({}, OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json, true), { format: 'unixTimeStamp' } as const); default: throw new Error(`No variant of OgrSourceTimeFormat exists with 'format=${json['format']}'`); } } -export function OgrSourceTimeFormatToJSON(value?: OgrSourceTimeFormat | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceTimeFormatToJSON(json: any): any { + return OgrSourceTimeFormatToJSONTyped(json, false); +} + +export function OgrSourceTimeFormatToJSONTyped(value?: OgrSourceTimeFormat | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['format']) { case 'auto': - return OgrSourceTimeFormatAutoToJSON(value); + return Object.assign({}, OgrSourceTimeFormatAutoToJSON(value), { format: 'auto' } as const); case 'custom': - return OgrSourceTimeFormatCustomToJSON(value); + return Object.assign({}, OgrSourceTimeFormatCustomToJSON(value), { format: 'custom' } as const); case 'unixTimeStamp': - return OgrSourceTimeFormatUnixTimeStampToJSON(value); + return Object.assign({}, OgrSourceTimeFormatUnixTimeStampToJSON(value), { format: 'unixTimeStamp' } as const); default: throw new Error(`No variant of OgrSourceTimeFormat exists with 'format=${value['format']}'`); } diff --git a/typescript/src/models/OgrSourceTimeFormatAuto.ts b/typescript/src/models/OgrSourceTimeFormatAuto.ts index 4e18dec8..e8df6dec 100644 --- a/typescript/src/models/OgrSourceTimeFormatAuto.ts +++ b/typescript/src/models/OgrSourceTimeFormatAuto.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -40,11 +40,9 @@ export type OgrSourceTimeFormatAutoFormatEnum = typeof OgrSourceTimeFormatAutoFo /** * Check if a given object implements the OgrSourceTimeFormatAuto interface. */ -export function instanceOfOgrSourceTimeFormatAuto(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "format" in value; - - return isInstance; +export function instanceOfOgrSourceTimeFormatAuto(value: object): value is OgrSourceTimeFormatAuto { + if (!('format' in value) || value['format'] === undefined) return false; + return true; } export function OgrSourceTimeFormatAutoFromJSON(json: any): OgrSourceTimeFormatAuto { @@ -52,7 +50,7 @@ export function OgrSourceTimeFormatAutoFromJSON(json: any): OgrSourceTimeFormatA } export function OgrSourceTimeFormatAutoFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormatAuto { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -61,16 +59,18 @@ export function OgrSourceTimeFormatAutoFromJSONTyped(json: any, ignoreDiscrimina }; } -export function OgrSourceTimeFormatAutoToJSON(value?: OgrSourceTimeFormatAuto | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceTimeFormatAutoToJSON(json: any): OgrSourceTimeFormatAuto { + return OgrSourceTimeFormatAutoToJSONTyped(json, false); +} + +export function OgrSourceTimeFormatAutoToJSONTyped(value?: OgrSourceTimeFormatAuto | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'format': value.format, + 'format': value['format'], }; } diff --git a/typescript/src/models/OgrSourceTimeFormatCustom.ts b/typescript/src/models/OgrSourceTimeFormatCustom.ts index 63c2b30e..186c28bc 100644 --- a/typescript/src/models/OgrSourceTimeFormatCustom.ts +++ b/typescript/src/models/OgrSourceTimeFormatCustom.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type OgrSourceTimeFormatCustomFormatEnum = typeof OgrSourceTimeFormatCust /** * Check if a given object implements the OgrSourceTimeFormatCustom interface. */ -export function instanceOfOgrSourceTimeFormatCustom(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "customFormat" in value; - isInstance = isInstance && "format" in value; - - return isInstance; +export function instanceOfOgrSourceTimeFormatCustom(value: object): value is OgrSourceTimeFormatCustom { + if (!('customFormat' in value) || value['customFormat'] === undefined) return false; + if (!('format' in value) || value['format'] === undefined) return false; + return true; } export function OgrSourceTimeFormatCustomFromJSON(json: any): OgrSourceTimeFormatCustom { @@ -59,7 +57,7 @@ export function OgrSourceTimeFormatCustomFromJSON(json: any): OgrSourceTimeForma } export function OgrSourceTimeFormatCustomFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormatCustom { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function OgrSourceTimeFormatCustomFromJSONTyped(json: any, ignoreDiscrimi }; } -export function OgrSourceTimeFormatCustomToJSON(value?: OgrSourceTimeFormatCustom | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceTimeFormatCustomToJSON(json: any): OgrSourceTimeFormatCustom { + return OgrSourceTimeFormatCustomToJSONTyped(json, false); +} + +export function OgrSourceTimeFormatCustomToJSONTyped(value?: OgrSourceTimeFormatCustom | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'customFormat': value.customFormat, - 'format': value.format, + 'customFormat': value['customFormat'], + 'format': value['format'], }; } diff --git a/typescript/src/models/OgrSourceTimeFormatUnixTimeStamp.ts b/typescript/src/models/OgrSourceTimeFormatUnixTimeStamp.ts index 9884584a..58fee23b 100644 --- a/typescript/src/models/OgrSourceTimeFormatUnixTimeStamp.ts +++ b/typescript/src/models/OgrSourceTimeFormatUnixTimeStamp.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { UnixTimeStampType } from './UnixTimeStampType'; import { UnixTimeStampTypeFromJSON, UnixTimeStampTypeFromJSONTyped, UnixTimeStampTypeToJSON, + UnixTimeStampTypeToJSONTyped, } from './UnixTimeStampType'; /** @@ -53,12 +54,10 @@ export type OgrSourceTimeFormatUnixTimeStampFormatEnum = typeof OgrSourceTimeFor /** * Check if a given object implements the OgrSourceTimeFormatUnixTimeStamp interface. */ -export function instanceOfOgrSourceTimeFormatUnixTimeStamp(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "format" in value; - isInstance = isInstance && "timestampType" in value; - - return isInstance; +export function instanceOfOgrSourceTimeFormatUnixTimeStamp(value: object): value is OgrSourceTimeFormatUnixTimeStamp { + if (!('format' in value) || value['format'] === undefined) return false; + if (!('timestampType' in value) || value['timestampType'] === undefined) return false; + return true; } export function OgrSourceTimeFormatUnixTimeStampFromJSON(json: any): OgrSourceTimeFormatUnixTimeStamp { @@ -66,7 +65,7 @@ export function OgrSourceTimeFormatUnixTimeStampFromJSON(json: any): OgrSourceTi } export function OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json: any, ignoreDiscriminator: boolean): OgrSourceTimeFormatUnixTimeStamp { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -76,17 +75,19 @@ export function OgrSourceTimeFormatUnixTimeStampFromJSONTyped(json: any, ignoreD }; } -export function OgrSourceTimeFormatUnixTimeStampToJSON(value?: OgrSourceTimeFormatUnixTimeStamp | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OgrSourceTimeFormatUnixTimeStampToJSON(json: any): OgrSourceTimeFormatUnixTimeStamp { + return OgrSourceTimeFormatUnixTimeStampToJSONTyped(json, false); +} + +export function OgrSourceTimeFormatUnixTimeStampToJSONTyped(value?: OgrSourceTimeFormatUnixTimeStamp | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'format': value.format, - 'timestampType': UnixTimeStampTypeToJSON(value.timestampType), + 'format': value['format'], + 'timestampType': UnixTimeStampTypeToJSON(value['timestampType']), }; } diff --git a/typescript/src/models/OperatorQuota.ts b/typescript/src/models/OperatorQuota.ts index b7067a3e..011da427 100644 --- a/typescript/src/models/OperatorQuota.ts +++ b/typescript/src/models/OperatorQuota.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -42,13 +42,11 @@ export interface OperatorQuota { /** * Check if a given object implements the OperatorQuota interface. */ -export function instanceOfOperatorQuota(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "count" in value; - isInstance = isInstance && "operatorName" in value; - isInstance = isInstance && "operatorPath" in value; - - return isInstance; +export function instanceOfOperatorQuota(value: object): value is OperatorQuota { + if (!('count' in value) || value['count'] === undefined) return false; + if (!('operatorName' in value) || value['operatorName'] === undefined) return false; + if (!('operatorPath' in value) || value['operatorPath'] === undefined) return false; + return true; } export function OperatorQuotaFromJSON(json: any): OperatorQuota { @@ -56,7 +54,7 @@ export function OperatorQuotaFromJSON(json: any): OperatorQuota { } export function OperatorQuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): OperatorQuota { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,18 +65,20 @@ export function OperatorQuotaFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function OperatorQuotaToJSON(value?: OperatorQuota | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function OperatorQuotaToJSON(json: any): OperatorQuota { + return OperatorQuotaToJSONTyped(json, false); +} + +export function OperatorQuotaToJSONTyped(value?: OperatorQuota | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'count': value.count, - 'operatorName': value.operatorName, - 'operatorPath': value.operatorPath, + 'count': value['count'], + 'operatorName': value['operatorName'], + 'operatorPath': value['operatorPath'], }; } diff --git a/typescript/src/models/OrderBy.ts b/typescript/src/models/OrderBy.ts index 24a856ca..80b4f381 100644 --- a/typescript/src/models/OrderBy.ts +++ b/typescript/src/models/OrderBy.ts @@ -24,6 +24,17 @@ export const OrderBy = { export type OrderBy = typeof OrderBy[keyof typeof OrderBy]; +export function instanceOfOrderBy(value: any): boolean { + for (const key in OrderBy) { + if (Object.prototype.hasOwnProperty.call(OrderBy, key)) { + if (OrderBy[key as keyof typeof OrderBy] === value) { + return true; + } + } + } + return false; +} + export function OrderByFromJSON(json: any): OrderBy { return OrderByFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function OrderByToJSON(value?: OrderBy | null): any { return value as any; } +export function OrderByToJSONTyped(value: any, ignoreDiscriminator: boolean): OrderBy { + return value as OrderBy; +} + diff --git a/typescript/src/models/PaletteColorizer.ts b/typescript/src/models/PaletteColorizer.ts index ae826a0d..ff432560 100644 --- a/typescript/src/models/PaletteColorizer.ts +++ b/typescript/src/models/PaletteColorizer.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -60,14 +60,12 @@ export type PaletteColorizerTypeEnum = typeof PaletteColorizerTypeEnum[keyof typ /** * Check if a given object implements the PaletteColorizer interface. */ -export function instanceOfPaletteColorizer(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "colors" in value; - isInstance = isInstance && "defaultColor" in value; - isInstance = isInstance && "noDataColor" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfPaletteColorizer(value: object): value is PaletteColorizer { + if (!('colors' in value) || value['colors'] === undefined) return false; + if (!('defaultColor' in value) || value['defaultColor'] === undefined) return false; + if (!('noDataColor' in value) || value['noDataColor'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function PaletteColorizerFromJSON(json: any): PaletteColorizer { @@ -75,7 +73,7 @@ export function PaletteColorizerFromJSON(json: any): PaletteColorizer { } export function PaletteColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaletteColorizer { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -87,19 +85,21 @@ export function PaletteColorizerFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function PaletteColorizerToJSON(value?: PaletteColorizer | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PaletteColorizerToJSON(json: any): PaletteColorizer { + return PaletteColorizerToJSONTyped(json, false); +} + +export function PaletteColorizerToJSONTyped(value?: PaletteColorizer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'colors': value.colors, - 'defaultColor': value.defaultColor, - 'noDataColor': value.noDataColor, - 'type': value.type, + 'colors': value['colors'], + 'defaultColor': value['defaultColor'], + 'noDataColor': value['noDataColor'], + 'type': value['type'], }; } diff --git a/typescript/src/models/Permission.ts b/typescript/src/models/Permission.ts index f5ad5a78..8e5cf7dc 100644 --- a/typescript/src/models/Permission.ts +++ b/typescript/src/models/Permission.ts @@ -24,6 +24,17 @@ export const Permission = { export type Permission = typeof Permission[keyof typeof Permission]; +export function instanceOfPermission(value: any): boolean { + for (const key in Permission) { + if (Object.prototype.hasOwnProperty.call(Permission, key)) { + if (Permission[key as keyof typeof Permission] === value) { + return true; + } + } + } + return false; +} + export function PermissionFromJSON(json: any): Permission { return PermissionFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function PermissionToJSON(value?: Permission | null): any { return value as any; } +export function PermissionToJSONTyped(value: any, ignoreDiscriminator: boolean): Permission { + return value as Permission; +} + diff --git a/typescript/src/models/PermissionListOptions.ts b/typescript/src/models/PermissionListOptions.ts index e5c33bf0..170a4faa 100644 --- a/typescript/src/models/PermissionListOptions.ts +++ b/typescript/src/models/PermissionListOptions.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface PermissionListOptions { /** * Check if a given object implements the PermissionListOptions interface. */ -export function instanceOfPermissionListOptions(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "limit" in value; - isInstance = isInstance && "offset" in value; - - return isInstance; +export function instanceOfPermissionListOptions(value: object): value is PermissionListOptions { + if (!('limit' in value) || value['limit'] === undefined) return false; + if (!('offset' in value) || value['offset'] === undefined) return false; + return true; } export function PermissionListOptionsFromJSON(json: any): PermissionListOptions { @@ -49,7 +47,7 @@ export function PermissionListOptionsFromJSON(json: any): PermissionListOptions } export function PermissionListOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PermissionListOptions { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function PermissionListOptionsFromJSONTyped(json: any, ignoreDiscriminato }; } -export function PermissionListOptionsToJSON(value?: PermissionListOptions | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PermissionListOptionsToJSON(json: any): PermissionListOptions { + return PermissionListOptionsToJSONTyped(json, false); +} + +export function PermissionListOptionsToJSONTyped(value?: PermissionListOptions | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'limit': value.limit, - 'offset': value.offset, + 'limit': value['limit'], + 'offset': value['offset'], }; } diff --git a/typescript/src/models/PermissionListing.ts b/typescript/src/models/PermissionListing.ts index 13dfdff1..6c262ca0 100644 --- a/typescript/src/models/PermissionListing.ts +++ b/typescript/src/models/PermissionListing.ts @@ -12,25 +12,28 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; +import type { Role } from './Role'; +import { + RoleFromJSON, + RoleFromJSONTyped, + RoleToJSON, + RoleToJSONTyped, +} from './Role'; import type { Permission } from './Permission'; import { PermissionFromJSON, PermissionFromJSONTyped, PermissionToJSON, + PermissionToJSONTyped, } from './Permission'; import type { Resource } from './Resource'; import { ResourceFromJSON, ResourceFromJSONTyped, ResourceToJSON, + ResourceToJSONTyped, } from './Resource'; -import type { Role } from './Role'; -import { - RoleFromJSON, - RoleFromJSONTyped, - RoleToJSON, -} from './Role'; /** * @@ -58,16 +61,16 @@ export interface PermissionListing { role: Role; } + + /** * Check if a given object implements the PermissionListing interface. */ -export function instanceOfPermissionListing(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "permission" in value; - isInstance = isInstance && "resource" in value; - isInstance = isInstance && "role" in value; - - return isInstance; +export function instanceOfPermissionListing(value: object): value is PermissionListing { + if (!('permission' in value) || value['permission'] === undefined) return false; + if (!('resource' in value) || value['resource'] === undefined) return false; + if (!('role' in value) || value['role'] === undefined) return false; + return true; } export function PermissionListingFromJSON(json: any): PermissionListing { @@ -75,7 +78,7 @@ export function PermissionListingFromJSON(json: any): PermissionListing { } export function PermissionListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): PermissionListing { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -86,18 +89,20 @@ export function PermissionListingFromJSONTyped(json: any, ignoreDiscriminator: b }; } -export function PermissionListingToJSON(value?: PermissionListing | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PermissionListingToJSON(json: any): PermissionListing { + return PermissionListingToJSONTyped(json, false); +} + +export function PermissionListingToJSONTyped(value?: PermissionListing | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'permission': PermissionToJSON(value.permission), - 'resource': ResourceToJSON(value.resource), - 'role': RoleToJSON(value.role), + 'permission': PermissionToJSON(value['permission']), + 'resource': ResourceToJSON(value['resource']), + 'role': RoleToJSON(value['role']), }; } diff --git a/typescript/src/models/PermissionRequest.ts b/typescript/src/models/PermissionRequest.ts index d332d5cf..bd4a219c 100644 --- a/typescript/src/models/PermissionRequest.ts +++ b/typescript/src/models/PermissionRequest.ts @@ -12,18 +12,20 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Permission } from './Permission'; import { PermissionFromJSON, PermissionFromJSONTyped, PermissionToJSON, + PermissionToJSONTyped, } from './Permission'; import type { Resource } from './Resource'; import { ResourceFromJSON, ResourceFromJSONTyped, ResourceToJSON, + ResourceToJSONTyped, } from './Resource'; /** @@ -52,16 +54,16 @@ export interface PermissionRequest { roleId: string; } + + /** * Check if a given object implements the PermissionRequest interface. */ -export function instanceOfPermissionRequest(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "permission" in value; - isInstance = isInstance && "resource" in value; - isInstance = isInstance && "roleId" in value; - - return isInstance; +export function instanceOfPermissionRequest(value: object): value is PermissionRequest { + if (!('permission' in value) || value['permission'] === undefined) return false; + if (!('resource' in value) || value['resource'] === undefined) return false; + if (!('roleId' in value) || value['roleId'] === undefined) return false; + return true; } export function PermissionRequestFromJSON(json: any): PermissionRequest { @@ -69,7 +71,7 @@ export function PermissionRequestFromJSON(json: any): PermissionRequest { } export function PermissionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PermissionRequest { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -80,18 +82,20 @@ export function PermissionRequestFromJSONTyped(json: any, ignoreDiscriminator: b }; } -export function PermissionRequestToJSON(value?: PermissionRequest | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PermissionRequestToJSON(json: any): PermissionRequest { + return PermissionRequestToJSONTyped(json, false); +} + +export function PermissionRequestToJSONTyped(value?: PermissionRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'permission': PermissionToJSON(value.permission), - 'resource': ResourceToJSON(value.resource), - 'roleId': value.roleId, + 'permission': PermissionToJSON(value['permission']), + 'resource': ResourceToJSON(value['resource']), + 'roleId': value['roleId'], }; } diff --git a/typescript/src/models/Plot.ts b/typescript/src/models/Plot.ts index d0a987ba..9d16f1d6 100644 --- a/typescript/src/models/Plot.ts +++ b/typescript/src/models/Plot.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface Plot { /** * Check if a given object implements the Plot interface. */ -export function instanceOfPlot(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - - return isInstance; +export function instanceOfPlot(value: object): value is Plot { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('workflow' in value) || value['workflow'] === undefined) return false; + return true; } export function PlotFromJSON(json: any): Plot { @@ -49,7 +47,7 @@ export function PlotFromJSON(json: any): Plot { } export function PlotFromJSONTyped(json: any, ignoreDiscriminator: boolean): Plot { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function PlotFromJSONTyped(json: any, ignoreDiscriminator: boolean): Plot }; } -export function PlotToJSON(value?: Plot | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PlotToJSON(json: any): Plot { + return PlotToJSONTyped(json, false); +} + +export function PlotToJSONTyped(value?: Plot | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'name': value.name, - 'workflow': value.workflow, + 'name': value['name'], + 'workflow': value['workflow'], }; } diff --git a/typescript/src/models/PlotOutputFormat.ts b/typescript/src/models/PlotOutputFormat.ts index 7bbfbc55..49b3478e 100644 --- a/typescript/src/models/PlotOutputFormat.ts +++ b/typescript/src/models/PlotOutputFormat.ts @@ -25,6 +25,17 @@ export const PlotOutputFormat = { export type PlotOutputFormat = typeof PlotOutputFormat[keyof typeof PlotOutputFormat]; +export function instanceOfPlotOutputFormat(value: any): boolean { + for (const key in PlotOutputFormat) { + if (Object.prototype.hasOwnProperty.call(PlotOutputFormat, key)) { + if (PlotOutputFormat[key as keyof typeof PlotOutputFormat] === value) { + return true; + } + } + } + return false; +} + export function PlotOutputFormatFromJSON(json: any): PlotOutputFormat { return PlotOutputFormatFromJSONTyped(json, false); } @@ -37,3 +48,7 @@ export function PlotOutputFormatToJSON(value?: PlotOutputFormat | null): any { return value as any; } +export function PlotOutputFormatToJSONTyped(value: any, ignoreDiscriminator: boolean): PlotOutputFormat { + return value as PlotOutputFormat; +} + diff --git a/typescript/src/models/PlotQueryRectangle.ts b/typescript/src/models/PlotQueryRectangle.ts index 93549eac..1802eb96 100644 --- a/typescript/src/models/PlotQueryRectangle.ts +++ b/typescript/src/models/PlotQueryRectangle.ts @@ -12,25 +12,28 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { BoundingBox2D } from './BoundingBox2D'; -import { - BoundingBox2DFromJSON, - BoundingBox2DFromJSONTyped, - BoundingBox2DToJSON, -} from './BoundingBox2D'; +import { mapValues } from '../runtime'; import type { SpatialResolution } from './SpatialResolution'; import { SpatialResolutionFromJSON, SpatialResolutionFromJSONTyped, SpatialResolutionToJSON, + SpatialResolutionToJSONTyped, } from './SpatialResolution'; import type { TimeInterval } from './TimeInterval'; import { TimeIntervalFromJSON, TimeIntervalFromJSONTyped, TimeIntervalToJSON, + TimeIntervalToJSONTyped, } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; +import { + BoundingBox2DFromJSON, + BoundingBox2DFromJSONTyped, + BoundingBox2DToJSON, + BoundingBox2DToJSONTyped, +} from './BoundingBox2D'; /** * A spatio-temporal rectangle with a specified resolution @@ -61,13 +64,11 @@ export interface PlotQueryRectangle { /** * Check if a given object implements the PlotQueryRectangle interface. */ -export function instanceOfPlotQueryRectangle(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "spatialBounds" in value; - isInstance = isInstance && "spatialResolution" in value; - isInstance = isInstance && "timeInterval" in value; - - return isInstance; +export function instanceOfPlotQueryRectangle(value: object): value is PlotQueryRectangle { + if (!('spatialBounds' in value) || value['spatialBounds'] === undefined) return false; + if (!('spatialResolution' in value) || value['spatialResolution'] === undefined) return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) return false; + return true; } export function PlotQueryRectangleFromJSON(json: any): PlotQueryRectangle { @@ -75,7 +76,7 @@ export function PlotQueryRectangleFromJSON(json: any): PlotQueryRectangle { } export function PlotQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlotQueryRectangle { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -86,18 +87,20 @@ export function PlotQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function PlotQueryRectangleToJSON(value?: PlotQueryRectangle | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PlotQueryRectangleToJSON(json: any): PlotQueryRectangle { + return PlotQueryRectangleToJSONTyped(json, false); +} + +export function PlotQueryRectangleToJSONTyped(value?: PlotQueryRectangle | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'spatialBounds': BoundingBox2DToJSON(value.spatialBounds), - 'spatialResolution': SpatialResolutionToJSON(value.spatialResolution), - 'timeInterval': TimeIntervalToJSON(value.timeInterval), + 'spatialBounds': BoundingBox2DToJSON(value['spatialBounds']), + 'spatialResolution': SpatialResolutionToJSON(value['spatialResolution']), + 'timeInterval': TimeIntervalToJSON(value['timeInterval']), }; } diff --git a/typescript/src/models/PlotResultDescriptor.ts b/typescript/src/models/PlotResultDescriptor.ts index aaf1df8e..b9252fd3 100644 --- a/typescript/src/models/PlotResultDescriptor.ts +++ b/typescript/src/models/PlotResultDescriptor.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { BoundingBox2D } from './BoundingBox2D'; -import { - BoundingBox2DFromJSON, - BoundingBox2DFromJSONTyped, - BoundingBox2DToJSON, -} from './BoundingBox2D'; +import { mapValues } from '../runtime'; import type { TimeInterval } from './TimeInterval'; import { TimeIntervalFromJSON, TimeIntervalFromJSONTyped, TimeIntervalToJSON, + TimeIntervalToJSONTyped, } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; +import { + BoundingBox2DFromJSON, + BoundingBox2DFromJSONTyped, + BoundingBox2DToJSON, + BoundingBox2DToJSONTyped, +} from './BoundingBox2D'; /** * A `ResultDescriptor` for plot queries @@ -55,11 +57,9 @@ export interface PlotResultDescriptor { /** * Check if a given object implements the PlotResultDescriptor interface. */ -export function instanceOfPlotResultDescriptor(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "spatialReference" in value; - - return isInstance; +export function instanceOfPlotResultDescriptor(value: object): value is PlotResultDescriptor { + if (!('spatialReference' in value) || value['spatialReference'] === undefined) return false; + return true; } export function PlotResultDescriptorFromJSON(json: any): PlotResultDescriptor { @@ -67,29 +67,31 @@ export function PlotResultDescriptorFromJSON(json: any): PlotResultDescriptor { } export function PlotResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlotResultDescriptor { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !exists(json, 'bbox') ? undefined : BoundingBox2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : BoundingBox2DFromJSON(json['bbox']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), }; } -export function PlotResultDescriptorToJSON(value?: PlotResultDescriptor | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PlotResultDescriptorToJSON(json: any): PlotResultDescriptor { + return PlotResultDescriptorToJSONTyped(json, false); +} + +export function PlotResultDescriptorToJSONTyped(value?: PlotResultDescriptor | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bbox': BoundingBox2DToJSON(value.bbox), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), + 'bbox': BoundingBox2DToJSON(value['bbox']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), }; } diff --git a/typescript/src/models/PlotUpdate.ts b/typescript/src/models/PlotUpdate.ts index 8b452091..887d0ca4 100644 --- a/typescript/src/models/PlotUpdate.ts +++ b/typescript/src/models/PlotUpdate.ts @@ -12,15 +12,15 @@ * Do not edit the class manually. */ +import type { Plot } from './Plot'; import { - Plot, instanceOfPlot, PlotFromJSON, PlotFromJSONTyped, PlotToJSON, } from './Plot'; +import type { ProjectUpdateToken } from './ProjectUpdateToken'; import { - ProjectUpdateToken, instanceOfProjectUpdateToken, ProjectUpdateTokenFromJSON, ProjectUpdateTokenFromJSONTyped, @@ -39,24 +39,26 @@ export function PlotUpdateFromJSON(json: any): PlotUpdate { } export function PlotUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlotUpdate { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - if (json === ProjectUpdateToken.None) { - return ProjectUpdateToken.None; - } else if (json === ProjectUpdateToken.Delete) { - return ProjectUpdateToken.Delete; - } else { - return { ...PlotFromJSONTyped(json, true) }; + if (instanceOfPlot(json)) { + return PlotFromJSONTyped(json, true); } + if (instanceOfProjectUpdateToken(json)) { + return ProjectUpdateTokenFromJSONTyped(json, true); + } + + return {} as any; } -export function PlotUpdateToJSON(value?: PlotUpdate | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PlotUpdateToJSON(json: any): any { + return PlotUpdateToJSONTyped(json, false); +} + +export function PlotUpdateToJSONTyped(value?: PlotUpdate | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } if (typeof value === 'object' && instanceOfPlot(value)) { diff --git a/typescript/src/models/PointSymbology.ts b/typescript/src/models/PointSymbology.ts index f1a5fa46..3849daf5 100644 --- a/typescript/src/models/PointSymbology.ts +++ b/typescript/src/models/PointSymbology.ts @@ -12,31 +12,35 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { ColorParam } from './ColorParam'; -import { - ColorParamFromJSON, - ColorParamFromJSONTyped, - ColorParamToJSON, -} from './ColorParam'; -import type { NumberParam } from './NumberParam'; +import { mapValues } from '../runtime'; +import type { TextSymbology } from './TextSymbology'; import { - NumberParamFromJSON, - NumberParamFromJSONTyped, - NumberParamToJSON, -} from './NumberParam'; + TextSymbologyFromJSON, + TextSymbologyFromJSONTyped, + TextSymbologyToJSON, + TextSymbologyToJSONTyped, +} from './TextSymbology'; import type { StrokeParam } from './StrokeParam'; import { StrokeParamFromJSON, StrokeParamFromJSONTyped, StrokeParamToJSON, + StrokeParamToJSONTyped, } from './StrokeParam'; -import type { TextSymbology } from './TextSymbology'; +import type { NumberParam } from './NumberParam'; import { - TextSymbologyFromJSON, - TextSymbologyFromJSONTyped, - TextSymbologyToJSON, -} from './TextSymbology'; + NumberParamFromJSON, + NumberParamFromJSONTyped, + NumberParamToJSON, + NumberParamToJSONTyped, +} from './NumberParam'; +import type { ColorParam } from './ColorParam'; +import { + ColorParamFromJSON, + ColorParamFromJSONTyped, + ColorParamToJSON, + ColorParamToJSONTyped, +} from './ColorParam'; /** * @@ -89,14 +93,12 @@ export type PointSymbologyTypeEnum = typeof PointSymbologyTypeEnum[keyof typeof /** * Check if a given object implements the PointSymbology interface. */ -export function instanceOfPointSymbology(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "fillColor" in value; - isInstance = isInstance && "radius" in value; - isInstance = isInstance && "stroke" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfPointSymbology(value: object): value is PointSymbology { + if (!('fillColor' in value) || value['fillColor'] === undefined) return false; + if (!('radius' in value) || value['radius'] === undefined) return false; + if (!('stroke' in value) || value['stroke'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function PointSymbologyFromJSON(json: any): PointSymbology { @@ -104,7 +106,7 @@ export function PointSymbologyFromJSON(json: any): PointSymbology { } export function PointSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PointSymbology { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -112,25 +114,27 @@ export function PointSymbologyFromJSONTyped(json: any, ignoreDiscriminator: bool 'fillColor': ColorParamFromJSON(json['fillColor']), 'radius': NumberParamFromJSON(json['radius']), 'stroke': StrokeParamFromJSON(json['stroke']), - 'text': !exists(json, 'text') ? undefined : TextSymbologyFromJSON(json['text']), + 'text': json['text'] == null ? undefined : TextSymbologyFromJSON(json['text']), 'type': json['type'], }; } -export function PointSymbologyToJSON(value?: PointSymbology | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PointSymbologyToJSON(json: any): PointSymbology { + return PointSymbologyToJSONTyped(json, false); +} + +export function PointSymbologyToJSONTyped(value?: PointSymbology | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'fillColor': ColorParamToJSON(value.fillColor), - 'radius': NumberParamToJSON(value.radius), - 'stroke': StrokeParamToJSON(value.stroke), - 'text': TextSymbologyToJSON(value.text), - 'type': value.type, + 'fillColor': ColorParamToJSON(value['fillColor']), + 'radius': NumberParamToJSON(value['radius']), + 'stroke': StrokeParamToJSON(value['stroke']), + 'text': TextSymbologyToJSON(value['text']), + 'type': value['type'], }; } diff --git a/typescript/src/models/PolygonSymbology.ts b/typescript/src/models/PolygonSymbology.ts index 972419cf..8a8072a2 100644 --- a/typescript/src/models/PolygonSymbology.ts +++ b/typescript/src/models/PolygonSymbology.ts @@ -12,25 +12,28 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { ColorParam } from './ColorParam'; +import { mapValues } from '../runtime'; +import type { TextSymbology } from './TextSymbology'; import { - ColorParamFromJSON, - ColorParamFromJSONTyped, - ColorParamToJSON, -} from './ColorParam'; + TextSymbologyFromJSON, + TextSymbologyFromJSONTyped, + TextSymbologyToJSON, + TextSymbologyToJSONTyped, +} from './TextSymbology'; import type { StrokeParam } from './StrokeParam'; import { StrokeParamFromJSON, StrokeParamFromJSONTyped, StrokeParamToJSON, + StrokeParamToJSONTyped, } from './StrokeParam'; -import type { TextSymbology } from './TextSymbology'; +import type { ColorParam } from './ColorParam'; import { - TextSymbologyFromJSON, - TextSymbologyFromJSONTyped, - TextSymbologyToJSON, -} from './TextSymbology'; + ColorParamFromJSON, + ColorParamFromJSONTyped, + ColorParamToJSON, + ColorParamToJSONTyped, +} from './ColorParam'; /** * @@ -83,14 +86,12 @@ export type PolygonSymbologyTypeEnum = typeof PolygonSymbologyTypeEnum[keyof typ /** * Check if a given object implements the PolygonSymbology interface. */ -export function instanceOfPolygonSymbology(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "autoSimplified" in value; - isInstance = isInstance && "fillColor" in value; - isInstance = isInstance && "stroke" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfPolygonSymbology(value: object): value is PolygonSymbology { + if (!('autoSimplified' in value) || value['autoSimplified'] === undefined) return false; + if (!('fillColor' in value) || value['fillColor'] === undefined) return false; + if (!('stroke' in value) || value['stroke'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function PolygonSymbologyFromJSON(json: any): PolygonSymbology { @@ -98,7 +99,7 @@ export function PolygonSymbologyFromJSON(json: any): PolygonSymbology { } export function PolygonSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PolygonSymbology { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -106,25 +107,27 @@ export function PolygonSymbologyFromJSONTyped(json: any, ignoreDiscriminator: bo 'autoSimplified': json['autoSimplified'], 'fillColor': ColorParamFromJSON(json['fillColor']), 'stroke': StrokeParamFromJSON(json['stroke']), - 'text': !exists(json, 'text') ? undefined : TextSymbologyFromJSON(json['text']), + 'text': json['text'] == null ? undefined : TextSymbologyFromJSON(json['text']), 'type': json['type'], }; } -export function PolygonSymbologyToJSON(value?: PolygonSymbology | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function PolygonSymbologyToJSON(json: any): PolygonSymbology { + return PolygonSymbologyToJSONTyped(json, false); +} + +export function PolygonSymbologyToJSONTyped(value?: PolygonSymbology | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'autoSimplified': value.autoSimplified, - 'fillColor': ColorParamToJSON(value.fillColor), - 'stroke': StrokeParamToJSON(value.stroke), - 'text': TextSymbologyToJSON(value.text), - 'type': value.type, + 'autoSimplified': value['autoSimplified'], + 'fillColor': ColorParamToJSON(value['fillColor']), + 'stroke': StrokeParamToJSON(value['stroke']), + 'text': TextSymbologyToJSON(value['text']), + 'type': value['type'], }; } diff --git a/typescript/src/models/Project.ts b/typescript/src/models/Project.ts index 117a42d6..8fd62864 100644 --- a/typescript/src/models/Project.ts +++ b/typescript/src/models/Project.ts @@ -12,37 +12,42 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; +import type { TimeStep } from './TimeStep'; +import { + TimeStepFromJSON, + TimeStepFromJSONTyped, + TimeStepToJSON, + TimeStepToJSONTyped, +} from './TimeStep'; import type { Plot } from './Plot'; import { PlotFromJSON, PlotFromJSONTyped, PlotToJSON, + PlotToJSONTyped, } from './Plot'; -import type { ProjectLayer } from './ProjectLayer'; -import { - ProjectLayerFromJSON, - ProjectLayerFromJSONTyped, - ProjectLayerToJSON, -} from './ProjectLayer'; import type { ProjectVersion } from './ProjectVersion'; import { ProjectVersionFromJSON, ProjectVersionFromJSONTyped, ProjectVersionToJSON, + ProjectVersionToJSONTyped, } from './ProjectVersion'; import type { STRectangle } from './STRectangle'; import { STRectangleFromJSON, STRectangleFromJSONTyped, STRectangleToJSON, + STRectangleToJSONTyped, } from './STRectangle'; -import type { TimeStep } from './TimeStep'; +import type { ProjectLayer } from './ProjectLayer'; import { - TimeStepFromJSON, - TimeStepFromJSONTyped, - TimeStepToJSON, -} from './TimeStep'; + ProjectLayerFromJSON, + ProjectLayerFromJSONTyped, + ProjectLayerToJSON, + ProjectLayerToJSONTyped, +} from './ProjectLayer'; /** * @@ -103,18 +108,16 @@ export interface Project { /** * Check if a given object implements the Project interface. */ -export function instanceOfProject(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "bounds" in value; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "layers" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "plots" in value; - isInstance = isInstance && "timeStep" in value; - isInstance = isInstance && "version" in value; - - return isInstance; +export function instanceOfProject(value: object): value is Project { + if (!('bounds' in value) || value['bounds'] === undefined) return false; + if (!('description' in value) || value['description'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('layers' in value) || value['layers'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('plots' in value) || value['plots'] === undefined) return false; + if (!('timeStep' in value) || value['timeStep'] === undefined) return false; + if (!('version' in value) || value['version'] === undefined) return false; + return true; } export function ProjectFromJSON(json: any): Project { @@ -122,7 +125,7 @@ export function ProjectFromJSON(json: any): Project { } export function ProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): Project { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -138,23 +141,25 @@ export function ProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): P }; } -export function ProjectToJSON(value?: Project | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProjectToJSON(json: any): Project { + return ProjectToJSONTyped(json, false); +} + +export function ProjectToJSONTyped(value?: Project | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bounds': STRectangleToJSON(value.bounds), - 'description': value.description, - 'id': value.id, - 'layers': ((value.layers as Array).map(ProjectLayerToJSON)), - 'name': value.name, - 'plots': ((value.plots as Array).map(PlotToJSON)), - 'timeStep': TimeStepToJSON(value.timeStep), - 'version': ProjectVersionToJSON(value.version), + 'bounds': STRectangleToJSON(value['bounds']), + 'description': value['description'], + 'id': value['id'], + 'layers': ((value['layers'] as Array).map(ProjectLayerToJSON)), + 'name': value['name'], + 'plots': ((value['plots'] as Array).map(PlotToJSON)), + 'timeStep': TimeStepToJSON(value['timeStep']), + 'version': ProjectVersionToJSON(value['version']), }; } diff --git a/typescript/src/models/ProjectLayer.ts b/typescript/src/models/ProjectLayer.ts index 36a11de6..c283b5de 100644 --- a/typescript/src/models/ProjectLayer.ts +++ b/typescript/src/models/ProjectLayer.ts @@ -12,18 +12,20 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { LayerVisibility } from './LayerVisibility'; import { LayerVisibilityFromJSON, LayerVisibilityFromJSONTyped, LayerVisibilityToJSON, + LayerVisibilityToJSONTyped, } from './LayerVisibility'; import type { Symbology } from './Symbology'; import { SymbologyFromJSON, SymbologyFromJSONTyped, SymbologyToJSON, + SymbologyToJSONTyped, } from './Symbology'; /** @@ -61,14 +63,12 @@ export interface ProjectLayer { /** * Check if a given object implements the ProjectLayer interface. */ -export function instanceOfProjectLayer(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "symbology" in value; - isInstance = isInstance && "visibility" in value; - isInstance = isInstance && "workflow" in value; - - return isInstance; +export function instanceOfProjectLayer(value: object): value is ProjectLayer { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('symbology' in value) || value['symbology'] === undefined) return false; + if (!('visibility' in value) || value['visibility'] === undefined) return false; + if (!('workflow' in value) || value['workflow'] === undefined) return false; + return true; } export function ProjectLayerFromJSON(json: any): ProjectLayer { @@ -76,7 +76,7 @@ export function ProjectLayerFromJSON(json: any): ProjectLayer { } export function ProjectLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectLayer { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -88,19 +88,21 @@ export function ProjectLayerFromJSONTyped(json: any, ignoreDiscriminator: boolea }; } -export function ProjectLayerToJSON(value?: ProjectLayer | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProjectLayerToJSON(json: any): ProjectLayer { + return ProjectLayerToJSONTyped(json, false); +} + +export function ProjectLayerToJSONTyped(value?: ProjectLayer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'name': value.name, - 'symbology': SymbologyToJSON(value.symbology), - 'visibility': LayerVisibilityToJSON(value.visibility), - 'workflow': value.workflow, + 'name': value['name'], + 'symbology': SymbologyToJSON(value['symbology']), + 'visibility': LayerVisibilityToJSON(value['visibility']), + 'workflow': value['workflow'], }; } diff --git a/typescript/src/models/ProjectListing.ts b/typescript/src/models/ProjectListing.ts index bce30e15..1f1261d6 100644 --- a/typescript/src/models/ProjectListing.ts +++ b/typescript/src/models/ProjectListing.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -60,16 +60,14 @@ export interface ProjectListing { /** * Check if a given object implements the ProjectListing interface. */ -export function instanceOfProjectListing(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "changed" in value; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "layerNames" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "plotNames" in value; - - return isInstance; +export function instanceOfProjectListing(value: object): value is ProjectListing { + if (!('changed' in value) || value['changed'] === undefined) return false; + if (!('description' in value) || value['description'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('layerNames' in value) || value['layerNames'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('plotNames' in value) || value['plotNames'] === undefined) return false; + return true; } export function ProjectListingFromJSON(json: any): ProjectListing { @@ -77,7 +75,7 @@ export function ProjectListingFromJSON(json: any): ProjectListing { } export function ProjectListingFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectListing { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -91,21 +89,23 @@ export function ProjectListingFromJSONTyped(json: any, ignoreDiscriminator: bool }; } -export function ProjectListingToJSON(value?: ProjectListing | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProjectListingToJSON(json: any): ProjectListing { + return ProjectListingToJSONTyped(json, false); +} + +export function ProjectListingToJSONTyped(value?: ProjectListing | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'changed': (value.changed.toISOString()), - 'description': value.description, - 'id': value.id, - 'layerNames': value.layerNames, - 'name': value.name, - 'plotNames': value.plotNames, + 'changed': ((value['changed']).toISOString()), + 'description': value['description'], + 'id': value['id'], + 'layerNames': value['layerNames'], + 'name': value['name'], + 'plotNames': value['plotNames'], }; } diff --git a/typescript/src/models/ProjectResource.ts b/typescript/src/models/ProjectResource.ts index e0d208c6..3e139e94 100644 --- a/typescript/src/models/ProjectResource.ts +++ b/typescript/src/models/ProjectResource.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type ProjectResourceTypeEnum = typeof ProjectResourceTypeEnum[keyof typeo /** * Check if a given object implements the ProjectResource interface. */ -export function instanceOfProjectResource(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfProjectResource(value: object): value is ProjectResource { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function ProjectResourceFromJSON(json: any): ProjectResource { @@ -59,7 +57,7 @@ export function ProjectResourceFromJSON(json: any): ProjectResource { } export function ProjectResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectResource { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function ProjectResourceFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function ProjectResourceToJSON(value?: ProjectResource | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProjectResourceToJSON(json: any): ProjectResource { + return ProjectResourceToJSONTyped(json, false); +} + +export function ProjectResourceToJSONTyped(value?: ProjectResource | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/src/models/ProjectUpdateToken.ts b/typescript/src/models/ProjectUpdateToken.ts index 0d5917ef..9ecc9743 100644 --- a/typescript/src/models/ProjectUpdateToken.ts +++ b/typescript/src/models/ProjectUpdateToken.ts @@ -24,6 +24,17 @@ export const ProjectUpdateToken = { export type ProjectUpdateToken = typeof ProjectUpdateToken[keyof typeof ProjectUpdateToken]; +export function instanceOfProjectUpdateToken(value: any): boolean { + for (const key in ProjectUpdateToken) { + if (Object.prototype.hasOwnProperty.call(ProjectUpdateToken, key)) { + if (ProjectUpdateToken[key as keyof typeof ProjectUpdateToken] === value) { + return true; + } + } + } + return false; +} + export function ProjectUpdateTokenFromJSON(json: any): ProjectUpdateToken { return ProjectUpdateTokenFromJSONTyped(json, false); } @@ -32,11 +43,11 @@ export function ProjectUpdateTokenFromJSONTyped(json: any, ignoreDiscriminator: return json as ProjectUpdateToken; } -export function instanceOfProjectUpdateToken(value: any): boolean { - return value === ProjectUpdateToken.None || value === ProjectUpdateToken.Delete; -} - export function ProjectUpdateTokenToJSON(value?: ProjectUpdateToken | null): any { return value as any; } +export function ProjectUpdateTokenToJSONTyped(value: any, ignoreDiscriminator: boolean): ProjectUpdateToken { + return value as ProjectUpdateToken; +} + diff --git a/typescript/src/models/ProjectVersion.ts b/typescript/src/models/ProjectVersion.ts index 6a88e7cc..d20ca97c 100644 --- a/typescript/src/models/ProjectVersion.ts +++ b/typescript/src/models/ProjectVersion.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface ProjectVersion { /** * Check if a given object implements the ProjectVersion interface. */ -export function instanceOfProjectVersion(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "changed" in value; - isInstance = isInstance && "id" in value; - - return isInstance; +export function instanceOfProjectVersion(value: object): value is ProjectVersion { + if (!('changed' in value) || value['changed'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + return true; } export function ProjectVersionFromJSON(json: any): ProjectVersion { @@ -49,7 +47,7 @@ export function ProjectVersionFromJSON(json: any): ProjectVersion { } export function ProjectVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectVersion { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function ProjectVersionFromJSONTyped(json: any, ignoreDiscriminator: bool }; } -export function ProjectVersionToJSON(value?: ProjectVersion | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProjectVersionToJSON(json: any): ProjectVersion { + return ProjectVersionToJSONTyped(json, false); +} + +export function ProjectVersionToJSONTyped(value?: ProjectVersion | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'changed': (value.changed.toISOString()), - 'id': value.id, + 'changed': ((value['changed']).toISOString()), + 'id': value['id'], }; } diff --git a/typescript/src/models/Provenance.ts b/typescript/src/models/Provenance.ts index b879dd8d..983daee0 100644 --- a/typescript/src/models/Provenance.ts +++ b/typescript/src/models/Provenance.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -42,13 +42,11 @@ export interface Provenance { /** * Check if a given object implements the Provenance interface. */ -export function instanceOfProvenance(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "citation" in value; - isInstance = isInstance && "license" in value; - isInstance = isInstance && "uri" in value; - - return isInstance; +export function instanceOfProvenance(value: object): value is Provenance { + if (!('citation' in value) || value['citation'] === undefined) return false; + if (!('license' in value) || value['license'] === undefined) return false; + if (!('uri' in value) || value['uri'] === undefined) return false; + return true; } export function ProvenanceFromJSON(json: any): Provenance { @@ -56,7 +54,7 @@ export function ProvenanceFromJSON(json: any): Provenance { } export function ProvenanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Provenance { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,18 +65,20 @@ export function ProvenanceFromJSONTyped(json: any, ignoreDiscriminator: boolean) }; } -export function ProvenanceToJSON(value?: Provenance | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProvenanceToJSON(json: any): Provenance { + return ProvenanceToJSONTyped(json, false); +} + +export function ProvenanceToJSONTyped(value?: Provenance | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'citation': value.citation, - 'license': value.license, - 'uri': value.uri, + 'citation': value['citation'], + 'license': value['license'], + 'uri': value['uri'], }; } diff --git a/typescript/src/models/ProvenanceEntry.ts b/typescript/src/models/ProvenanceEntry.ts index 41e3d51f..77188247 100644 --- a/typescript/src/models/ProvenanceEntry.ts +++ b/typescript/src/models/ProvenanceEntry.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { DataId } from './DataId'; -import { - DataIdFromJSON, - DataIdFromJSONTyped, - DataIdToJSON, -} from './DataId'; +import { mapValues } from '../runtime'; import type { Provenance } from './Provenance'; import { ProvenanceFromJSON, ProvenanceFromJSONTyped, ProvenanceToJSON, + ProvenanceToJSONTyped, } from './Provenance'; +import type { DataId } from './DataId'; +import { + DataIdFromJSON, + DataIdFromJSONTyped, + DataIdToJSON, + DataIdToJSONTyped, +} from './DataId'; /** * @@ -49,12 +51,10 @@ export interface ProvenanceEntry { /** * Check if a given object implements the ProvenanceEntry interface. */ -export function instanceOfProvenanceEntry(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "provenance" in value; - - return isInstance; +export function instanceOfProvenanceEntry(value: object): value is ProvenanceEntry { + if (!('data' in value) || value['data'] === undefined) return false; + if (!('provenance' in value) || value['provenance'] === undefined) return false; + return true; } export function ProvenanceEntryFromJSON(json: any): ProvenanceEntry { @@ -62,7 +62,7 @@ export function ProvenanceEntryFromJSON(json: any): ProvenanceEntry { } export function ProvenanceEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProvenanceEntry { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -72,17 +72,19 @@ export function ProvenanceEntryFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function ProvenanceEntryToJSON(value?: ProvenanceEntry | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProvenanceEntryToJSON(json: any): ProvenanceEntry { + return ProvenanceEntryToJSONTyped(json, false); +} + +export function ProvenanceEntryToJSONTyped(value?: ProvenanceEntry | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'data': ((value.data as Array).map(DataIdToJSON)), - 'provenance': ProvenanceToJSON(value.provenance), + 'data': ((value['data'] as Array).map(DataIdToJSON)), + 'provenance': ProvenanceToJSON(value['provenance']), }; } diff --git a/typescript/src/models/ProvenanceOutput.ts b/typescript/src/models/ProvenanceOutput.ts index 60c45628..becb5754 100644 --- a/typescript/src/models/ProvenanceOutput.ts +++ b/typescript/src/models/ProvenanceOutput.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { DataId } from './DataId'; -import { - DataIdFromJSON, - DataIdFromJSONTyped, - DataIdToJSON, -} from './DataId'; +import { mapValues } from '../runtime'; import type { Provenance } from './Provenance'; import { ProvenanceFromJSON, ProvenanceFromJSONTyped, ProvenanceToJSON, + ProvenanceToJSONTyped, } from './Provenance'; +import type { DataId } from './DataId'; +import { + DataIdFromJSON, + DataIdFromJSONTyped, + DataIdToJSON, + DataIdToJSONTyped, +} from './DataId'; /** * @@ -49,11 +51,9 @@ export interface ProvenanceOutput { /** * Check if a given object implements the ProvenanceOutput interface. */ -export function instanceOfProvenanceOutput(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "data" in value; - - return isInstance; +export function instanceOfProvenanceOutput(value: object): value is ProvenanceOutput { + if (!('data' in value) || value['data'] === undefined) return false; + return true; } export function ProvenanceOutputFromJSON(json: any): ProvenanceOutput { @@ -61,27 +61,29 @@ export function ProvenanceOutputFromJSON(json: any): ProvenanceOutput { } export function ProvenanceOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProvenanceOutput { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'data': DataIdFromJSON(json['data']), - 'provenance': !exists(json, 'provenance') ? undefined : (json['provenance'] === null ? null : (json['provenance'] as Array).map(ProvenanceFromJSON)), + 'provenance': json['provenance'] == null ? undefined : ((json['provenance'] as Array).map(ProvenanceFromJSON)), }; } -export function ProvenanceOutputToJSON(value?: ProvenanceOutput | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProvenanceOutputToJSON(json: any): ProvenanceOutput { + return ProvenanceOutputToJSONTyped(json, false); +} + +export function ProvenanceOutputToJSONTyped(value?: ProvenanceOutput | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'data': DataIdToJSON(value.data), - 'provenance': value.provenance === undefined ? undefined : (value.provenance === null ? null : (value.provenance as Array).map(ProvenanceToJSON)), + 'data': DataIdToJSON(value['data']), + 'provenance': value['provenance'] == null ? undefined : ((value['provenance'] as Array).map(ProvenanceToJSON)), }; } diff --git a/typescript/src/models/Provenances.ts b/typescript/src/models/Provenances.ts index 01d51f2b..4a6f329e 100644 --- a/typescript/src/models/Provenances.ts +++ b/typescript/src/models/Provenances.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Provenance } from './Provenance'; import { ProvenanceFromJSON, ProvenanceFromJSONTyped, ProvenanceToJSON, + ProvenanceToJSONTyped, } from './Provenance'; /** @@ -37,11 +38,9 @@ export interface Provenances { /** * Check if a given object implements the Provenances interface. */ -export function instanceOfProvenances(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "provenances" in value; - - return isInstance; +export function instanceOfProvenances(value: object): value is Provenances { + if (!('provenances' in value) || value['provenances'] === undefined) return false; + return true; } export function ProvenancesFromJSON(json: any): Provenances { @@ -49,7 +48,7 @@ export function ProvenancesFromJSON(json: any): Provenances { } export function ProvenancesFromJSONTyped(json: any, ignoreDiscriminator: boolean): Provenances { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function ProvenancesFromJSONTyped(json: any, ignoreDiscriminator: boolean }; } -export function ProvenancesToJSON(value?: Provenances | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProvenancesToJSON(json: any): Provenances { + return ProvenancesToJSONTyped(json, false); +} + +export function ProvenancesToJSONTyped(value?: Provenances | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'provenances': ((value.provenances as Array).map(ProvenanceToJSON)), + 'provenances': ((value['provenances'] as Array).map(ProvenanceToJSON)), }; } diff --git a/typescript/src/models/ProviderCapabilities.ts b/typescript/src/models/ProviderCapabilities.ts index 362e17f2..b0087088 100644 --- a/typescript/src/models/ProviderCapabilities.ts +++ b/typescript/src/models/ProviderCapabilities.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { SearchCapabilities } from './SearchCapabilities'; import { SearchCapabilitiesFromJSON, SearchCapabilitiesFromJSONTyped, SearchCapabilitiesToJSON, + SearchCapabilitiesToJSONTyped, } from './SearchCapabilities'; /** @@ -43,12 +44,10 @@ export interface ProviderCapabilities { /** * Check if a given object implements the ProviderCapabilities interface. */ -export function instanceOfProviderCapabilities(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "listing" in value; - isInstance = isInstance && "search" in value; - - return isInstance; +export function instanceOfProviderCapabilities(value: object): value is ProviderCapabilities { + if (!('listing' in value) || value['listing'] === undefined) return false; + if (!('search' in value) || value['search'] === undefined) return false; + return true; } export function ProviderCapabilitiesFromJSON(json: any): ProviderCapabilities { @@ -56,7 +55,7 @@ export function ProviderCapabilitiesFromJSON(json: any): ProviderCapabilities { } export function ProviderCapabilitiesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderCapabilities { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -66,17 +65,19 @@ export function ProviderCapabilitiesFromJSONTyped(json: any, ignoreDiscriminator }; } -export function ProviderCapabilitiesToJSON(value?: ProviderCapabilities | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProviderCapabilitiesToJSON(json: any): ProviderCapabilities { + return ProviderCapabilitiesToJSONTyped(json, false); +} + +export function ProviderCapabilitiesToJSONTyped(value?: ProviderCapabilities | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'listing': value.listing, - 'search': SearchCapabilitiesToJSON(value.search), + 'listing': value['listing'], + 'search': SearchCapabilitiesToJSON(value['search']), }; } diff --git a/typescript/src/models/ProviderLayerCollectionId.ts b/typescript/src/models/ProviderLayerCollectionId.ts index b5d36fbc..3a826f0d 100644 --- a/typescript/src/models/ProviderLayerCollectionId.ts +++ b/typescript/src/models/ProviderLayerCollectionId.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface ProviderLayerCollectionId { /** * Check if a given object implements the ProviderLayerCollectionId interface. */ -export function instanceOfProviderLayerCollectionId(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "collectionId" in value; - isInstance = isInstance && "providerId" in value; - - return isInstance; +export function instanceOfProviderLayerCollectionId(value: object): value is ProviderLayerCollectionId { + if (!('collectionId' in value) || value['collectionId'] === undefined) return false; + if (!('providerId' in value) || value['providerId'] === undefined) return false; + return true; } export function ProviderLayerCollectionIdFromJSON(json: any): ProviderLayerCollectionId { @@ -49,7 +47,7 @@ export function ProviderLayerCollectionIdFromJSON(json: any): ProviderLayerColle } export function ProviderLayerCollectionIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderLayerCollectionId { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function ProviderLayerCollectionIdFromJSONTyped(json: any, ignoreDiscrimi }; } -export function ProviderLayerCollectionIdToJSON(value?: ProviderLayerCollectionId | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProviderLayerCollectionIdToJSON(json: any): ProviderLayerCollectionId { + return ProviderLayerCollectionIdToJSONTyped(json, false); +} + +export function ProviderLayerCollectionIdToJSONTyped(value?: ProviderLayerCollectionId | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'collectionId': value.collectionId, - 'providerId': value.providerId, + 'collectionId': value['collectionId'], + 'providerId': value['providerId'], }; } diff --git a/typescript/src/models/ProviderLayerId.ts b/typescript/src/models/ProviderLayerId.ts index 69fcee0c..e5f2ec2d 100644 --- a/typescript/src/models/ProviderLayerId.ts +++ b/typescript/src/models/ProviderLayerId.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface ProviderLayerId { /** * Check if a given object implements the ProviderLayerId interface. */ -export function instanceOfProviderLayerId(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "layerId" in value; - isInstance = isInstance && "providerId" in value; - - return isInstance; +export function instanceOfProviderLayerId(value: object): value is ProviderLayerId { + if (!('layerId' in value) || value['layerId'] === undefined) return false; + if (!('providerId' in value) || value['providerId'] === undefined) return false; + return true; } export function ProviderLayerIdFromJSON(json: any): ProviderLayerId { @@ -49,7 +47,7 @@ export function ProviderLayerIdFromJSON(json: any): ProviderLayerId { } export function ProviderLayerIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderLayerId { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function ProviderLayerIdFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function ProviderLayerIdToJSON(value?: ProviderLayerId | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ProviderLayerIdToJSON(json: any): ProviderLayerId { + return ProviderLayerIdToJSONTyped(json, false); +} + +export function ProviderLayerIdToJSONTyped(value?: ProviderLayerId | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'layerId': value.layerId, - 'providerId': value.providerId, + 'layerId': value['layerId'], + 'providerId': value['providerId'], }; } diff --git a/typescript/src/models/Quota.ts b/typescript/src/models/Quota.ts index e2b2addc..8e2a0643 100644 --- a/typescript/src/models/Quota.ts +++ b/typescript/src/models/Quota.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface Quota { /** * Check if a given object implements the Quota interface. */ -export function instanceOfQuota(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "available" in value; - isInstance = isInstance && "used" in value; - - return isInstance; +export function instanceOfQuota(value: object): value is Quota { + if (!('available' in value) || value['available'] === undefined) return false; + if (!('used' in value) || value['used'] === undefined) return false; + return true; } export function QuotaFromJSON(json: any): Quota { @@ -49,7 +47,7 @@ export function QuotaFromJSON(json: any): Quota { } export function QuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): Quota { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function QuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): Quo }; } -export function QuotaToJSON(value?: Quota | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function QuotaToJSON(json: any): Quota { + return QuotaToJSONTyped(json, false); +} + +export function QuotaToJSONTyped(value?: Quota | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'available': value.available, - 'used': value.used, + 'available': value['available'], + 'used': value['used'], }; } diff --git a/typescript/src/models/RasterBandDescriptor.ts b/typescript/src/models/RasterBandDescriptor.ts index 3f75d3b9..35d062d0 100644 --- a/typescript/src/models/RasterBandDescriptor.ts +++ b/typescript/src/models/RasterBandDescriptor.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Measurement } from './Measurement'; import { MeasurementFromJSON, MeasurementFromJSONTyped, MeasurementToJSON, + MeasurementToJSONTyped, } from './Measurement'; /** @@ -43,12 +44,10 @@ export interface RasterBandDescriptor { /** * Check if a given object implements the RasterBandDescriptor interface. */ -export function instanceOfRasterBandDescriptor(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "measurement" in value; - isInstance = isInstance && "name" in value; - - return isInstance; +export function instanceOfRasterBandDescriptor(value: object): value is RasterBandDescriptor { + if (!('measurement' in value) || value['measurement'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + return true; } export function RasterBandDescriptorFromJSON(json: any): RasterBandDescriptor { @@ -56,7 +55,7 @@ export function RasterBandDescriptorFromJSON(json: any): RasterBandDescriptor { } export function RasterBandDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterBandDescriptor { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -66,17 +65,19 @@ export function RasterBandDescriptorFromJSONTyped(json: any, ignoreDiscriminator }; } -export function RasterBandDescriptorToJSON(value?: RasterBandDescriptor | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterBandDescriptorToJSON(json: any): RasterBandDescriptor { + return RasterBandDescriptorToJSONTyped(json, false); +} + +export function RasterBandDescriptorToJSONTyped(value?: RasterBandDescriptor | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'measurement': MeasurementToJSON(value.measurement), - 'name': value.name, + 'measurement': MeasurementToJSON(value['measurement']), + 'name': value['name'], }; } diff --git a/typescript/src/models/RasterColorizer.ts b/typescript/src/models/RasterColorizer.ts index f1d2e775..01cc3cdb 100644 --- a/typescript/src/models/RasterColorizer.ts +++ b/typescript/src/models/RasterColorizer.ts @@ -12,15 +12,15 @@ * Do not edit the class manually. */ +import type { MultiBandRasterColorizer } from './MultiBandRasterColorizer'; import { - MultiBandRasterColorizer, instanceOfMultiBandRasterColorizer, MultiBandRasterColorizerFromJSON, MultiBandRasterColorizerFromJSONTyped, MultiBandRasterColorizerToJSON, } from './MultiBandRasterColorizer'; +import type { SingleBandRasterColorizer } from './SingleBandRasterColorizer'; import { - SingleBandRasterColorizer, instanceOfSingleBandRasterColorizer, SingleBandRasterColorizerFromJSON, SingleBandRasterColorizerFromJSONTyped, @@ -39,31 +39,32 @@ export function RasterColorizerFromJSON(json: any): RasterColorizer { } export function RasterColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterColorizer { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'multiBand': - return {...MultiBandRasterColorizerFromJSONTyped(json, true), type: 'multiBand'}; + return Object.assign({}, MultiBandRasterColorizerFromJSONTyped(json, true), { type: 'multiBand' } as const); case 'singleBand': - return {...SingleBandRasterColorizerFromJSONTyped(json, true), type: 'singleBand'}; + return Object.assign({}, SingleBandRasterColorizerFromJSONTyped(json, true), { type: 'singleBand' } as const); default: throw new Error(`No variant of RasterColorizer exists with 'type=${json['type']}'`); } } -export function RasterColorizerToJSON(value?: RasterColorizer | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterColorizerToJSON(json: any): any { + return RasterColorizerToJSONTyped(json, false); +} + +export function RasterColorizerToJSONTyped(value?: RasterColorizer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'multiBand': - return MultiBandRasterColorizerToJSON(value); + return Object.assign({}, MultiBandRasterColorizerToJSON(value), { type: 'multiBand' } as const); case 'singleBand': - return SingleBandRasterColorizerToJSON(value); + return Object.assign({}, SingleBandRasterColorizerToJSON(value), { type: 'singleBand' } as const); default: throw new Error(`No variant of RasterColorizer exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/RasterDataType.ts b/typescript/src/models/RasterDataType.ts index 0df20448..fa75f7e3 100644 --- a/typescript/src/models/RasterDataType.ts +++ b/typescript/src/models/RasterDataType.ts @@ -32,6 +32,17 @@ export const RasterDataType = { export type RasterDataType = typeof RasterDataType[keyof typeof RasterDataType]; +export function instanceOfRasterDataType(value: any): boolean { + for (const key in RasterDataType) { + if (Object.prototype.hasOwnProperty.call(RasterDataType, key)) { + if (RasterDataType[key as keyof typeof RasterDataType] === value) { + return true; + } + } + } + return false; +} + export function RasterDataTypeFromJSON(json: any): RasterDataType { return RasterDataTypeFromJSONTyped(json, false); } @@ -44,3 +55,7 @@ export function RasterDataTypeToJSON(value?: RasterDataType | null): any { return value as any; } +export function RasterDataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): RasterDataType { + return value as RasterDataType; +} + diff --git a/typescript/src/models/RasterDatasetFromWorkflow.ts b/typescript/src/models/RasterDatasetFromWorkflow.ts index 59e8d69a..5b492fb7 100644 --- a/typescript/src/models/RasterDatasetFromWorkflow.ts +++ b/typescript/src/models/RasterDatasetFromWorkflow.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { RasterQueryRectangle } from './RasterQueryRectangle'; import { RasterQueryRectangleFromJSON, RasterQueryRectangleFromJSONTyped, RasterQueryRectangleToJSON, + RasterQueryRectangleToJSONTyped, } from './RasterQueryRectangle'; /** @@ -61,12 +62,10 @@ export interface RasterDatasetFromWorkflow { /** * Check if a given object implements the RasterDatasetFromWorkflow interface. */ -export function instanceOfRasterDatasetFromWorkflow(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "query" in value; - - return isInstance; +export function instanceOfRasterDatasetFromWorkflow(value: object): value is RasterDatasetFromWorkflow { + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('query' in value) || value['query'] === undefined) return false; + return true; } export function RasterDatasetFromWorkflowFromJSON(json: any): RasterDatasetFromWorkflow { @@ -74,33 +73,35 @@ export function RasterDatasetFromWorkflowFromJSON(json: any): RasterDatasetFromW } export function RasterDatasetFromWorkflowFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterDatasetFromWorkflow { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'asCog': !exists(json, 'asCog') ? undefined : json['asCog'], - 'description': !exists(json, 'description') ? undefined : json['description'], + 'asCog': json['asCog'] == null ? undefined : json['asCog'], + 'description': json['description'] == null ? undefined : json['description'], 'displayName': json['displayName'], - 'name': !exists(json, 'name') ? undefined : json['name'], + 'name': json['name'] == null ? undefined : json['name'], 'query': RasterQueryRectangleFromJSON(json['query']), }; } -export function RasterDatasetFromWorkflowToJSON(value?: RasterDatasetFromWorkflow | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterDatasetFromWorkflowToJSON(json: any): RasterDatasetFromWorkflow { + return RasterDatasetFromWorkflowToJSONTyped(json, false); +} + +export function RasterDatasetFromWorkflowToJSONTyped(value?: RasterDatasetFromWorkflow | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'asCog': value.asCog, - 'description': value.description, - 'displayName': value.displayName, - 'name': value.name, - 'query': RasterQueryRectangleToJSON(value.query), + 'asCog': value['asCog'], + 'description': value['description'], + 'displayName': value['displayName'], + 'name': value['name'], + 'query': RasterQueryRectangleToJSON(value['query']), }; } diff --git a/typescript/src/models/RasterDatasetFromWorkflowResult.ts b/typescript/src/models/RasterDatasetFromWorkflowResult.ts index 2bfac7a6..b151792e 100644 --- a/typescript/src/models/RasterDatasetFromWorkflowResult.ts +++ b/typescript/src/models/RasterDatasetFromWorkflowResult.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * response of the dataset from workflow handler * @export @@ -36,12 +36,10 @@ export interface RasterDatasetFromWorkflowResult { /** * Check if a given object implements the RasterDatasetFromWorkflowResult interface. */ -export function instanceOfRasterDatasetFromWorkflowResult(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "dataset" in value; - isInstance = isInstance && "upload" in value; - - return isInstance; +export function instanceOfRasterDatasetFromWorkflowResult(value: object): value is RasterDatasetFromWorkflowResult { + if (!('dataset' in value) || value['dataset'] === undefined) return false; + if (!('upload' in value) || value['upload'] === undefined) return false; + return true; } export function RasterDatasetFromWorkflowResultFromJSON(json: any): RasterDatasetFromWorkflowResult { @@ -49,7 +47,7 @@ export function RasterDatasetFromWorkflowResultFromJSON(json: any): RasterDatase } export function RasterDatasetFromWorkflowResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterDatasetFromWorkflowResult { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function RasterDatasetFromWorkflowResultFromJSONTyped(json: any, ignoreDi }; } -export function RasterDatasetFromWorkflowResultToJSON(value?: RasterDatasetFromWorkflowResult | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterDatasetFromWorkflowResultToJSON(json: any): RasterDatasetFromWorkflowResult { + return RasterDatasetFromWorkflowResultToJSONTyped(json, false); +} + +export function RasterDatasetFromWorkflowResultToJSONTyped(value?: RasterDatasetFromWorkflowResult | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'dataset': value.dataset, - 'upload': value.upload, + 'dataset': value['dataset'], + 'upload': value['upload'], }; } diff --git a/typescript/src/models/RasterPropertiesEntryType.ts b/typescript/src/models/RasterPropertiesEntryType.ts index 70fda690..5299a06d 100644 --- a/typescript/src/models/RasterPropertiesEntryType.ts +++ b/typescript/src/models/RasterPropertiesEntryType.ts @@ -24,6 +24,17 @@ export const RasterPropertiesEntryType = { export type RasterPropertiesEntryType = typeof RasterPropertiesEntryType[keyof typeof RasterPropertiesEntryType]; +export function instanceOfRasterPropertiesEntryType(value: any): boolean { + for (const key in RasterPropertiesEntryType) { + if (Object.prototype.hasOwnProperty.call(RasterPropertiesEntryType, key)) { + if (RasterPropertiesEntryType[key as keyof typeof RasterPropertiesEntryType] === value) { + return true; + } + } + } + return false; +} + export function RasterPropertiesEntryTypeFromJSON(json: any): RasterPropertiesEntryType { return RasterPropertiesEntryTypeFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function RasterPropertiesEntryTypeToJSON(value?: RasterPropertiesEntryTyp return value as any; } +export function RasterPropertiesEntryTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): RasterPropertiesEntryType { + return value as RasterPropertiesEntryType; +} + diff --git a/typescript/src/models/RasterPropertiesKey.ts b/typescript/src/models/RasterPropertiesKey.ts index c8ecd8c1..edacc728 100644 --- a/typescript/src/models/RasterPropertiesKey.ts +++ b/typescript/src/models/RasterPropertiesKey.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,11 +36,9 @@ export interface RasterPropertiesKey { /** * Check if a given object implements the RasterPropertiesKey interface. */ -export function instanceOfRasterPropertiesKey(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "key" in value; - - return isInstance; +export function instanceOfRasterPropertiesKey(value: object): value is RasterPropertiesKey { + if (!('key' in value) || value['key'] === undefined) return false; + return true; } export function RasterPropertiesKeyFromJSON(json: any): RasterPropertiesKey { @@ -48,27 +46,29 @@ export function RasterPropertiesKeyFromJSON(json: any): RasterPropertiesKey { } export function RasterPropertiesKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterPropertiesKey { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'domain': !exists(json, 'domain') ? undefined : json['domain'], + 'domain': json['domain'] == null ? undefined : json['domain'], 'key': json['key'], }; } -export function RasterPropertiesKeyToJSON(value?: RasterPropertiesKey | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterPropertiesKeyToJSON(json: any): RasterPropertiesKey { + return RasterPropertiesKeyToJSONTyped(json, false); +} + +export function RasterPropertiesKeyToJSONTyped(value?: RasterPropertiesKey | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'domain': value.domain, - 'key': value.key, + 'domain': value['domain'], + 'key': value['key'], }; } diff --git a/typescript/src/models/RasterQueryRectangle.ts b/typescript/src/models/RasterQueryRectangle.ts index 585e803f..39728af0 100644 --- a/typescript/src/models/RasterQueryRectangle.ts +++ b/typescript/src/models/RasterQueryRectangle.ts @@ -12,25 +12,28 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { SpatialPartition2D } from './SpatialPartition2D'; -import { - SpatialPartition2DFromJSON, - SpatialPartition2DFromJSONTyped, - SpatialPartition2DToJSON, -} from './SpatialPartition2D'; +import { mapValues } from '../runtime'; import type { SpatialResolution } from './SpatialResolution'; import { SpatialResolutionFromJSON, SpatialResolutionFromJSONTyped, SpatialResolutionToJSON, + SpatialResolutionToJSONTyped, } from './SpatialResolution'; import type { TimeInterval } from './TimeInterval'; import { TimeIntervalFromJSON, TimeIntervalFromJSONTyped, TimeIntervalToJSON, + TimeIntervalToJSONTyped, } from './TimeInterval'; +import type { SpatialPartition2D } from './SpatialPartition2D'; +import { + SpatialPartition2DFromJSON, + SpatialPartition2DFromJSONTyped, + SpatialPartition2DToJSON, + SpatialPartition2DToJSONTyped, +} from './SpatialPartition2D'; /** * A spatio-temporal rectangle with a specified resolution @@ -61,13 +64,11 @@ export interface RasterQueryRectangle { /** * Check if a given object implements the RasterQueryRectangle interface. */ -export function instanceOfRasterQueryRectangle(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "spatialBounds" in value; - isInstance = isInstance && "spatialResolution" in value; - isInstance = isInstance && "timeInterval" in value; - - return isInstance; +export function instanceOfRasterQueryRectangle(value: object): value is RasterQueryRectangle { + if (!('spatialBounds' in value) || value['spatialBounds'] === undefined) return false; + if (!('spatialResolution' in value) || value['spatialResolution'] === undefined) return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) return false; + return true; } export function RasterQueryRectangleFromJSON(json: any): RasterQueryRectangle { @@ -75,7 +76,7 @@ export function RasterQueryRectangleFromJSON(json: any): RasterQueryRectangle { } export function RasterQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterQueryRectangle { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -86,18 +87,20 @@ export function RasterQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator }; } -export function RasterQueryRectangleToJSON(value?: RasterQueryRectangle | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterQueryRectangleToJSON(json: any): RasterQueryRectangle { + return RasterQueryRectangleToJSONTyped(json, false); +} + +export function RasterQueryRectangleToJSONTyped(value?: RasterQueryRectangle | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'spatialBounds': SpatialPartition2DToJSON(value.spatialBounds), - 'spatialResolution': SpatialResolutionToJSON(value.spatialResolution), - 'timeInterval': TimeIntervalToJSON(value.timeInterval), + 'spatialBounds': SpatialPartition2DToJSON(value['spatialBounds']), + 'spatialResolution': SpatialResolutionToJSON(value['spatialResolution']), + 'timeInterval': TimeIntervalToJSON(value['timeInterval']), }; } diff --git a/typescript/src/models/RasterResultDescriptor.ts b/typescript/src/models/RasterResultDescriptor.ts index b44a9de2..cae54dd2 100644 --- a/typescript/src/models/RasterResultDescriptor.ts +++ b/typescript/src/models/RasterResultDescriptor.ts @@ -12,37 +12,42 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; +import type { SpatialResolution } from './SpatialResolution'; +import { + SpatialResolutionFromJSON, + SpatialResolutionFromJSONTyped, + SpatialResolutionToJSON, + SpatialResolutionToJSONTyped, +} from './SpatialResolution'; +import type { TimeInterval } from './TimeInterval'; +import { + TimeIntervalFromJSON, + TimeIntervalFromJSONTyped, + TimeIntervalToJSON, + TimeIntervalToJSONTyped, +} from './TimeInterval'; import type { RasterBandDescriptor } from './RasterBandDescriptor'; import { RasterBandDescriptorFromJSON, RasterBandDescriptorFromJSONTyped, RasterBandDescriptorToJSON, + RasterBandDescriptorToJSONTyped, } from './RasterBandDescriptor'; import type { RasterDataType } from './RasterDataType'; import { RasterDataTypeFromJSON, RasterDataTypeFromJSONTyped, RasterDataTypeToJSON, + RasterDataTypeToJSONTyped, } from './RasterDataType'; import type { SpatialPartition2D } from './SpatialPartition2D'; import { SpatialPartition2DFromJSON, SpatialPartition2DFromJSONTyped, SpatialPartition2DToJSON, + SpatialPartition2DToJSONTyped, } from './SpatialPartition2D'; -import type { SpatialResolution } from './SpatialResolution'; -import { - SpatialResolutionFromJSON, - SpatialResolutionFromJSONTyped, - SpatialResolutionToJSON, -} from './SpatialResolution'; -import type { TimeInterval } from './TimeInterval'; -import { - TimeIntervalFromJSON, - TimeIntervalFromJSONTyped, - TimeIntervalToJSON, -} from './TimeInterval'; /** * A `ResultDescriptor` for raster queries @@ -88,16 +93,16 @@ export interface RasterResultDescriptor { time?: TimeInterval | null; } + + /** * Check if a given object implements the RasterResultDescriptor interface. */ -export function instanceOfRasterResultDescriptor(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "bands" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - - return isInstance; +export function instanceOfRasterResultDescriptor(value: object): value is RasterResultDescriptor { + if (!('bands' in value) || value['bands'] === undefined) return false; + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) return false; + return true; } export function RasterResultDescriptorFromJSON(json: any): RasterResultDescriptor { @@ -105,35 +110,37 @@ export function RasterResultDescriptorFromJSON(json: any): RasterResultDescripto } export function RasterResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterResultDescriptor { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bands': ((json['bands'] as Array).map(RasterBandDescriptorFromJSON)), - 'bbox': !exists(json, 'bbox') ? undefined : SpatialPartition2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : SpatialPartition2DFromJSON(json['bbox']), 'dataType': RasterDataTypeFromJSON(json['dataType']), - 'resolution': !exists(json, 'resolution') ? undefined : SpatialResolutionFromJSON(json['resolution']), + 'resolution': json['resolution'] == null ? undefined : SpatialResolutionFromJSON(json['resolution']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), }; } -export function RasterResultDescriptorToJSON(value?: RasterResultDescriptor | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterResultDescriptorToJSON(json: any): RasterResultDescriptor { + return RasterResultDescriptorToJSONTyped(json, false); +} + +export function RasterResultDescriptorToJSONTyped(value?: RasterResultDescriptor | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bands': ((value.bands as Array).map(RasterBandDescriptorToJSON)), - 'bbox': SpatialPartition2DToJSON(value.bbox), - 'dataType': RasterDataTypeToJSON(value.dataType), - 'resolution': SpatialResolutionToJSON(value.resolution), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), + 'bands': ((value['bands'] as Array).map(RasterBandDescriptorToJSON)), + 'bbox': SpatialPartition2DToJSON(value['bbox']), + 'dataType': RasterDataTypeToJSON(value['dataType']), + 'resolution': SpatialResolutionToJSON(value['resolution']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), }; } diff --git a/typescript/src/models/RasterStreamWebsocketResultType.ts b/typescript/src/models/RasterStreamWebsocketResultType.ts index 61830f90..f1604b32 100644 --- a/typescript/src/models/RasterStreamWebsocketResultType.ts +++ b/typescript/src/models/RasterStreamWebsocketResultType.ts @@ -23,6 +23,17 @@ export const RasterStreamWebsocketResultType = { export type RasterStreamWebsocketResultType = typeof RasterStreamWebsocketResultType[keyof typeof RasterStreamWebsocketResultType]; +export function instanceOfRasterStreamWebsocketResultType(value: any): boolean { + for (const key in RasterStreamWebsocketResultType) { + if (Object.prototype.hasOwnProperty.call(RasterStreamWebsocketResultType, key)) { + if (RasterStreamWebsocketResultType[key as keyof typeof RasterStreamWebsocketResultType] === value) { + return true; + } + } + } + return false; +} + export function RasterStreamWebsocketResultTypeFromJSON(json: any): RasterStreamWebsocketResultType { return RasterStreamWebsocketResultTypeFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function RasterStreamWebsocketResultTypeToJSON(value?: RasterStreamWebsoc return value as any; } +export function RasterStreamWebsocketResultTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): RasterStreamWebsocketResultType { + return value as RasterStreamWebsocketResultType; +} + diff --git a/typescript/src/models/RasterSymbology.ts b/typescript/src/models/RasterSymbology.ts index 0531b329..92d464ae 100644 --- a/typescript/src/models/RasterSymbology.ts +++ b/typescript/src/models/RasterSymbology.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { RasterColorizer } from './RasterColorizer'; import { RasterColorizerFromJSON, RasterColorizerFromJSONTyped, RasterColorizerToJSON, + RasterColorizerToJSONTyped, } from './RasterColorizer'; /** @@ -59,13 +60,11 @@ export type RasterSymbologyTypeEnum = typeof RasterSymbologyTypeEnum[keyof typeo /** * Check if a given object implements the RasterSymbology interface. */ -export function instanceOfRasterSymbology(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "opacity" in value; - isInstance = isInstance && "rasterColorizer" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfRasterSymbology(value: object): value is RasterSymbology { + if (!('opacity' in value) || value['opacity'] === undefined) return false; + if (!('rasterColorizer' in value) || value['rasterColorizer'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function RasterSymbologyFromJSON(json: any): RasterSymbology { @@ -73,7 +72,7 @@ export function RasterSymbologyFromJSON(json: any): RasterSymbology { } export function RasterSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): RasterSymbology { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -84,18 +83,20 @@ export function RasterSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function RasterSymbologyToJSON(value?: RasterSymbology | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RasterSymbologyToJSON(json: any): RasterSymbology { + return RasterSymbologyToJSONTyped(json, false); +} + +export function RasterSymbologyToJSONTyped(value?: RasterSymbology | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'opacity': value.opacity, - 'rasterColorizer': RasterColorizerToJSON(value.rasterColorizer), - 'type': value.type, + 'opacity': value['opacity'], + 'rasterColorizer': RasterColorizerToJSON(value['rasterColorizer']), + 'type': value['type'], }; } diff --git a/typescript/src/models/Resource.ts b/typescript/src/models/Resource.ts index 37aaafb6..db2e5c72 100644 --- a/typescript/src/models/Resource.ts +++ b/typescript/src/models/Resource.ts @@ -12,36 +12,36 @@ * Do not edit the class manually. */ +import type { DatasetResource } from './DatasetResource'; import { - DatasetResource, instanceOfDatasetResource, DatasetResourceFromJSON, DatasetResourceFromJSONTyped, DatasetResourceToJSON, } from './DatasetResource'; +import type { LayerCollectionResource } from './LayerCollectionResource'; import { - LayerCollectionResource, instanceOfLayerCollectionResource, LayerCollectionResourceFromJSON, LayerCollectionResourceFromJSONTyped, LayerCollectionResourceToJSON, } from './LayerCollectionResource'; +import type { LayerResource } from './LayerResource'; import { - LayerResource, instanceOfLayerResource, LayerResourceFromJSON, LayerResourceFromJSONTyped, LayerResourceToJSON, } from './LayerResource'; +import type { MlModelResource } from './MlModelResource'; import { - MlModelResource, instanceOfMlModelResource, MlModelResourceFromJSON, MlModelResourceFromJSONTyped, MlModelResourceToJSON, } from './MlModelResource'; +import type { ProjectResource } from './ProjectResource'; import { - ProjectResource, instanceOfProjectResource, ProjectResourceFromJSON, ProjectResourceFromJSONTyped, @@ -60,43 +60,44 @@ export function ResourceFromJSON(json: any): Resource { } export function ResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Resource { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'dataset': - return {...DatasetResourceFromJSONTyped(json, true), type: 'dataset'}; + return Object.assign({}, DatasetResourceFromJSONTyped(json, true), { type: 'dataset' } as const); case 'layer': - return {...LayerResourceFromJSONTyped(json, true), type: 'layer'}; + return Object.assign({}, LayerResourceFromJSONTyped(json, true), { type: 'layer' } as const); case 'layerCollection': - return {...LayerCollectionResourceFromJSONTyped(json, true), type: 'layerCollection'}; + return Object.assign({}, LayerCollectionResourceFromJSONTyped(json, true), { type: 'layerCollection' } as const); case 'mlModel': - return {...MlModelResourceFromJSONTyped(json, true), type: 'mlModel'}; + return Object.assign({}, MlModelResourceFromJSONTyped(json, true), { type: 'mlModel' } as const); case 'project': - return {...ProjectResourceFromJSONTyped(json, true), type: 'project'}; + return Object.assign({}, ProjectResourceFromJSONTyped(json, true), { type: 'project' } as const); default: throw new Error(`No variant of Resource exists with 'type=${json['type']}'`); } } -export function ResourceToJSON(value?: Resource | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceToJSON(json: any): any { + return ResourceToJSONTyped(json, false); +} + +export function ResourceToJSONTyped(value?: Resource | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'dataset': - return DatasetResourceToJSON(value); + return Object.assign({}, DatasetResourceToJSON(value), { type: 'dataset' } as const); case 'layer': - return LayerResourceToJSON(value); + return Object.assign({}, LayerResourceToJSON(value), { type: 'layer' } as const); case 'layerCollection': - return LayerCollectionResourceToJSON(value); + return Object.assign({}, LayerCollectionResourceToJSON(value), { type: 'layerCollection' } as const); case 'mlModel': - return MlModelResourceToJSON(value); + return Object.assign({}, MlModelResourceToJSON(value), { type: 'mlModel' } as const); case 'project': - return ProjectResourceToJSON(value); + return Object.assign({}, ProjectResourceToJSON(value), { type: 'project' } as const); default: throw new Error(`No variant of Resource exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/ResourceId.ts b/typescript/src/models/ResourceId.ts index af317b3d..bafea98f 100644 --- a/typescript/src/models/ResourceId.ts +++ b/typescript/src/models/ResourceId.ts @@ -12,36 +12,36 @@ * Do not edit the class manually. */ +import type { ResourceIdDatasetId } from './ResourceIdDatasetId'; import { - ResourceIdDatasetId, instanceOfResourceIdDatasetId, ResourceIdDatasetIdFromJSON, ResourceIdDatasetIdFromJSONTyped, ResourceIdDatasetIdToJSON, } from './ResourceIdDatasetId'; +import type { ResourceIdLayer } from './ResourceIdLayer'; import { - ResourceIdLayer, instanceOfResourceIdLayer, ResourceIdLayerFromJSON, ResourceIdLayerFromJSONTyped, ResourceIdLayerToJSON, } from './ResourceIdLayer'; +import type { ResourceIdLayerCollection } from './ResourceIdLayerCollection'; import { - ResourceIdLayerCollection, instanceOfResourceIdLayerCollection, ResourceIdLayerCollectionFromJSON, ResourceIdLayerCollectionFromJSONTyped, ResourceIdLayerCollectionToJSON, } from './ResourceIdLayerCollection'; +import type { ResourceIdMlModel } from './ResourceIdMlModel'; import { - ResourceIdMlModel, instanceOfResourceIdMlModel, ResourceIdMlModelFromJSON, ResourceIdMlModelFromJSONTyped, ResourceIdMlModelToJSON, } from './ResourceIdMlModel'; +import type { ResourceIdProject } from './ResourceIdProject'; import { - ResourceIdProject, instanceOfResourceIdProject, ResourceIdProjectFromJSON, ResourceIdProjectFromJSONTyped, @@ -60,43 +60,44 @@ export function ResourceIdFromJSON(json: any): ResourceId { } export function ResourceIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceId { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'DatasetId': - return {...ResourceIdDatasetIdFromJSONTyped(json, true), type: 'DatasetId'}; + return Object.assign({}, ResourceIdDatasetIdFromJSONTyped(json, true), { type: 'DatasetId' } as const); case 'Layer': - return {...ResourceIdLayerFromJSONTyped(json, true), type: 'Layer'}; + return Object.assign({}, ResourceIdLayerFromJSONTyped(json, true), { type: 'Layer' } as const); case 'LayerCollection': - return {...ResourceIdLayerCollectionFromJSONTyped(json, true), type: 'LayerCollection'}; + return Object.assign({}, ResourceIdLayerCollectionFromJSONTyped(json, true), { type: 'LayerCollection' } as const); case 'MlModel': - return {...ResourceIdMlModelFromJSONTyped(json, true), type: 'MlModel'}; + return Object.assign({}, ResourceIdMlModelFromJSONTyped(json, true), { type: 'MlModel' } as const); case 'Project': - return {...ResourceIdProjectFromJSONTyped(json, true), type: 'Project'}; + return Object.assign({}, ResourceIdProjectFromJSONTyped(json, true), { type: 'Project' } as const); default: throw new Error(`No variant of ResourceId exists with 'type=${json['type']}'`); } } -export function ResourceIdToJSON(value?: ResourceId | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdToJSON(json: any): any { + return ResourceIdToJSONTyped(json, false); +} + +export function ResourceIdToJSONTyped(value?: ResourceId | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'DatasetId': - return ResourceIdDatasetIdToJSON(value); + return Object.assign({}, ResourceIdDatasetIdToJSON(value), { type: 'DatasetId' } as const); case 'Layer': - return ResourceIdLayerToJSON(value); + return Object.assign({}, ResourceIdLayerToJSON(value), { type: 'Layer' } as const); case 'LayerCollection': - return ResourceIdLayerCollectionToJSON(value); + return Object.assign({}, ResourceIdLayerCollectionToJSON(value), { type: 'LayerCollection' } as const); case 'MlModel': - return ResourceIdMlModelToJSON(value); + return Object.assign({}, ResourceIdMlModelToJSON(value), { type: 'MlModel' } as const); case 'Project': - return ResourceIdProjectToJSON(value); + return Object.assign({}, ResourceIdProjectToJSON(value), { type: 'Project' } as const); default: throw new Error(`No variant of ResourceId exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/ResourceIdDatasetId.ts b/typescript/src/models/ResourceIdDatasetId.ts index 53efd56b..3dc81595 100644 --- a/typescript/src/models/ResourceIdDatasetId.ts +++ b/typescript/src/models/ResourceIdDatasetId.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type ResourceIdDatasetIdTypeEnum = typeof ResourceIdDatasetIdTypeEnum[key /** * Check if a given object implements the ResourceIdDatasetId interface. */ -export function instanceOfResourceIdDatasetId(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfResourceIdDatasetId(value: object): value is ResourceIdDatasetId { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function ResourceIdDatasetIdFromJSON(json: any): ResourceIdDatasetId { @@ -59,7 +57,7 @@ export function ResourceIdDatasetIdFromJSON(json: any): ResourceIdDatasetId { } export function ResourceIdDatasetIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdDatasetId { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function ResourceIdDatasetIdFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function ResourceIdDatasetIdToJSON(value?: ResourceIdDatasetId | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdDatasetIdToJSON(json: any): ResourceIdDatasetId { + return ResourceIdDatasetIdToJSONTyped(json, false); +} + +export function ResourceIdDatasetIdToJSONTyped(value?: ResourceIdDatasetId | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/src/models/ResourceIdLayer.ts b/typescript/src/models/ResourceIdLayer.ts index 01424df5..bab28649 100644 --- a/typescript/src/models/ResourceIdLayer.ts +++ b/typescript/src/models/ResourceIdLayer.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -38,11 +38,7 @@ export interface ResourceIdLayer { * @export */ export const ResourceIdLayerTypeEnum = { - Layer: 'Layer', - LayerCollection: 'LayerCollection', - Project: 'Project', - DatasetId: 'DatasetId', - MlModel: 'MlModel' + Layer: 'Layer' } as const; export type ResourceIdLayerTypeEnum = typeof ResourceIdLayerTypeEnum[keyof typeof ResourceIdLayerTypeEnum]; @@ -50,12 +46,10 @@ export type ResourceIdLayerTypeEnum = typeof ResourceIdLayerTypeEnum[keyof typeo /** * Check if a given object implements the ResourceIdLayer interface. */ -export function instanceOfResourceIdLayer(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfResourceIdLayer(value: object): value is ResourceIdLayer { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function ResourceIdLayerFromJSON(json: any): ResourceIdLayer { @@ -63,7 +57,7 @@ export function ResourceIdLayerFromJSON(json: any): ResourceIdLayer { } export function ResourceIdLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdLayer { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -73,17 +67,19 @@ export function ResourceIdLayerFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function ResourceIdLayerToJSON(value?: ResourceIdLayer | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdLayerToJSON(json: any): ResourceIdLayer { + return ResourceIdLayerToJSONTyped(json, false); +} + +export function ResourceIdLayerToJSONTyped(value?: ResourceIdLayer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/src/models/ResourceIdLayerCollection.ts b/typescript/src/models/ResourceIdLayerCollection.ts index 455dc86a..9c4df428 100644 --- a/typescript/src/models/ResourceIdLayerCollection.ts +++ b/typescript/src/models/ResourceIdLayerCollection.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type ResourceIdLayerCollectionTypeEnum = typeof ResourceIdLayerCollection /** * Check if a given object implements the ResourceIdLayerCollection interface. */ -export function instanceOfResourceIdLayerCollection(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfResourceIdLayerCollection(value: object): value is ResourceIdLayerCollection { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function ResourceIdLayerCollectionFromJSON(json: any): ResourceIdLayerCollection { @@ -59,7 +57,7 @@ export function ResourceIdLayerCollectionFromJSON(json: any): ResourceIdLayerCol } export function ResourceIdLayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdLayerCollection { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function ResourceIdLayerCollectionFromJSONTyped(json: any, ignoreDiscrimi }; } -export function ResourceIdLayerCollectionToJSON(value?: ResourceIdLayerCollection | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdLayerCollectionToJSON(json: any): ResourceIdLayerCollection { + return ResourceIdLayerCollectionToJSONTyped(json, false); +} + +export function ResourceIdLayerCollectionToJSONTyped(value?: ResourceIdLayerCollection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/src/models/ResourceIdMlModel.ts b/typescript/src/models/ResourceIdMlModel.ts index 09822686..31a4206e 100644 --- a/typescript/src/models/ResourceIdMlModel.ts +++ b/typescript/src/models/ResourceIdMlModel.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type ResourceIdMlModelTypeEnum = typeof ResourceIdMlModelTypeEnum[keyof t /** * Check if a given object implements the ResourceIdMlModel interface. */ -export function instanceOfResourceIdMlModel(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfResourceIdMlModel(value: object): value is ResourceIdMlModel { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function ResourceIdMlModelFromJSON(json: any): ResourceIdMlModel { @@ -59,7 +57,7 @@ export function ResourceIdMlModelFromJSON(json: any): ResourceIdMlModel { } export function ResourceIdMlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdMlModel { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function ResourceIdMlModelFromJSONTyped(json: any, ignoreDiscriminator: b }; } -export function ResourceIdMlModelToJSON(value?: ResourceIdMlModel | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdMlModelToJSON(json: any): ResourceIdMlModel { + return ResourceIdMlModelToJSONTyped(json, false); +} + +export function ResourceIdMlModelToJSONTyped(value?: ResourceIdMlModel | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/src/models/ResourceIdProject.ts b/typescript/src/models/ResourceIdProject.ts index 721e6f45..402c2bff 100644 --- a/typescript/src/models/ResourceIdProject.ts +++ b/typescript/src/models/ResourceIdProject.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type ResourceIdProjectTypeEnum = typeof ResourceIdProjectTypeEnum[keyof t /** * Check if a given object implements the ResourceIdProject interface. */ -export function instanceOfResourceIdProject(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfResourceIdProject(value: object): value is ResourceIdProject { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function ResourceIdProjectFromJSON(json: any): ResourceIdProject { @@ -59,7 +57,7 @@ export function ResourceIdProjectFromJSON(json: any): ResourceIdProject { } export function ResourceIdProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdProject { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function ResourceIdProjectFromJSONTyped(json: any, ignoreDiscriminator: b }; } -export function ResourceIdProjectToJSON(value?: ResourceIdProject | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ResourceIdProjectToJSON(json: any): ResourceIdProject { + return ResourceIdProjectToJSONTyped(json, false); +} + +export function ResourceIdProjectToJSONTyped(value?: ResourceIdProject | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, - 'type': value.type, + 'id': value['id'], + 'type': value['type'], }; } diff --git a/typescript/src/models/Role.ts b/typescript/src/models/Role.ts index fce27b71..7277b040 100644 --- a/typescript/src/models/Role.ts +++ b/typescript/src/models/Role.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface Role { /** * Check if a given object implements the Role interface. */ -export function instanceOfRole(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "name" in value; - - return isInstance; +export function instanceOfRole(value: object): value is Role { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + return true; } export function RoleFromJSON(json: any): Role { @@ -49,7 +47,7 @@ export function RoleFromJSON(json: any): Role { } export function RoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Role { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function RoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Role }; } -export function RoleToJSON(value?: Role | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RoleToJSON(json: any): Role { + return RoleToJSONTyped(json, false); +} + +export function RoleToJSONTyped(value?: Role | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'id': value.id, - 'name': value.name, + 'id': value['id'], + 'name': value['name'], }; } diff --git a/typescript/src/models/RoleDescription.ts b/typescript/src/models/RoleDescription.ts index 2e9c0f27..6d5655fd 100644 --- a/typescript/src/models/RoleDescription.ts +++ b/typescript/src/models/RoleDescription.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Role } from './Role'; import { RoleFromJSON, RoleFromJSONTyped, RoleToJSON, + RoleToJSONTyped, } from './Role'; /** @@ -43,12 +44,10 @@ export interface RoleDescription { /** * Check if a given object implements the RoleDescription interface. */ -export function instanceOfRoleDescription(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "individual" in value; - isInstance = isInstance && "role" in value; - - return isInstance; +export function instanceOfRoleDescription(value: object): value is RoleDescription { + if (!('individual' in value) || value['individual'] === undefined) return false; + if (!('role' in value) || value['role'] === undefined) return false; + return true; } export function RoleDescriptionFromJSON(json: any): RoleDescription { @@ -56,7 +55,7 @@ export function RoleDescriptionFromJSON(json: any): RoleDescription { } export function RoleDescriptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): RoleDescription { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -66,17 +65,19 @@ export function RoleDescriptionFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function RoleDescriptionToJSON(value?: RoleDescription | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function RoleDescriptionToJSON(json: any): RoleDescription { + return RoleDescriptionToJSONTyped(json, false); +} + +export function RoleDescriptionToJSONTyped(value?: RoleDescription | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'individual': value.individual, - 'role': RoleToJSON(value.role), + 'individual': value['individual'], + 'role': RoleToJSON(value['role']), }; } diff --git a/typescript/src/models/STRectangle.ts b/typescript/src/models/STRectangle.ts index ee8bc76d..2eb4d463 100644 --- a/typescript/src/models/STRectangle.ts +++ b/typescript/src/models/STRectangle.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { BoundingBox2D } from './BoundingBox2D'; -import { - BoundingBox2DFromJSON, - BoundingBox2DFromJSONTyped, - BoundingBox2DToJSON, -} from './BoundingBox2D'; +import { mapValues } from '../runtime'; import type { TimeInterval } from './TimeInterval'; import { TimeIntervalFromJSON, TimeIntervalFromJSONTyped, TimeIntervalToJSON, + TimeIntervalToJSONTyped, } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; +import { + BoundingBox2DFromJSON, + BoundingBox2DFromJSONTyped, + BoundingBox2DToJSON, + BoundingBox2DToJSONTyped, +} from './BoundingBox2D'; /** * @@ -55,13 +57,11 @@ export interface STRectangle { /** * Check if a given object implements the STRectangle interface. */ -export function instanceOfSTRectangle(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "boundingBox" in value; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "timeInterval" in value; - - return isInstance; +export function instanceOfSTRectangle(value: object): value is STRectangle { + if (!('boundingBox' in value) || value['boundingBox'] === undefined) return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) return false; + return true; } export function STRectangleFromJSON(json: any): STRectangle { @@ -69,7 +69,7 @@ export function STRectangleFromJSON(json: any): STRectangle { } export function STRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): STRectangle { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -80,18 +80,20 @@ export function STRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean }; } -export function STRectangleToJSON(value?: STRectangle | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function STRectangleToJSON(json: any): STRectangle { + return STRectangleToJSONTyped(json, false); +} + +export function STRectangleToJSONTyped(value?: STRectangle | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'boundingBox': BoundingBox2DToJSON(value.boundingBox), - 'spatialReference': value.spatialReference, - 'timeInterval': TimeIntervalToJSON(value.timeInterval), + 'boundingBox': BoundingBox2DToJSON(value['boundingBox']), + 'spatialReference': value['spatialReference'], + 'timeInterval': TimeIntervalToJSON(value['timeInterval']), }; } diff --git a/typescript/src/models/SearchCapabilities.ts b/typescript/src/models/SearchCapabilities.ts index 32d4a662..74dfb629 100644 --- a/typescript/src/models/SearchCapabilities.ts +++ b/typescript/src/models/SearchCapabilities.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { SearchTypes } from './SearchTypes'; import { SearchTypesFromJSON, SearchTypesFromJSONTyped, SearchTypesToJSON, + SearchTypesToJSONTyped, } from './SearchTypes'; /** @@ -49,12 +50,10 @@ export interface SearchCapabilities { /** * Check if a given object implements the SearchCapabilities interface. */ -export function instanceOfSearchCapabilities(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "autocomplete" in value; - isInstance = isInstance && "searchTypes" in value; - - return isInstance; +export function instanceOfSearchCapabilities(value: object): value is SearchCapabilities { + if (!('autocomplete' in value) || value['autocomplete'] === undefined) return false; + if (!('searchTypes' in value) || value['searchTypes'] === undefined) return false; + return true; } export function SearchCapabilitiesFromJSON(json: any): SearchCapabilities { @@ -62,29 +61,31 @@ export function SearchCapabilitiesFromJSON(json: any): SearchCapabilities { } export function SearchCapabilitiesFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchCapabilities { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'autocomplete': json['autocomplete'], - 'filters': !exists(json, 'filters') ? undefined : json['filters'], + 'filters': json['filters'] == null ? undefined : json['filters'], 'searchTypes': SearchTypesFromJSON(json['searchTypes']), }; } -export function SearchCapabilitiesToJSON(value?: SearchCapabilities | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SearchCapabilitiesToJSON(json: any): SearchCapabilities { + return SearchCapabilitiesToJSONTyped(json, false); +} + +export function SearchCapabilitiesToJSONTyped(value?: SearchCapabilities | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'autocomplete': value.autocomplete, - 'filters': value.filters, - 'searchTypes': SearchTypesToJSON(value.searchTypes), + 'autocomplete': value['autocomplete'], + 'filters': value['filters'], + 'searchTypes': SearchTypesToJSON(value['searchTypes']), }; } diff --git a/typescript/src/models/SearchType.ts b/typescript/src/models/SearchType.ts index d3808e6a..96661aaa 100644 --- a/typescript/src/models/SearchType.ts +++ b/typescript/src/models/SearchType.ts @@ -24,6 +24,17 @@ export const SearchType = { export type SearchType = typeof SearchType[keyof typeof SearchType]; +export function instanceOfSearchType(value: any): boolean { + for (const key in SearchType) { + if (Object.prototype.hasOwnProperty.call(SearchType, key)) { + if (SearchType[key as keyof typeof SearchType] === value) { + return true; + } + } + } + return false; +} + export function SearchTypeFromJSON(json: any): SearchType { return SearchTypeFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function SearchTypeToJSON(value?: SearchType | null): any { return value as any; } +export function SearchTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): SearchType { + return value as SearchType; +} + diff --git a/typescript/src/models/SearchTypes.ts b/typescript/src/models/SearchTypes.ts index 93a55e15..627279da 100644 --- a/typescript/src/models/SearchTypes.ts +++ b/typescript/src/models/SearchTypes.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface SearchTypes { /** * Check if a given object implements the SearchTypes interface. */ -export function instanceOfSearchTypes(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "fulltext" in value; - isInstance = isInstance && "prefix" in value; - - return isInstance; +export function instanceOfSearchTypes(value: object): value is SearchTypes { + if (!('fulltext' in value) || value['fulltext'] === undefined) return false; + if (!('prefix' in value) || value['prefix'] === undefined) return false; + return true; } export function SearchTypesFromJSON(json: any): SearchTypes { @@ -49,7 +47,7 @@ export function SearchTypesFromJSON(json: any): SearchTypes { } export function SearchTypesFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchTypes { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function SearchTypesFromJSONTyped(json: any, ignoreDiscriminator: boolean }; } -export function SearchTypesToJSON(value?: SearchTypes | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SearchTypesToJSON(json: any): SearchTypes { + return SearchTypesToJSONTyped(json, false); +} + +export function SearchTypesToJSONTyped(value?: SearchTypes | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'fulltext': value.fulltext, - 'prefix': value.prefix, + 'fulltext': value['fulltext'], + 'prefix': value['prefix'], }; } diff --git a/typescript/src/models/ServerInfo.ts b/typescript/src/models/ServerInfo.ts index 95629b96..b6cf90e9 100644 --- a/typescript/src/models/ServerInfo.ts +++ b/typescript/src/models/ServerInfo.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -48,14 +48,12 @@ export interface ServerInfo { /** * Check if a given object implements the ServerInfo interface. */ -export function instanceOfServerInfo(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "buildDate" in value; - isInstance = isInstance && "commitHash" in value; - isInstance = isInstance && "features" in value; - isInstance = isInstance && "version" in value; - - return isInstance; +export function instanceOfServerInfo(value: object): value is ServerInfo { + if (!('buildDate' in value) || value['buildDate'] === undefined) return false; + if (!('commitHash' in value) || value['commitHash'] === undefined) return false; + if (!('features' in value) || value['features'] === undefined) return false; + if (!('version' in value) || value['version'] === undefined) return false; + return true; } export function ServerInfoFromJSON(json: any): ServerInfo { @@ -63,7 +61,7 @@ export function ServerInfoFromJSON(json: any): ServerInfo { } export function ServerInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ServerInfo { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,19 +73,21 @@ export function ServerInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean) }; } -export function ServerInfoToJSON(value?: ServerInfo | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function ServerInfoToJSON(json: any): ServerInfo { + return ServerInfoToJSONTyped(json, false); +} + +export function ServerInfoToJSONTyped(value?: ServerInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'buildDate': value.buildDate, - 'commitHash': value.commitHash, - 'features': value.features, - 'version': value.version, + 'buildDate': value['buildDate'], + 'commitHash': value['commitHash'], + 'features': value['features'], + 'version': value['version'], }; } diff --git a/typescript/src/models/SingleBandRasterColorizer.ts b/typescript/src/models/SingleBandRasterColorizer.ts index 687e3ef2..ee0b1a88 100644 --- a/typescript/src/models/SingleBandRasterColorizer.ts +++ b/typescript/src/models/SingleBandRasterColorizer.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Colorizer } from './Colorizer'; import { ColorizerFromJSON, ColorizerFromJSONTyped, ColorizerToJSON, + ColorizerToJSONTyped, } from './Colorizer'; /** @@ -51,8 +52,7 @@ export interface SingleBandRasterColorizer { * @export */ export const SingleBandRasterColorizerTypeEnum = { - SingleBand: 'singleBand', - MultiBand: 'multiBand' + SingleBand: 'singleBand' } as const; export type SingleBandRasterColorizerTypeEnum = typeof SingleBandRasterColorizerTypeEnum[keyof typeof SingleBandRasterColorizerTypeEnum]; @@ -60,13 +60,11 @@ export type SingleBandRasterColorizerTypeEnum = typeof SingleBandRasterColorizer /** * Check if a given object implements the SingleBandRasterColorizer interface. */ -export function instanceOfSingleBandRasterColorizer(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "band" in value; - isInstance = isInstance && "bandColorizer" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfSingleBandRasterColorizer(value: object): value is SingleBandRasterColorizer { + if (!('band' in value) || value['band'] === undefined) return false; + if (!('bandColorizer' in value) || value['bandColorizer'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function SingleBandRasterColorizerFromJSON(json: any): SingleBandRasterColorizer { @@ -74,7 +72,7 @@ export function SingleBandRasterColorizerFromJSON(json: any): SingleBandRasterCo } export function SingleBandRasterColorizerFromJSONTyped(json: any, ignoreDiscriminator: boolean): SingleBandRasterColorizer { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -85,18 +83,20 @@ export function SingleBandRasterColorizerFromJSONTyped(json: any, ignoreDiscrimi }; } -export function SingleBandRasterColorizerToJSON(value?: SingleBandRasterColorizer | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SingleBandRasterColorizerToJSON(json: any): SingleBandRasterColorizer { + return SingleBandRasterColorizerToJSONTyped(json, false); +} + +export function SingleBandRasterColorizerToJSONTyped(value?: SingleBandRasterColorizer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'band': value.band, - 'bandColorizer': ColorizerToJSON(value.bandColorizer), - 'type': value.type, + 'band': value['band'], + 'bandColorizer': ColorizerToJSON(value['bandColorizer']), + 'type': value['type'], }; } diff --git a/typescript/src/models/SpatialPartition2D.ts b/typescript/src/models/SpatialPartition2D.ts index cb8038d4..ff23f964 100644 --- a/typescript/src/models/SpatialPartition2D.ts +++ b/typescript/src/models/SpatialPartition2D.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Coordinate2D } from './Coordinate2D'; import { Coordinate2DFromJSON, Coordinate2DFromJSONTyped, Coordinate2DToJSON, + Coordinate2DToJSONTyped, } from './Coordinate2D'; /** @@ -43,12 +44,10 @@ export interface SpatialPartition2D { /** * Check if a given object implements the SpatialPartition2D interface. */ -export function instanceOfSpatialPartition2D(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "lowerRightCoordinate" in value; - isInstance = isInstance && "upperLeftCoordinate" in value; - - return isInstance; +export function instanceOfSpatialPartition2D(value: object): value is SpatialPartition2D { + if (!('lowerRightCoordinate' in value) || value['lowerRightCoordinate'] === undefined) return false; + if (!('upperLeftCoordinate' in value) || value['upperLeftCoordinate'] === undefined) return false; + return true; } export function SpatialPartition2DFromJSON(json: any): SpatialPartition2D { @@ -56,7 +55,7 @@ export function SpatialPartition2DFromJSON(json: any): SpatialPartition2D { } export function SpatialPartition2DFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpatialPartition2D { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -66,17 +65,19 @@ export function SpatialPartition2DFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function SpatialPartition2DToJSON(value?: SpatialPartition2D | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SpatialPartition2DToJSON(json: any): SpatialPartition2D { + return SpatialPartition2DToJSONTyped(json, false); +} + +export function SpatialPartition2DToJSONTyped(value?: SpatialPartition2D | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'lowerRightCoordinate': Coordinate2DToJSON(value.lowerRightCoordinate), - 'upperLeftCoordinate': Coordinate2DToJSON(value.upperLeftCoordinate), + 'lowerRightCoordinate': Coordinate2DToJSON(value['lowerRightCoordinate']), + 'upperLeftCoordinate': Coordinate2DToJSON(value['upperLeftCoordinate']), }; } diff --git a/typescript/src/models/SpatialReferenceAuthority.ts b/typescript/src/models/SpatialReferenceAuthority.ts index c62a0433..966f5a59 100644 --- a/typescript/src/models/SpatialReferenceAuthority.ts +++ b/typescript/src/models/SpatialReferenceAuthority.ts @@ -26,6 +26,17 @@ export const SpatialReferenceAuthority = { export type SpatialReferenceAuthority = typeof SpatialReferenceAuthority[keyof typeof SpatialReferenceAuthority]; +export function instanceOfSpatialReferenceAuthority(value: any): boolean { + for (const key in SpatialReferenceAuthority) { + if (Object.prototype.hasOwnProperty.call(SpatialReferenceAuthority, key)) { + if (SpatialReferenceAuthority[key as keyof typeof SpatialReferenceAuthority] === value) { + return true; + } + } + } + return false; +} + export function SpatialReferenceAuthorityFromJSON(json: any): SpatialReferenceAuthority { return SpatialReferenceAuthorityFromJSONTyped(json, false); } @@ -38,3 +49,7 @@ export function SpatialReferenceAuthorityToJSON(value?: SpatialReferenceAuthorit return value as any; } +export function SpatialReferenceAuthorityToJSONTyped(value: any, ignoreDiscriminator: boolean): SpatialReferenceAuthority { + return value as SpatialReferenceAuthority; +} + diff --git a/typescript/src/models/SpatialReferenceSpecification.ts b/typescript/src/models/SpatialReferenceSpecification.ts index 2dec601d..a3080c82 100644 --- a/typescript/src/models/SpatialReferenceSpecification.ts +++ b/typescript/src/models/SpatialReferenceSpecification.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { AxisOrder } from './AxisOrder'; -import { - AxisOrderFromJSON, - AxisOrderFromJSONTyped, - AxisOrderToJSON, -} from './AxisOrder'; +import { mapValues } from '../runtime'; import type { BoundingBox2D } from './BoundingBox2D'; import { BoundingBox2DFromJSON, BoundingBox2DFromJSONTyped, BoundingBox2DToJSON, + BoundingBox2DToJSONTyped, } from './BoundingBox2D'; +import type { AxisOrder } from './AxisOrder'; +import { + AxisOrderFromJSON, + AxisOrderFromJSONTyped, + AxisOrderToJSON, + AxisOrderToJSONTyped, +} from './AxisOrder'; /** * The specification of a spatial reference, where extent and axis labels are given @@ -71,17 +73,17 @@ export interface SpatialReferenceSpecification { spatialReference: string; } + + /** * Check if a given object implements the SpatialReferenceSpecification interface. */ -export function instanceOfSpatialReferenceSpecification(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "extent" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "projString" in value; - isInstance = isInstance && "spatialReference" in value; - - return isInstance; +export function instanceOfSpatialReferenceSpecification(value: object): value is SpatialReferenceSpecification { + if (!('extent' in value) || value['extent'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('projString' in value) || value['projString'] === undefined) return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) return false; + return true; } export function SpatialReferenceSpecificationFromJSON(json: any): SpatialReferenceSpecification { @@ -89,13 +91,13 @@ export function SpatialReferenceSpecificationFromJSON(json: any): SpatialReferen } export function SpatialReferenceSpecificationFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpatialReferenceSpecification { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'axisLabels': !exists(json, 'axisLabels') ? undefined : json['axisLabels'], - 'axisOrder': !exists(json, 'axisOrder') ? undefined : AxisOrderFromJSON(json['axisOrder']), + 'axisLabels': json['axisLabels'] == null ? undefined : json['axisLabels'], + 'axisOrder': json['axisOrder'] == null ? undefined : AxisOrderFromJSON(json['axisOrder']), 'extent': BoundingBox2DFromJSON(json['extent']), 'name': json['name'], 'projString': json['projString'], @@ -103,21 +105,23 @@ export function SpatialReferenceSpecificationFromJSONTyped(json: any, ignoreDisc }; } -export function SpatialReferenceSpecificationToJSON(value?: SpatialReferenceSpecification | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SpatialReferenceSpecificationToJSON(json: any): SpatialReferenceSpecification { + return SpatialReferenceSpecificationToJSONTyped(json, false); +} + +export function SpatialReferenceSpecificationToJSONTyped(value?: SpatialReferenceSpecification | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'axisLabels': value.axisLabels, - 'axisOrder': AxisOrderToJSON(value.axisOrder), - 'extent': BoundingBox2DToJSON(value.extent), - 'name': value.name, - 'projString': value.projString, - 'spatialReference': value.spatialReference, + 'axisLabels': value['axisLabels'], + 'axisOrder': AxisOrderToJSON(value['axisOrder']), + 'extent': BoundingBox2DToJSON(value['extent']), + 'name': value['name'], + 'projString': value['projString'], + 'spatialReference': value['spatialReference'], }; } diff --git a/typescript/src/models/SpatialResolution.ts b/typescript/src/models/SpatialResolution.ts index 778d0bd8..837397af 100644 --- a/typescript/src/models/SpatialResolution.ts +++ b/typescript/src/models/SpatialResolution.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * The spatial resolution in SRS units * @export @@ -36,12 +36,10 @@ export interface SpatialResolution { /** * Check if a given object implements the SpatialResolution interface. */ -export function instanceOfSpatialResolution(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "x" in value; - isInstance = isInstance && "y" in value; - - return isInstance; +export function instanceOfSpatialResolution(value: object): value is SpatialResolution { + if (!('x' in value) || value['x'] === undefined) return false; + if (!('y' in value) || value['y'] === undefined) return false; + return true; } export function SpatialResolutionFromJSON(json: any): SpatialResolution { @@ -49,7 +47,7 @@ export function SpatialResolutionFromJSON(json: any): SpatialResolution { } export function SpatialResolutionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpatialResolution { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function SpatialResolutionFromJSONTyped(json: any, ignoreDiscriminator: b }; } -export function SpatialResolutionToJSON(value?: SpatialResolution | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SpatialResolutionToJSON(json: any): SpatialResolution { + return SpatialResolutionToJSONTyped(json, false); +} + +export function SpatialResolutionToJSONTyped(value?: SpatialResolution | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'x': value.x, - 'y': value.y, + 'x': value['x'], + 'y': value['y'], }; } diff --git a/typescript/src/models/StaticNumberParam.ts b/typescript/src/models/StaticNumberParam.ts index 05edc0a5..da343e28 100644 --- a/typescript/src/models/StaticNumberParam.ts +++ b/typescript/src/models/StaticNumberParam.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -38,8 +38,7 @@ export interface StaticNumberParam { * @export */ export const StaticNumberParamTypeEnum = { - Static: 'static', - Derived: 'derived' + Static: 'static' } as const; export type StaticNumberParamTypeEnum = typeof StaticNumberParamTypeEnum[keyof typeof StaticNumberParamTypeEnum]; @@ -47,12 +46,10 @@ export type StaticNumberParamTypeEnum = typeof StaticNumberParamTypeEnum[keyof t /** * Check if a given object implements the StaticNumberParam interface. */ -export function instanceOfStaticNumberParam(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "value" in value; - - return isInstance; +export function instanceOfStaticNumberParam(value: object): value is StaticNumberParam { + if (!('type' in value) || value['type'] === undefined) return false; + if (!('value' in value) || value['value'] === undefined) return false; + return true; } export function StaticNumberParamFromJSON(json: any): StaticNumberParam { @@ -60,7 +57,7 @@ export function StaticNumberParamFromJSON(json: any): StaticNumberParam { } export function StaticNumberParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): StaticNumberParam { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -70,17 +67,19 @@ export function StaticNumberParamFromJSONTyped(json: any, ignoreDiscriminator: b }; } -export function StaticNumberParamToJSON(value?: StaticNumberParam | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function StaticNumberParamToJSON(json: any): StaticNumberParam { + return StaticNumberParamToJSONTyped(json, false); +} + +export function StaticNumberParamToJSONTyped(value?: StaticNumberParam | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'type': value.type, - 'value': value.value, + 'type': value['type'], + 'value': value['value'], }; } diff --git a/typescript/src/models/StrokeParam.ts b/typescript/src/models/StrokeParam.ts index ee1e14cb..f3dc1a31 100644 --- a/typescript/src/models/StrokeParam.ts +++ b/typescript/src/models/StrokeParam.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { ColorParam } from './ColorParam'; -import { - ColorParamFromJSON, - ColorParamFromJSONTyped, - ColorParamToJSON, -} from './ColorParam'; +import { mapValues } from '../runtime'; import type { NumberParam } from './NumberParam'; import { NumberParamFromJSON, NumberParamFromJSONTyped, NumberParamToJSON, + NumberParamToJSONTyped, } from './NumberParam'; +import type { ColorParam } from './ColorParam'; +import { + ColorParamFromJSON, + ColorParamFromJSONTyped, + ColorParamToJSON, + ColorParamToJSONTyped, +} from './ColorParam'; /** * @@ -49,12 +51,10 @@ export interface StrokeParam { /** * Check if a given object implements the StrokeParam interface. */ -export function instanceOfStrokeParam(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "color" in value; - isInstance = isInstance && "width" in value; - - return isInstance; +export function instanceOfStrokeParam(value: object): value is StrokeParam { + if (!('color' in value) || value['color'] === undefined) return false; + if (!('width' in value) || value['width'] === undefined) return false; + return true; } export function StrokeParamFromJSON(json: any): StrokeParam { @@ -62,7 +62,7 @@ export function StrokeParamFromJSON(json: any): StrokeParam { } export function StrokeParamFromJSONTyped(json: any, ignoreDiscriminator: boolean): StrokeParam { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -72,17 +72,19 @@ export function StrokeParamFromJSONTyped(json: any, ignoreDiscriminator: boolean }; } -export function StrokeParamToJSON(value?: StrokeParam | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function StrokeParamToJSON(json: any): StrokeParam { + return StrokeParamToJSONTyped(json, false); +} + +export function StrokeParamToJSONTyped(value?: StrokeParam | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'color': ColorParamToJSON(value.color), - 'width': NumberParamToJSON(value.width), + 'color': ColorParamToJSON(value['color']), + 'width': NumberParamToJSON(value['width']), }; } diff --git a/typescript/src/models/SuggestMetaData.ts b/typescript/src/models/SuggestMetaData.ts index 35206d23..ed9d55c7 100644 --- a/typescript/src/models/SuggestMetaData.ts +++ b/typescript/src/models/SuggestMetaData.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { DataPath } from './DataPath'; import { DataPathFromJSON, DataPathFromJSONTyped, DataPathToJSON, + DataPathToJSONTyped, } from './DataPath'; /** @@ -49,11 +50,9 @@ export interface SuggestMetaData { /** * Check if a given object implements the SuggestMetaData interface. */ -export function instanceOfSuggestMetaData(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "dataPath" in value; - - return isInstance; +export function instanceOfSuggestMetaData(value: object): value is SuggestMetaData { + if (!('dataPath' in value) || value['dataPath'] === undefined) return false; + return true; } export function SuggestMetaDataFromJSON(json: any): SuggestMetaData { @@ -61,29 +60,31 @@ export function SuggestMetaDataFromJSON(json: any): SuggestMetaData { } export function SuggestMetaDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SuggestMetaData { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'dataPath': DataPathFromJSON(json['dataPath']), - 'layerName': !exists(json, 'layerName') ? undefined : json['layerName'], - 'mainFile': !exists(json, 'mainFile') ? undefined : json['mainFile'], + 'layerName': json['layerName'] == null ? undefined : json['layerName'], + 'mainFile': json['mainFile'] == null ? undefined : json['mainFile'], }; } -export function SuggestMetaDataToJSON(value?: SuggestMetaData | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SuggestMetaDataToJSON(json: any): SuggestMetaData { + return SuggestMetaDataToJSONTyped(json, false); +} + +export function SuggestMetaDataToJSONTyped(value?: SuggestMetaData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'dataPath': DataPathToJSON(value.dataPath), - 'layerName': value.layerName, - 'mainFile': value.mainFile, + 'dataPath': DataPathToJSON(value['dataPath']), + 'layerName': value['layerName'], + 'mainFile': value['mainFile'], }; } diff --git a/typescript/src/models/Symbology.ts b/typescript/src/models/Symbology.ts index 1e9c994e..5da8d78c 100644 --- a/typescript/src/models/Symbology.ts +++ b/typescript/src/models/Symbology.ts @@ -12,29 +12,29 @@ * Do not edit the class manually. */ +import type { LineSymbology } from './LineSymbology'; import { - LineSymbology, instanceOfLineSymbology, LineSymbologyFromJSON, LineSymbologyFromJSONTyped, LineSymbologyToJSON, } from './LineSymbology'; +import type { PointSymbology } from './PointSymbology'; import { - PointSymbology, instanceOfPointSymbology, PointSymbologyFromJSON, PointSymbologyFromJSONTyped, PointSymbologyToJSON, } from './PointSymbology'; +import type { PolygonSymbology } from './PolygonSymbology'; import { - PolygonSymbology, instanceOfPolygonSymbology, PolygonSymbologyFromJSON, PolygonSymbologyFromJSONTyped, PolygonSymbologyToJSON, } from './PolygonSymbology'; +import type { RasterSymbology } from './RasterSymbology'; import { - RasterSymbology, instanceOfRasterSymbology, RasterSymbologyFromJSON, RasterSymbologyFromJSONTyped, @@ -53,39 +53,40 @@ export function SymbologyFromJSON(json: any): Symbology { } export function SymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Symbology { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'line': - return {...LineSymbologyFromJSONTyped(json, true), type: 'line'}; + return Object.assign({}, LineSymbologyFromJSONTyped(json, true), { type: 'line' } as const); case 'point': - return {...PointSymbologyFromJSONTyped(json, true), type: 'point'}; + return Object.assign({}, PointSymbologyFromJSONTyped(json, true), { type: 'point' } as const); case 'polygon': - return {...PolygonSymbologyFromJSONTyped(json, true), type: 'polygon'}; + return Object.assign({}, PolygonSymbologyFromJSONTyped(json, true), { type: 'polygon' } as const); case 'raster': - return {...RasterSymbologyFromJSONTyped(json, true), type: 'raster'}; + return Object.assign({}, RasterSymbologyFromJSONTyped(json, true), { type: 'raster' } as const); default: throw new Error(`No variant of Symbology exists with 'type=${json['type']}'`); } } -export function SymbologyToJSON(value?: Symbology | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function SymbologyToJSON(json: any): any { + return SymbologyToJSONTyped(json, false); +} + +export function SymbologyToJSONTyped(value?: Symbology | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'line': - return LineSymbologyToJSON(value); + return Object.assign({}, LineSymbologyToJSON(value), { type: 'line' } as const); case 'point': - return PointSymbologyToJSON(value); + return Object.assign({}, PointSymbologyToJSON(value), { type: 'point' } as const); case 'polygon': - return PolygonSymbologyToJSON(value); + return Object.assign({}, PolygonSymbologyToJSON(value), { type: 'polygon' } as const); case 'raster': - return RasterSymbologyToJSON(value); + return Object.assign({}, RasterSymbologyToJSON(value), { type: 'raster' } as const); default: throw new Error(`No variant of Symbology exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/TaskAbortOptions.ts b/typescript/src/models/TaskAbortOptions.ts index b27fe222..db1450b5 100644 --- a/typescript/src/models/TaskAbortOptions.ts +++ b/typescript/src/models/TaskAbortOptions.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,10 +30,8 @@ export interface TaskAbortOptions { /** * Check if a given object implements the TaskAbortOptions interface. */ -export function instanceOfTaskAbortOptions(value: object): boolean { - let isInstance = true; - - return isInstance; +export function instanceOfTaskAbortOptions(value: object): value is TaskAbortOptions { + return true; } export function TaskAbortOptionsFromJSON(json: any): TaskAbortOptions { @@ -41,25 +39,27 @@ export function TaskAbortOptionsFromJSON(json: any): TaskAbortOptions { } export function TaskAbortOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskAbortOptions { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'force': !exists(json, 'force') ? undefined : json['force'], + 'force': json['force'] == null ? undefined : json['force'], }; } -export function TaskAbortOptionsToJSON(value?: TaskAbortOptions | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskAbortOptionsToJSON(json: any): TaskAbortOptions { + return TaskAbortOptionsToJSONTyped(json, false); +} + +export function TaskAbortOptionsToJSONTyped(value?: TaskAbortOptions | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'force': value.force, + 'force': value['force'], }; } diff --git a/typescript/src/models/TaskFilter.ts b/typescript/src/models/TaskFilter.ts index affe047a..cb13c74f 100644 --- a/typescript/src/models/TaskFilter.ts +++ b/typescript/src/models/TaskFilter.ts @@ -26,6 +26,17 @@ export const TaskFilter = { export type TaskFilter = typeof TaskFilter[keyof typeof TaskFilter]; +export function instanceOfTaskFilter(value: any): boolean { + for (const key in TaskFilter) { + if (Object.prototype.hasOwnProperty.call(TaskFilter, key)) { + if (TaskFilter[key as keyof typeof TaskFilter] === value) { + return true; + } + } + } + return false; +} + export function TaskFilterFromJSON(json: any): TaskFilter { return TaskFilterFromJSONTyped(json, false); } @@ -38,3 +49,7 @@ export function TaskFilterToJSON(value?: TaskFilter | null): any { return value as any; } +export function TaskFilterToJSONTyped(value: any, ignoreDiscriminator: boolean): TaskFilter { + return value as TaskFilter; +} + diff --git a/typescript/src/models/TaskListOptions.ts b/typescript/src/models/TaskListOptions.ts index e037b829..0538e68a 100644 --- a/typescript/src/models/TaskListOptions.ts +++ b/typescript/src/models/TaskListOptions.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TaskFilter } from './TaskFilter'; import { TaskFilterFromJSON, TaskFilterFromJSONTyped, TaskFilterToJSON, + TaskFilterToJSONTyped, } from './TaskFilter'; /** @@ -46,13 +47,13 @@ export interface TaskListOptions { offset?: number; } + + /** * Check if a given object implements the TaskListOptions interface. */ -export function instanceOfTaskListOptions(value: object): boolean { - let isInstance = true; - - return isInstance; +export function instanceOfTaskListOptions(value: object): value is TaskListOptions { + return true; } export function TaskListOptionsFromJSON(json: any): TaskListOptions { @@ -60,29 +61,31 @@ export function TaskListOptionsFromJSON(json: any): TaskListOptions { } export function TaskListOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskListOptions { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'filter': !exists(json, 'filter') ? undefined : TaskFilterFromJSON(json['filter']), - 'limit': !exists(json, 'limit') ? undefined : json['limit'], - 'offset': !exists(json, 'offset') ? undefined : json['offset'], + 'filter': json['filter'] == null ? undefined : TaskFilterFromJSON(json['filter']), + 'limit': json['limit'] == null ? undefined : json['limit'], + 'offset': json['offset'] == null ? undefined : json['offset'], }; } -export function TaskListOptionsToJSON(value?: TaskListOptions | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskListOptionsToJSON(json: any): TaskListOptions { + return TaskListOptionsToJSONTyped(json, false); +} + +export function TaskListOptionsToJSONTyped(value?: TaskListOptions | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'filter': TaskFilterToJSON(value.filter), - 'limit': value.limit, - 'offset': value.offset, + 'filter': TaskFilterToJSON(value['filter']), + 'limit': value['limit'], + 'offset': value['offset'], }; } diff --git a/typescript/src/models/TaskResponse.ts b/typescript/src/models/TaskResponse.ts index 6c7c04d5..d9e4f55c 100644 --- a/typescript/src/models/TaskResponse.ts +++ b/typescript/src/models/TaskResponse.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * Create a task somewhere and respond with a task id to query the task status. * @export @@ -30,11 +30,9 @@ export interface TaskResponse { /** * Check if a given object implements the TaskResponse interface. */ -export function instanceOfTaskResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "taskId" in value; - - return isInstance; +export function instanceOfTaskResponse(value: object): value is TaskResponse { + if (!('taskId' in value) || value['taskId'] === undefined) return false; + return true; } export function TaskResponseFromJSON(json: any): TaskResponse { @@ -42,7 +40,7 @@ export function TaskResponseFromJSON(json: any): TaskResponse { } export function TaskResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function TaskResponseFromJSONTyped(json: any, ignoreDiscriminator: boolea }; } -export function TaskResponseToJSON(value?: TaskResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskResponseToJSON(json: any): TaskResponse { + return TaskResponseToJSONTyped(json, false); +} + +export function TaskResponseToJSONTyped(value?: TaskResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'taskId': value.taskId, + 'taskId': value['taskId'], }; } diff --git a/typescript/src/models/TaskStatus.ts b/typescript/src/models/TaskStatus.ts index 9d801b0b..a2c81146 100644 --- a/typescript/src/models/TaskStatus.ts +++ b/typescript/src/models/TaskStatus.ts @@ -12,29 +12,29 @@ * Do not edit the class manually. */ +import type { TaskStatusAborted } from './TaskStatusAborted'; import { - TaskStatusAborted, instanceOfTaskStatusAborted, TaskStatusAbortedFromJSON, TaskStatusAbortedFromJSONTyped, TaskStatusAbortedToJSON, } from './TaskStatusAborted'; +import type { TaskStatusCompleted } from './TaskStatusCompleted'; import { - TaskStatusCompleted, instanceOfTaskStatusCompleted, TaskStatusCompletedFromJSON, TaskStatusCompletedFromJSONTyped, TaskStatusCompletedToJSON, } from './TaskStatusCompleted'; +import type { TaskStatusFailed } from './TaskStatusFailed'; import { - TaskStatusFailed, instanceOfTaskStatusFailed, TaskStatusFailedFromJSON, TaskStatusFailedFromJSONTyped, TaskStatusFailedToJSON, } from './TaskStatusFailed'; +import type { TaskStatusRunning } from './TaskStatusRunning'; import { - TaskStatusRunning, instanceOfTaskStatusRunning, TaskStatusRunningFromJSON, TaskStatusRunningFromJSONTyped, @@ -53,39 +53,40 @@ export function TaskStatusFromJSON(json: any): TaskStatus { } export function TaskStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatus { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['status']) { case 'aborted': - return {...TaskStatusAbortedFromJSONTyped(json, true), status: 'aborted'}; + return Object.assign({}, TaskStatusAbortedFromJSONTyped(json, true), { status: 'aborted' } as const); case 'completed': - return {...TaskStatusCompletedFromJSONTyped(json, true), status: 'completed'}; + return Object.assign({}, TaskStatusCompletedFromJSONTyped(json, true), { status: 'completed' } as const); case 'failed': - return {...TaskStatusFailedFromJSONTyped(json, true), status: 'failed'}; + return Object.assign({}, TaskStatusFailedFromJSONTyped(json, true), { status: 'failed' } as const); case 'running': - return {...TaskStatusRunningFromJSONTyped(json, true), status: 'running'}; + return Object.assign({}, TaskStatusRunningFromJSONTyped(json, true), { status: 'running' } as const); default: throw new Error(`No variant of TaskStatus exists with 'status=${json['status']}'`); } } -export function TaskStatusToJSON(value?: TaskStatus | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusToJSON(json: any): any { + return TaskStatusToJSONTyped(json, false); +} + +export function TaskStatusToJSONTyped(value?: TaskStatus | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['status']) { case 'aborted': - return TaskStatusAbortedToJSON(value); + return Object.assign({}, TaskStatusAbortedToJSON(value), { status: 'aborted' } as const); case 'completed': - return TaskStatusCompletedToJSON(value); + return Object.assign({}, TaskStatusCompletedToJSON(value), { status: 'completed' } as const); case 'failed': - return TaskStatusFailedToJSON(value); + return Object.assign({}, TaskStatusFailedToJSON(value), { status: 'failed' } as const); case 'running': - return TaskStatusRunningToJSON(value); + return Object.assign({}, TaskStatusRunningToJSON(value), { status: 'running' } as const); default: throw new Error(`No variant of TaskStatus exists with 'status=${value['status']}'`); } diff --git a/typescript/src/models/TaskStatusAborted.ts b/typescript/src/models/TaskStatusAborted.ts index 574f1b5e..2c8fb104 100644 --- a/typescript/src/models/TaskStatusAborted.ts +++ b/typescript/src/models/TaskStatusAborted.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -46,12 +46,10 @@ export type TaskStatusAbortedStatusEnum = typeof TaskStatusAbortedStatusEnum[key /** * Check if a given object implements the TaskStatusAborted interface. */ -export function instanceOfTaskStatusAborted(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "cleanUp" in value; - isInstance = isInstance && "status" in value; - - return isInstance; +export function instanceOfTaskStatusAborted(value: object): value is TaskStatusAborted { + if (!('cleanUp' in value) || value['cleanUp'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + return true; } export function TaskStatusAbortedFromJSON(json: any): TaskStatusAborted { @@ -59,7 +57,7 @@ export function TaskStatusAbortedFromJSON(json: any): TaskStatusAborted { } export function TaskStatusAbortedFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusAborted { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -69,17 +67,19 @@ export function TaskStatusAbortedFromJSONTyped(json: any, ignoreDiscriminator: b }; } -export function TaskStatusAbortedToJSON(value?: TaskStatusAborted | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusAbortedToJSON(json: any): TaskStatusAborted { + return TaskStatusAbortedToJSONTyped(json, false); +} + +export function TaskStatusAbortedToJSONTyped(value?: TaskStatusAborted | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'cleanUp': value.cleanUp, - 'status': value.status, + 'cleanUp': value['cleanUp'], + 'status': value['status'], }; } diff --git a/typescript/src/models/TaskStatusCompleted.ts b/typescript/src/models/TaskStatusCompleted.ts index 4b6ddef1..359e123f 100644 --- a/typescript/src/models/TaskStatusCompleted.ts +++ b/typescript/src/models/TaskStatusCompleted.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -70,14 +70,12 @@ export type TaskStatusCompletedStatusEnum = typeof TaskStatusCompletedStatusEnum /** * Check if a given object implements the TaskStatusCompleted interface. */ -export function instanceOfTaskStatusCompleted(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "taskType" in value; - isInstance = isInstance && "timeStarted" in value; - isInstance = isInstance && "timeTotal" in value; - - return isInstance; +export function instanceOfTaskStatusCompleted(value: object): value is TaskStatusCompleted { + if (!('status' in value) || value['status'] === undefined) return false; + if (!('taskType' in value) || value['taskType'] === undefined) return false; + if (!('timeStarted' in value) || value['timeStarted'] === undefined) return false; + if (!('timeTotal' in value) || value['timeTotal'] === undefined) return false; + return true; } export function TaskStatusCompletedFromJSON(json: any): TaskStatusCompleted { @@ -85,13 +83,13 @@ export function TaskStatusCompletedFromJSON(json: any): TaskStatusCompleted { } export function TaskStatusCompletedFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusCompleted { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'description': !exists(json, 'description') ? undefined : json['description'], - 'info': !exists(json, 'info') ? undefined : json['info'], + 'description': json['description'] == null ? undefined : json['description'], + 'info': json['info'] == null ? undefined : json['info'], 'status': json['status'], 'taskType': json['taskType'], 'timeStarted': json['timeStarted'], @@ -99,21 +97,23 @@ export function TaskStatusCompletedFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function TaskStatusCompletedToJSON(value?: TaskStatusCompleted | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusCompletedToJSON(json: any): TaskStatusCompleted { + return TaskStatusCompletedToJSONTyped(json, false); +} + +export function TaskStatusCompletedToJSONTyped(value?: TaskStatusCompleted | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'info': value.info, - 'status': value.status, - 'taskType': value.taskType, - 'timeStarted': value.timeStarted, - 'timeTotal': value.timeTotal, + 'description': value['description'], + 'info': value['info'], + 'status': value['status'], + 'taskType': value['taskType'], + 'timeStarted': value['timeStarted'], + 'timeTotal': value['timeTotal'], }; } diff --git a/typescript/src/models/TaskStatusFailed.ts b/typescript/src/models/TaskStatusFailed.ts index 1ed2730f..49811875 100644 --- a/typescript/src/models/TaskStatusFailed.ts +++ b/typescript/src/models/TaskStatusFailed.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -52,13 +52,11 @@ export type TaskStatusFailedStatusEnum = typeof TaskStatusFailedStatusEnum[keyof /** * Check if a given object implements the TaskStatusFailed interface. */ -export function instanceOfTaskStatusFailed(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "cleanUp" in value; - isInstance = isInstance && "error" in value; - isInstance = isInstance && "status" in value; - - return isInstance; +export function instanceOfTaskStatusFailed(value: object): value is TaskStatusFailed { + if (!('cleanUp' in value) || value['cleanUp'] === undefined) return false; + if (!('error' in value) || value['error'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + return true; } export function TaskStatusFailedFromJSON(json: any): TaskStatusFailed { @@ -66,7 +64,7 @@ export function TaskStatusFailedFromJSON(json: any): TaskStatusFailed { } export function TaskStatusFailedFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusFailed { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -77,18 +75,20 @@ export function TaskStatusFailedFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function TaskStatusFailedToJSON(value?: TaskStatusFailed | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusFailedToJSON(json: any): TaskStatusFailed { + return TaskStatusFailedToJSONTyped(json, false); +} + +export function TaskStatusFailedToJSONTyped(value?: TaskStatusFailed | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'cleanUp': value.cleanUp, - 'error': value.error, - 'status': value.status, + 'cleanUp': value['cleanUp'], + 'error': value['error'], + 'status': value['status'], }; } diff --git a/typescript/src/models/TaskStatusRunning.ts b/typescript/src/models/TaskStatusRunning.ts index 7b9c5512..0f0a8075 100644 --- a/typescript/src/models/TaskStatusRunning.ts +++ b/typescript/src/models/TaskStatusRunning.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -76,15 +76,13 @@ export type TaskStatusRunningStatusEnum = typeof TaskStatusRunningStatusEnum[key /** * Check if a given object implements the TaskStatusRunning interface. */ -export function instanceOfTaskStatusRunning(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "estimatedTimeRemaining" in value; - isInstance = isInstance && "pctComplete" in value; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "taskType" in value; - isInstance = isInstance && "timeStarted" in value; - - return isInstance; +export function instanceOfTaskStatusRunning(value: object): value is TaskStatusRunning { + if (!('estimatedTimeRemaining' in value) || value['estimatedTimeRemaining'] === undefined) return false; + if (!('pctComplete' in value) || value['pctComplete'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('taskType' in value) || value['taskType'] === undefined) return false; + if (!('timeStarted' in value) || value['timeStarted'] === undefined) return false; + return true; } export function TaskStatusRunningFromJSON(json: any): TaskStatusRunning { @@ -92,14 +90,14 @@ export function TaskStatusRunningFromJSON(json: any): TaskStatusRunning { } export function TaskStatusRunningFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusRunning { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'description': !exists(json, 'description') ? undefined : json['description'], + 'description': json['description'] == null ? undefined : json['description'], 'estimatedTimeRemaining': json['estimatedTimeRemaining'], - 'info': !exists(json, 'info') ? undefined : json['info'], + 'info': json['info'] == null ? undefined : json['info'], 'pctComplete': json['pctComplete'], 'status': json['status'], 'taskType': json['taskType'], @@ -107,22 +105,24 @@ export function TaskStatusRunningFromJSONTyped(json: any, ignoreDiscriminator: b }; } -export function TaskStatusRunningToJSON(value?: TaskStatusRunning | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusRunningToJSON(json: any): TaskStatusRunning { + return TaskStatusRunningToJSONTyped(json, false); +} + +export function TaskStatusRunningToJSONTyped(value?: TaskStatusRunning | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'estimatedTimeRemaining': value.estimatedTimeRemaining, - 'info': value.info, - 'pctComplete': value.pctComplete, - 'status': value.status, - 'taskType': value.taskType, - 'timeStarted': value.timeStarted, + 'description': value['description'], + 'estimatedTimeRemaining': value['estimatedTimeRemaining'], + 'info': value['info'], + 'pctComplete': value['pctComplete'], + 'status': value['status'], + 'taskType': value['taskType'], + 'timeStarted': value['timeStarted'], }; } diff --git a/typescript/src/models/TaskStatusWithId.ts b/typescript/src/models/TaskStatusWithId.ts index 4cb2b619..89977cd7 100644 --- a/typescript/src/models/TaskStatusWithId.ts +++ b/typescript/src/models/TaskStatusWithId.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TaskStatus } from './TaskStatus'; import { TaskStatusFromJSON, TaskStatusFromJSONTyped, TaskStatusToJSON, + TaskStatusToJSONTyped, } from './TaskStatus'; /** @@ -41,11 +42,9 @@ export interface _TaskStatusWithId /* extends TaskStatus */ { /** * Check if a given object implements the TaskStatusWithId interface. */ -export function instanceOfTaskStatusWithId(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "taskId" in value; - - return isInstance; +export function instanceOfTaskStatusWithId(value: object): value is TaskStatusWithId { + if (!('taskId' in value) || value['taskId'] === undefined) return false; + return true; } export function TaskStatusWithIdFromJSON(json: any): TaskStatusWithId { @@ -53,25 +52,27 @@ export function TaskStatusWithIdFromJSON(json: any): TaskStatusWithId { } export function TaskStatusWithIdFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskStatusWithId { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - ...TaskStatusFromJSONTyped(json, ignoreDiscriminator), + ...TaskStatusFromJSONTyped(json, true), 'taskId': json['taskId'], }; } -export function TaskStatusWithIdToJSON(value?: TaskStatusWithId | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TaskStatusWithIdToJSON(json: any): TaskStatusWithId { + return TaskStatusWithIdToJSONTyped(json, false); +} + +export function TaskStatusWithIdToJSONTyped(value?: TaskStatusWithId | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - ...TaskStatusToJSON(value), - 'taskId': value.taskId, + ...TaskStatusToJSONTyped(value, true), + 'taskId': value['taskId'], }; } diff --git a/typescript/src/models/TextSymbology.ts b/typescript/src/models/TextSymbology.ts index 828f2a78..440b964b 100644 --- a/typescript/src/models/TextSymbology.ts +++ b/typescript/src/models/TextSymbology.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { ColorParam } from './ColorParam'; -import { - ColorParamFromJSON, - ColorParamFromJSONTyped, - ColorParamToJSON, -} from './ColorParam'; +import { mapValues } from '../runtime'; import type { StrokeParam } from './StrokeParam'; import { StrokeParamFromJSON, StrokeParamFromJSONTyped, StrokeParamToJSON, + StrokeParamToJSONTyped, } from './StrokeParam'; +import type { ColorParam } from './ColorParam'; +import { + ColorParamFromJSON, + ColorParamFromJSONTyped, + ColorParamToJSON, + ColorParamToJSONTyped, +} from './ColorParam'; /** * @@ -55,13 +57,11 @@ export interface TextSymbology { /** * Check if a given object implements the TextSymbology interface. */ -export function instanceOfTextSymbology(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "attribute" in value; - isInstance = isInstance && "fillColor" in value; - isInstance = isInstance && "stroke" in value; - - return isInstance; +export function instanceOfTextSymbology(value: object): value is TextSymbology { + if (!('attribute' in value) || value['attribute'] === undefined) return false; + if (!('fillColor' in value) || value['fillColor'] === undefined) return false; + if (!('stroke' in value) || value['stroke'] === undefined) return false; + return true; } export function TextSymbologyFromJSON(json: any): TextSymbology { @@ -69,7 +69,7 @@ export function TextSymbologyFromJSON(json: any): TextSymbology { } export function TextSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boolean): TextSymbology { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -80,18 +80,20 @@ export function TextSymbologyFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function TextSymbologyToJSON(value?: TextSymbology | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TextSymbologyToJSON(json: any): TextSymbology { + return TextSymbologyToJSONTyped(json, false); +} + +export function TextSymbologyToJSONTyped(value?: TextSymbology | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'attribute': value.attribute, - 'fillColor': ColorParamToJSON(value.fillColor), - 'stroke': StrokeParamToJSON(value.stroke), + 'attribute': value['attribute'], + 'fillColor': ColorParamToJSON(value['fillColor']), + 'stroke': StrokeParamToJSON(value['stroke']), }; } diff --git a/typescript/src/models/TimeGranularity.ts b/typescript/src/models/TimeGranularity.ts index 4ca124d5..c10bceb9 100644 --- a/typescript/src/models/TimeGranularity.ts +++ b/typescript/src/models/TimeGranularity.ts @@ -29,6 +29,17 @@ export const TimeGranularity = { export type TimeGranularity = typeof TimeGranularity[keyof typeof TimeGranularity]; +export function instanceOfTimeGranularity(value: any): boolean { + for (const key in TimeGranularity) { + if (Object.prototype.hasOwnProperty.call(TimeGranularity, key)) { + if (TimeGranularity[key as keyof typeof TimeGranularity] === value) { + return true; + } + } + } + return false; +} + export function TimeGranularityFromJSON(json: any): TimeGranularity { return TimeGranularityFromJSONTyped(json, false); } @@ -41,3 +52,7 @@ export function TimeGranularityToJSON(value?: TimeGranularity | null): any { return value as any; } +export function TimeGranularityToJSONTyped(value: any, ignoreDiscriminator: boolean): TimeGranularity { + return value as TimeGranularity; +} + diff --git a/typescript/src/models/TimeInterval.ts b/typescript/src/models/TimeInterval.ts index 68be97ae..e2c43fb9 100644 --- a/typescript/src/models/TimeInterval.ts +++ b/typescript/src/models/TimeInterval.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * Stores time intervals in ms in close-open semantic [start, end) * @export @@ -36,12 +36,10 @@ export interface TimeInterval { /** * Check if a given object implements the TimeInterval interface. */ -export function instanceOfTimeInterval(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "end" in value; - isInstance = isInstance && "start" in value; - - return isInstance; +export function instanceOfTimeInterval(value: object): value is TimeInterval { + if (!('end' in value) || value['end'] === undefined) return false; + if (!('start' in value) || value['start'] === undefined) return false; + return true; } export function TimeIntervalFromJSON(json: any): TimeInterval { @@ -49,7 +47,7 @@ export function TimeIntervalFromJSON(json: any): TimeInterval { } export function TimeIntervalFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeInterval { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function TimeIntervalFromJSONTyped(json: any, ignoreDiscriminator: boolea }; } -export function TimeIntervalToJSON(value?: TimeInterval | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TimeIntervalToJSON(json: any): TimeInterval { + return TimeIntervalToJSONTyped(json, false); +} + +export function TimeIntervalToJSONTyped(value?: TimeInterval | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'end': value.end, - 'start': value.start, + 'end': value['end'], + 'start': value['start'], }; } diff --git a/typescript/src/models/TimeReference.ts b/typescript/src/models/TimeReference.ts index 25f15334..4f98905b 100644 --- a/typescript/src/models/TimeReference.ts +++ b/typescript/src/models/TimeReference.ts @@ -24,6 +24,17 @@ export const TimeReference = { export type TimeReference = typeof TimeReference[keyof typeof TimeReference]; +export function instanceOfTimeReference(value: any): boolean { + for (const key in TimeReference) { + if (Object.prototype.hasOwnProperty.call(TimeReference, key)) { + if (TimeReference[key as keyof typeof TimeReference] === value) { + return true; + } + } + } + return false; +} + export function TimeReferenceFromJSON(json: any): TimeReference { return TimeReferenceFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function TimeReferenceToJSON(value?: TimeReference | null): any { return value as any; } +export function TimeReferenceToJSONTyped(value: any, ignoreDiscriminator: boolean): TimeReference { + return value as TimeReference; +} + diff --git a/typescript/src/models/TimeStep.ts b/typescript/src/models/TimeStep.ts index b86d7b72..fc128fbe 100644 --- a/typescript/src/models/TimeStep.ts +++ b/typescript/src/models/TimeStep.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TimeGranularity } from './TimeGranularity'; import { TimeGranularityFromJSON, TimeGranularityFromJSONTyped, TimeGranularityToJSON, + TimeGranularityToJSONTyped, } from './TimeGranularity'; /** @@ -40,15 +41,15 @@ export interface TimeStep { step: number; } + + /** * Check if a given object implements the TimeStep interface. */ -export function instanceOfTimeStep(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "granularity" in value; - isInstance = isInstance && "step" in value; - - return isInstance; +export function instanceOfTimeStep(value: object): value is TimeStep { + if (!('granularity' in value) || value['granularity'] === undefined) return false; + if (!('step' in value) || value['step'] === undefined) return false; + return true; } export function TimeStepFromJSON(json: any): TimeStep { @@ -56,7 +57,7 @@ export function TimeStepFromJSON(json: any): TimeStep { } export function TimeStepFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeStep { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -66,17 +67,19 @@ export function TimeStepFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function TimeStepToJSON(value?: TimeStep | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TimeStepToJSON(json: any): TimeStep { + return TimeStepToJSONTyped(json, false); +} + +export function TimeStepToJSONTyped(value?: TimeStep | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'granularity': TimeGranularityToJSON(value.granularity), - 'step': value.step, + 'granularity': TimeGranularityToJSON(value['granularity']), + 'step': value['step'], }; } diff --git a/typescript/src/models/TypedGeometry.ts b/typescript/src/models/TypedGeometry.ts index bf7fb0bd..14c92d5c 100644 --- a/typescript/src/models/TypedGeometry.ts +++ b/typescript/src/models/TypedGeometry.ts @@ -12,29 +12,29 @@ * Do not edit the class manually. */ +import type { TypedGeometryOneOf } from './TypedGeometryOneOf'; import { - TypedGeometryOneOf, instanceOfTypedGeometryOneOf, TypedGeometryOneOfFromJSON, TypedGeometryOneOfFromJSONTyped, TypedGeometryOneOfToJSON, } from './TypedGeometryOneOf'; +import type { TypedGeometryOneOf1 } from './TypedGeometryOneOf1'; import { - TypedGeometryOneOf1, instanceOfTypedGeometryOneOf1, TypedGeometryOneOf1FromJSON, TypedGeometryOneOf1FromJSONTyped, TypedGeometryOneOf1ToJSON, } from './TypedGeometryOneOf1'; +import type { TypedGeometryOneOf2 } from './TypedGeometryOneOf2'; import { - TypedGeometryOneOf2, instanceOfTypedGeometryOneOf2, TypedGeometryOneOf2FromJSON, TypedGeometryOneOf2FromJSONTyped, TypedGeometryOneOf2ToJSON, } from './TypedGeometryOneOf2'; +import type { TypedGeometryOneOf3 } from './TypedGeometryOneOf3'; import { - TypedGeometryOneOf3, instanceOfTypedGeometryOneOf3, TypedGeometryOneOf3FromJSON, TypedGeometryOneOf3FromJSONTyped, @@ -53,18 +53,32 @@ export function TypedGeometryFromJSON(json: any): TypedGeometry { } export function TypedGeometryFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometry { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } - return { ...TypedGeometryOneOfFromJSONTyped(json, true), ...TypedGeometryOneOf1FromJSONTyped(json, true), ...TypedGeometryOneOf2FromJSONTyped(json, true), ...TypedGeometryOneOf3FromJSONTyped(json, true) }; + if (instanceOfTypedGeometryOneOf(json)) { + return TypedGeometryOneOfFromJSONTyped(json, true); + } + if (instanceOfTypedGeometryOneOf1(json)) { + return TypedGeometryOneOf1FromJSONTyped(json, true); + } + if (instanceOfTypedGeometryOneOf2(json)) { + return TypedGeometryOneOf2FromJSONTyped(json, true); + } + if (instanceOfTypedGeometryOneOf3(json)) { + return TypedGeometryOneOf3FromJSONTyped(json, true); + } + + return {} as any; } -export function TypedGeometryToJSON(value?: TypedGeometry | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedGeometryToJSON(json: any): any { + return TypedGeometryToJSONTyped(json, false); +} + +export function TypedGeometryToJSONTyped(value?: TypedGeometry | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } if (instanceOfTypedGeometryOneOf(value)) { diff --git a/typescript/src/models/TypedGeometryOneOf.ts b/typescript/src/models/TypedGeometryOneOf.ts index 71009ab8..796e3ed9 100644 --- a/typescript/src/models/TypedGeometryOneOf.ts +++ b/typescript/src/models/TypedGeometryOneOf.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface TypedGeometryOneOf { /** * Check if a given object implements the TypedGeometryOneOf interface. */ -export function instanceOfTypedGeometryOneOf(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "data" in value; - - return isInstance; +export function instanceOfTypedGeometryOneOf(value: object): value is TypedGeometryOneOf { + if (!('data' in value) || value['data'] === undefined) return false; + return true; } export function TypedGeometryOneOfFromJSON(json: any): TypedGeometryOneOf { @@ -42,7 +40,7 @@ export function TypedGeometryOneOfFromJSON(json: any): TypedGeometryOneOf { } export function TypedGeometryOneOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function TypedGeometryOneOfFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function TypedGeometryOneOfToJSON(value?: TypedGeometryOneOf | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedGeometryOneOfToJSON(json: any): TypedGeometryOneOf { + return TypedGeometryOneOfToJSONTyped(json, false); +} + +export function TypedGeometryOneOfToJSONTyped(value?: TypedGeometryOneOf | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'Data': value.data, + 'Data': value['data'], }; } diff --git a/typescript/src/models/TypedGeometryOneOf1.ts b/typescript/src/models/TypedGeometryOneOf1.ts index 447c0db1..1ac5f8f6 100644 --- a/typescript/src/models/TypedGeometryOneOf1.ts +++ b/typescript/src/models/TypedGeometryOneOf1.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { MultiPoint } from './MultiPoint'; import { MultiPointFromJSON, MultiPointFromJSONTyped, MultiPointToJSON, + MultiPointToJSONTyped, } from './MultiPoint'; /** @@ -37,11 +38,9 @@ export interface TypedGeometryOneOf1 { /** * Check if a given object implements the TypedGeometryOneOf1 interface. */ -export function instanceOfTypedGeometryOneOf1(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "multiPoint" in value; - - return isInstance; +export function instanceOfTypedGeometryOneOf1(value: object): value is TypedGeometryOneOf1 { + if (!('multiPoint' in value) || value['multiPoint'] === undefined) return false; + return true; } export function TypedGeometryOneOf1FromJSON(json: any): TypedGeometryOneOf1 { @@ -49,7 +48,7 @@ export function TypedGeometryOneOf1FromJSON(json: any): TypedGeometryOneOf1 { } export function TypedGeometryOneOf1FromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf1 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function TypedGeometryOneOf1FromJSONTyped(json: any, ignoreDiscriminator: }; } -export function TypedGeometryOneOf1ToJSON(value?: TypedGeometryOneOf1 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedGeometryOneOf1ToJSON(json: any): TypedGeometryOneOf1 { + return TypedGeometryOneOf1ToJSONTyped(json, false); +} + +export function TypedGeometryOneOf1ToJSONTyped(value?: TypedGeometryOneOf1 | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'MultiPoint': MultiPointToJSON(value.multiPoint), + 'MultiPoint': MultiPointToJSON(value['multiPoint']), }; } diff --git a/typescript/src/models/TypedGeometryOneOf2.ts b/typescript/src/models/TypedGeometryOneOf2.ts index 4c9d955c..0495c4c0 100644 --- a/typescript/src/models/TypedGeometryOneOf2.ts +++ b/typescript/src/models/TypedGeometryOneOf2.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { MultiLineString } from './MultiLineString'; import { MultiLineStringFromJSON, MultiLineStringFromJSONTyped, MultiLineStringToJSON, + MultiLineStringToJSONTyped, } from './MultiLineString'; /** @@ -37,11 +38,9 @@ export interface TypedGeometryOneOf2 { /** * Check if a given object implements the TypedGeometryOneOf2 interface. */ -export function instanceOfTypedGeometryOneOf2(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "multiLineString" in value; - - return isInstance; +export function instanceOfTypedGeometryOneOf2(value: object): value is TypedGeometryOneOf2 { + if (!('multiLineString' in value) || value['multiLineString'] === undefined) return false; + return true; } export function TypedGeometryOneOf2FromJSON(json: any): TypedGeometryOneOf2 { @@ -49,7 +48,7 @@ export function TypedGeometryOneOf2FromJSON(json: any): TypedGeometryOneOf2 { } export function TypedGeometryOneOf2FromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf2 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function TypedGeometryOneOf2FromJSONTyped(json: any, ignoreDiscriminator: }; } -export function TypedGeometryOneOf2ToJSON(value?: TypedGeometryOneOf2 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedGeometryOneOf2ToJSON(json: any): TypedGeometryOneOf2 { + return TypedGeometryOneOf2ToJSONTyped(json, false); +} + +export function TypedGeometryOneOf2ToJSONTyped(value?: TypedGeometryOneOf2 | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'MultiLineString': MultiLineStringToJSON(value.multiLineString), + 'MultiLineString': MultiLineStringToJSON(value['multiLineString']), }; } diff --git a/typescript/src/models/TypedGeometryOneOf3.ts b/typescript/src/models/TypedGeometryOneOf3.ts index d5b99512..2826d2d9 100644 --- a/typescript/src/models/TypedGeometryOneOf3.ts +++ b/typescript/src/models/TypedGeometryOneOf3.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { MultiPolygon } from './MultiPolygon'; import { MultiPolygonFromJSON, MultiPolygonFromJSONTyped, MultiPolygonToJSON, + MultiPolygonToJSONTyped, } from './MultiPolygon'; /** @@ -37,11 +38,9 @@ export interface TypedGeometryOneOf3 { /** * Check if a given object implements the TypedGeometryOneOf3 interface. */ -export function instanceOfTypedGeometryOneOf3(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "multiPolygon" in value; - - return isInstance; +export function instanceOfTypedGeometryOneOf3(value: object): value is TypedGeometryOneOf3 { + if (!('multiPolygon' in value) || value['multiPolygon'] === undefined) return false; + return true; } export function TypedGeometryOneOf3FromJSON(json: any): TypedGeometryOneOf3 { @@ -49,7 +48,7 @@ export function TypedGeometryOneOf3FromJSON(json: any): TypedGeometryOneOf3 { } export function TypedGeometryOneOf3FromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedGeometryOneOf3 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -58,16 +57,18 @@ export function TypedGeometryOneOf3FromJSONTyped(json: any, ignoreDiscriminator: }; } -export function TypedGeometryOneOf3ToJSON(value?: TypedGeometryOneOf3 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedGeometryOneOf3ToJSON(json: any): TypedGeometryOneOf3 { + return TypedGeometryOneOf3ToJSONTyped(json, false); +} + +export function TypedGeometryOneOf3ToJSONTyped(value?: TypedGeometryOneOf3 | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'MultiPolygon': MultiPolygonToJSON(value.multiPolygon), + 'MultiPolygon': MultiPolygonToJSON(value['multiPolygon']), }; } diff --git a/typescript/src/models/TypedOperator.ts b/typescript/src/models/TypedOperator.ts index 7b2c3d3d..b1cc2f98 100644 --- a/typescript/src/models/TypedOperator.ts +++ b/typescript/src/models/TypedOperator.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TypedOperatorOperator } from './TypedOperatorOperator'; import { TypedOperatorOperatorFromJSON, TypedOperatorOperatorFromJSONTyped, TypedOperatorOperatorToJSON, + TypedOperatorOperatorToJSONTyped, } from './TypedOperatorOperator'; /** @@ -55,12 +56,10 @@ export type TypedOperatorTypeEnum = typeof TypedOperatorTypeEnum[keyof typeof Ty /** * Check if a given object implements the TypedOperator interface. */ -export function instanceOfTypedOperator(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "operator" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfTypedOperator(value: object): value is TypedOperator { + if (!('operator' in value) || value['operator'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function TypedOperatorFromJSON(json: any): TypedOperator { @@ -68,7 +67,7 @@ export function TypedOperatorFromJSON(json: any): TypedOperator { } export function TypedOperatorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedOperator { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -78,17 +77,19 @@ export function TypedOperatorFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function TypedOperatorToJSON(value?: TypedOperator | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedOperatorToJSON(json: any): TypedOperator { + return TypedOperatorToJSONTyped(json, false); +} + +export function TypedOperatorToJSONTyped(value?: TypedOperator | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'operator': TypedOperatorOperatorToJSON(value.operator), - 'type': value.type, + 'operator': TypedOperatorOperatorToJSON(value['operator']), + 'type': value['type'], }; } diff --git a/typescript/src/models/TypedOperatorOperator.ts b/typescript/src/models/TypedOperatorOperator.ts index ff3ee3ae..34a3e2ad 100644 --- a/typescript/src/models/TypedOperatorOperator.ts +++ b/typescript/src/models/TypedOperatorOperator.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -42,11 +42,9 @@ export interface TypedOperatorOperator { /** * Check if a given object implements the TypedOperatorOperator interface. */ -export function instanceOfTypedOperatorOperator(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfTypedOperatorOperator(value: object): value is TypedOperatorOperator { + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function TypedOperatorOperatorFromJSON(json: any): TypedOperatorOperator { @@ -54,29 +52,31 @@ export function TypedOperatorOperatorFromJSON(json: any): TypedOperatorOperator } export function TypedOperatorOperatorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedOperatorOperator { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'params': !exists(json, 'params') ? undefined : json['params'], - 'sources': !exists(json, 'sources') ? undefined : json['sources'], + 'params': json['params'] == null ? undefined : json['params'], + 'sources': json['sources'] == null ? undefined : json['sources'], 'type': json['type'], }; } -export function TypedOperatorOperatorToJSON(value?: TypedOperatorOperator | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedOperatorOperatorToJSON(json: any): TypedOperatorOperator { + return TypedOperatorOperatorToJSONTyped(json, false); +} + +export function TypedOperatorOperatorToJSONTyped(value?: TypedOperatorOperator | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'params': value.params, - 'sources': value.sources, - 'type': value.type, + 'params': value['params'], + 'sources': value['sources'], + 'type': value['type'], }; } diff --git a/typescript/src/models/TypedPlotResultDescriptor.ts b/typescript/src/models/TypedPlotResultDescriptor.ts index 291b4ce6..b3d424a9 100644 --- a/typescript/src/models/TypedPlotResultDescriptor.ts +++ b/typescript/src/models/TypedPlotResultDescriptor.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { BoundingBox2D } from './BoundingBox2D'; -import { - BoundingBox2DFromJSON, - BoundingBox2DFromJSONTyped, - BoundingBox2DToJSON, -} from './BoundingBox2D'; +import { mapValues } from '../runtime'; import type { TimeInterval } from './TimeInterval'; import { TimeIntervalFromJSON, TimeIntervalFromJSONTyped, TimeIntervalToJSON, + TimeIntervalToJSONTyped, } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; +import { + BoundingBox2DFromJSON, + BoundingBox2DFromJSONTyped, + BoundingBox2DToJSON, + BoundingBox2DToJSONTyped, +} from './BoundingBox2D'; /** * A `ResultDescriptor` for plot queries @@ -71,12 +73,10 @@ export type TypedPlotResultDescriptorTypeEnum = typeof TypedPlotResultDescriptor /** * Check if a given object implements the TypedPlotResultDescriptor interface. */ -export function instanceOfTypedPlotResultDescriptor(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfTypedPlotResultDescriptor(value: object): value is TypedPlotResultDescriptor { + if (!('spatialReference' in value) || value['spatialReference'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function TypedPlotResultDescriptorFromJSON(json: any): TypedPlotResultDescriptor { @@ -84,31 +84,33 @@ export function TypedPlotResultDescriptorFromJSON(json: any): TypedPlotResultDes } export function TypedPlotResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedPlotResultDescriptor { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !exists(json, 'bbox') ? undefined : BoundingBox2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : BoundingBox2DFromJSON(json['bbox']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), 'type': json['type'], }; } -export function TypedPlotResultDescriptorToJSON(value?: TypedPlotResultDescriptor | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedPlotResultDescriptorToJSON(json: any): TypedPlotResultDescriptor { + return TypedPlotResultDescriptorToJSONTyped(json, false); +} + +export function TypedPlotResultDescriptorToJSONTyped(value?: TypedPlotResultDescriptor | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bbox': BoundingBox2DToJSON(value.bbox), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), - 'type': value.type, + 'bbox': BoundingBox2DToJSON(value['bbox']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), + 'type': value['type'], }; } diff --git a/typescript/src/models/TypedRasterResultDescriptor.ts b/typescript/src/models/TypedRasterResultDescriptor.ts index 08b0e5fc..4371c41f 100644 --- a/typescript/src/models/TypedRasterResultDescriptor.ts +++ b/typescript/src/models/TypedRasterResultDescriptor.ts @@ -12,37 +12,42 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; +import type { SpatialResolution } from './SpatialResolution'; +import { + SpatialResolutionFromJSON, + SpatialResolutionFromJSONTyped, + SpatialResolutionToJSON, + SpatialResolutionToJSONTyped, +} from './SpatialResolution'; +import type { TimeInterval } from './TimeInterval'; +import { + TimeIntervalFromJSON, + TimeIntervalFromJSONTyped, + TimeIntervalToJSON, + TimeIntervalToJSONTyped, +} from './TimeInterval'; import type { RasterBandDescriptor } from './RasterBandDescriptor'; import { RasterBandDescriptorFromJSON, RasterBandDescriptorFromJSONTyped, RasterBandDescriptorToJSON, + RasterBandDescriptorToJSONTyped, } from './RasterBandDescriptor'; import type { RasterDataType } from './RasterDataType'; import { RasterDataTypeFromJSON, RasterDataTypeFromJSONTyped, RasterDataTypeToJSON, + RasterDataTypeToJSONTyped, } from './RasterDataType'; import type { SpatialPartition2D } from './SpatialPartition2D'; import { SpatialPartition2DFromJSON, SpatialPartition2DFromJSONTyped, SpatialPartition2DToJSON, + SpatialPartition2DToJSONTyped, } from './SpatialPartition2D'; -import type { SpatialResolution } from './SpatialResolution'; -import { - SpatialResolutionFromJSON, - SpatialResolutionFromJSONTyped, - SpatialResolutionToJSON, -} from './SpatialResolution'; -import type { TimeInterval } from './TimeInterval'; -import { - TimeIntervalFromJSON, - TimeIntervalFromJSONTyped, - TimeIntervalToJSON, -} from './TimeInterval'; /** * A `ResultDescriptor` for raster queries @@ -107,14 +112,12 @@ export type TypedRasterResultDescriptorTypeEnum = typeof TypedRasterResultDescri /** * Check if a given object implements the TypedRasterResultDescriptor interface. */ -export function instanceOfTypedRasterResultDescriptor(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "bands" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfTypedRasterResultDescriptor(value: object): value is TypedRasterResultDescriptor { + if (!('bands' in value) || value['bands'] === undefined) return false; + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function TypedRasterResultDescriptorFromJSON(json: any): TypedRasterResultDescriptor { @@ -122,37 +125,39 @@ export function TypedRasterResultDescriptorFromJSON(json: any): TypedRasterResul } export function TypedRasterResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedRasterResultDescriptor { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bands': ((json['bands'] as Array).map(RasterBandDescriptorFromJSON)), - 'bbox': !exists(json, 'bbox') ? undefined : SpatialPartition2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : SpatialPartition2DFromJSON(json['bbox']), 'dataType': RasterDataTypeFromJSON(json['dataType']), - 'resolution': !exists(json, 'resolution') ? undefined : SpatialResolutionFromJSON(json['resolution']), + 'resolution': json['resolution'] == null ? undefined : SpatialResolutionFromJSON(json['resolution']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), 'type': json['type'], }; } -export function TypedRasterResultDescriptorToJSON(value?: TypedRasterResultDescriptor | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedRasterResultDescriptorToJSON(json: any): TypedRasterResultDescriptor { + return TypedRasterResultDescriptorToJSONTyped(json, false); +} + +export function TypedRasterResultDescriptorToJSONTyped(value?: TypedRasterResultDescriptor | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bands': ((value.bands as Array).map(RasterBandDescriptorToJSON)), - 'bbox': SpatialPartition2DToJSON(value.bbox), - 'dataType': RasterDataTypeToJSON(value.dataType), - 'resolution': SpatialResolutionToJSON(value.resolution), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), - 'type': value.type, + 'bands': ((value['bands'] as Array).map(RasterBandDescriptorToJSON)), + 'bbox': SpatialPartition2DToJSON(value['bbox']), + 'dataType': RasterDataTypeToJSON(value['dataType']), + 'resolution': SpatialResolutionToJSON(value['resolution']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), + 'type': value['type'], }; } diff --git a/typescript/src/models/TypedResultDescriptor.ts b/typescript/src/models/TypedResultDescriptor.ts index 39e35f81..92d940f1 100644 --- a/typescript/src/models/TypedResultDescriptor.ts +++ b/typescript/src/models/TypedResultDescriptor.ts @@ -12,22 +12,22 @@ * Do not edit the class manually. */ +import type { TypedPlotResultDescriptor } from './TypedPlotResultDescriptor'; import { - TypedPlotResultDescriptor, instanceOfTypedPlotResultDescriptor, TypedPlotResultDescriptorFromJSON, TypedPlotResultDescriptorFromJSONTyped, TypedPlotResultDescriptorToJSON, } from './TypedPlotResultDescriptor'; +import type { TypedRasterResultDescriptor } from './TypedRasterResultDescriptor'; import { - TypedRasterResultDescriptor, instanceOfTypedRasterResultDescriptor, TypedRasterResultDescriptorFromJSON, TypedRasterResultDescriptorFromJSONTyped, TypedRasterResultDescriptorToJSON, } from './TypedRasterResultDescriptor'; +import type { TypedVectorResultDescriptor } from './TypedVectorResultDescriptor'; import { - TypedVectorResultDescriptor, instanceOfTypedVectorResultDescriptor, TypedVectorResultDescriptorFromJSON, TypedVectorResultDescriptorFromJSONTyped, @@ -46,35 +46,36 @@ export function TypedResultDescriptorFromJSON(json: any): TypedResultDescriptor } export function TypedResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedResultDescriptor { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } switch (json['type']) { case 'plot': - return {...TypedPlotResultDescriptorFromJSONTyped(json, true), type: 'plot'}; + return Object.assign({}, TypedPlotResultDescriptorFromJSONTyped(json, true), { type: 'plot' } as const); case 'raster': - return {...TypedRasterResultDescriptorFromJSONTyped(json, true), type: 'raster'}; + return Object.assign({}, TypedRasterResultDescriptorFromJSONTyped(json, true), { type: 'raster' } as const); case 'vector': - return {...TypedVectorResultDescriptorFromJSONTyped(json, true), type: 'vector'}; + return Object.assign({}, TypedVectorResultDescriptorFromJSONTyped(json, true), { type: 'vector' } as const); default: throw new Error(`No variant of TypedResultDescriptor exists with 'type=${json['type']}'`); } } -export function TypedResultDescriptorToJSON(value?: TypedResultDescriptor | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedResultDescriptorToJSON(json: any): any { + return TypedResultDescriptorToJSONTyped(json, false); +} + +export function TypedResultDescriptorToJSONTyped(value?: TypedResultDescriptor | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } switch (value['type']) { case 'plot': - return TypedPlotResultDescriptorToJSON(value); + return Object.assign({}, TypedPlotResultDescriptorToJSON(value), { type: 'plot' } as const); case 'raster': - return TypedRasterResultDescriptorToJSON(value); + return Object.assign({}, TypedRasterResultDescriptorToJSON(value), { type: 'raster' } as const); case 'vector': - return TypedVectorResultDescriptorToJSON(value); + return Object.assign({}, TypedVectorResultDescriptorToJSON(value), { type: 'vector' } as const); default: throw new Error(`No variant of TypedResultDescriptor exists with 'type=${value['type']}'`); } diff --git a/typescript/src/models/TypedVectorResultDescriptor.ts b/typescript/src/models/TypedVectorResultDescriptor.ts index 9f9f81e1..4d9f4284 100644 --- a/typescript/src/models/TypedVectorResultDescriptor.ts +++ b/typescript/src/models/TypedVectorResultDescriptor.ts @@ -12,31 +12,35 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { BoundingBox2D } from './BoundingBox2D'; +import { mapValues } from '../runtime'; +import type { VectorDataType } from './VectorDataType'; import { - BoundingBox2DFromJSON, - BoundingBox2DFromJSONTyped, - BoundingBox2DToJSON, -} from './BoundingBox2D'; + VectorDataTypeFromJSON, + VectorDataTypeFromJSONTyped, + VectorDataTypeToJSON, + VectorDataTypeToJSONTyped, +} from './VectorDataType'; import type { TimeInterval } from './TimeInterval'; import { TimeIntervalFromJSON, TimeIntervalFromJSONTyped, TimeIntervalToJSON, + TimeIntervalToJSONTyped, } from './TimeInterval'; import type { VectorColumnInfo } from './VectorColumnInfo'; import { VectorColumnInfoFromJSON, VectorColumnInfoFromJSONTyped, VectorColumnInfoToJSON, + VectorColumnInfoToJSONTyped, } from './VectorColumnInfo'; -import type { VectorDataType } from './VectorDataType'; +import type { BoundingBox2D } from './BoundingBox2D'; import { - VectorDataTypeFromJSON, - VectorDataTypeFromJSONTyped, - VectorDataTypeToJSON, -} from './VectorDataType'; + BoundingBox2DFromJSON, + BoundingBox2DFromJSONTyped, + BoundingBox2DToJSON, + BoundingBox2DToJSONTyped, +} from './BoundingBox2D'; /** * @@ -95,14 +99,12 @@ export type TypedVectorResultDescriptorTypeEnum = typeof TypedVectorResultDescri /** * Check if a given object implements the TypedVectorResultDescriptor interface. */ -export function instanceOfTypedVectorResultDescriptor(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "columns" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfTypedVectorResultDescriptor(value: object): value is TypedVectorResultDescriptor { + if (!('columns' in value) || value['columns'] === undefined) return false; + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function TypedVectorResultDescriptorFromJSON(json: any): TypedVectorResultDescriptor { @@ -110,35 +112,37 @@ export function TypedVectorResultDescriptorFromJSON(json: any): TypedVectorResul } export function TypedVectorResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): TypedVectorResultDescriptor { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !exists(json, 'bbox') ? undefined : BoundingBox2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : BoundingBox2DFromJSON(json['bbox']), 'columns': (mapValues(json['columns'], VectorColumnInfoFromJSON)), 'dataType': VectorDataTypeFromJSON(json['dataType']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), 'type': json['type'], }; } -export function TypedVectorResultDescriptorToJSON(value?: TypedVectorResultDescriptor | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function TypedVectorResultDescriptorToJSON(json: any): TypedVectorResultDescriptor { + return TypedVectorResultDescriptorToJSONTyped(json, false); +} + +export function TypedVectorResultDescriptorToJSONTyped(value?: TypedVectorResultDescriptor | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bbox': BoundingBox2DToJSON(value.bbox), - 'columns': (mapValues(value.columns, VectorColumnInfoToJSON)), - 'dataType': VectorDataTypeToJSON(value.dataType), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), - 'type': value.type, + 'bbox': BoundingBox2DToJSON(value['bbox']), + 'columns': (mapValues(value['columns'], VectorColumnInfoToJSON)), + 'dataType': VectorDataTypeToJSON(value['dataType']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), + 'type': value['type'], }; } diff --git a/typescript/src/models/UnitlessMeasurement.ts b/typescript/src/models/UnitlessMeasurement.ts index d0278107..ebe7fd5a 100644 --- a/typescript/src/models/UnitlessMeasurement.ts +++ b/typescript/src/models/UnitlessMeasurement.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -32,9 +32,7 @@ export interface UnitlessMeasurement { * @export */ export const UnitlessMeasurementTypeEnum = { - Unitless: 'unitless', - Continuous: 'continuous', - Classification: 'classification' + Unitless: 'unitless' } as const; export type UnitlessMeasurementTypeEnum = typeof UnitlessMeasurementTypeEnum[keyof typeof UnitlessMeasurementTypeEnum]; @@ -42,11 +40,9 @@ export type UnitlessMeasurementTypeEnum = typeof UnitlessMeasurementTypeEnum[key /** * Check if a given object implements the UnitlessMeasurement interface. */ -export function instanceOfUnitlessMeasurement(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfUnitlessMeasurement(value: object): value is UnitlessMeasurement { + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function UnitlessMeasurementFromJSON(json: any): UnitlessMeasurement { @@ -54,7 +50,7 @@ export function UnitlessMeasurementFromJSON(json: any): UnitlessMeasurement { } export function UnitlessMeasurementFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnitlessMeasurement { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -63,16 +59,18 @@ export function UnitlessMeasurementFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function UnitlessMeasurementToJSON(value?: UnitlessMeasurement | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UnitlessMeasurementToJSON(json: any): UnitlessMeasurement { + return UnitlessMeasurementToJSONTyped(json, false); +} + +export function UnitlessMeasurementToJSONTyped(value?: UnitlessMeasurement | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'type': value.type, + 'type': value['type'], }; } diff --git a/typescript/src/models/UnixTimeStampType.ts b/typescript/src/models/UnixTimeStampType.ts index cef6eb04..8f75698a 100644 --- a/typescript/src/models/UnixTimeStampType.ts +++ b/typescript/src/models/UnixTimeStampType.ts @@ -24,6 +24,17 @@ export const UnixTimeStampType = { export type UnixTimeStampType = typeof UnixTimeStampType[keyof typeof UnixTimeStampType]; +export function instanceOfUnixTimeStampType(value: any): boolean { + for (const key in UnixTimeStampType) { + if (Object.prototype.hasOwnProperty.call(UnixTimeStampType, key)) { + if (UnixTimeStampType[key as keyof typeof UnixTimeStampType] === value) { + return true; + } + } + } + return false; +} + export function UnixTimeStampTypeFromJSON(json: any): UnixTimeStampType { return UnixTimeStampTypeFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function UnixTimeStampTypeToJSON(value?: UnixTimeStampType | null): any { return value as any; } +export function UnixTimeStampTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): UnixTimeStampType { + return value as UnixTimeStampType; +} + diff --git a/typescript/src/models/UpdateDataset.ts b/typescript/src/models/UpdateDataset.ts index 31196975..f88f57a6 100644 --- a/typescript/src/models/UpdateDataset.ts +++ b/typescript/src/models/UpdateDataset.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -48,14 +48,12 @@ export interface UpdateDataset { /** * Check if a given object implements the UpdateDataset interface. */ -export function instanceOfUpdateDataset(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "displayName" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "tags" in value; - - return isInstance; +export function instanceOfUpdateDataset(value: object): value is UpdateDataset { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('tags' in value) || value['tags'] === undefined) return false; + return true; } export function UpdateDatasetFromJSON(json: any): UpdateDataset { @@ -63,7 +61,7 @@ export function UpdateDatasetFromJSON(json: any): UpdateDataset { } export function UpdateDatasetFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateDataset { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,19 +73,21 @@ export function UpdateDatasetFromJSONTyped(json: any, ignoreDiscriminator: boole }; } -export function UpdateDatasetToJSON(value?: UpdateDataset | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UpdateDatasetToJSON(json: any): UpdateDataset { + return UpdateDatasetToJSONTyped(json, false); +} + +export function UpdateDatasetToJSONTyped(value?: UpdateDataset | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'display_name': value.displayName, - 'name': value.name, - 'tags': value.tags, + 'description': value['description'], + 'display_name': value['displayName'], + 'name': value['name'], + 'tags': value['tags'], }; } diff --git a/typescript/src/models/UpdateLayer.ts b/typescript/src/models/UpdateLayer.ts index f40a5a19..3bf5f7a4 100644 --- a/typescript/src/models/UpdateLayer.ts +++ b/typescript/src/models/UpdateLayer.ts @@ -12,18 +12,20 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Symbology } from './Symbology'; import { SymbologyFromJSON, SymbologyFromJSONTyped, SymbologyToJSON, + SymbologyToJSONTyped, } from './Symbology'; import type { Workflow } from './Workflow'; import { WorkflowFromJSON, WorkflowFromJSONTyped, WorkflowToJSON, + WorkflowToJSONTyped, } from './Workflow'; /** @@ -73,13 +75,11 @@ export interface UpdateLayer { /** * Check if a given object implements the UpdateLayer interface. */ -export function instanceOfUpdateLayer(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "workflow" in value; - - return isInstance; +export function instanceOfUpdateLayer(value: object): value is UpdateLayer { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('workflow' in value) || value['workflow'] === undefined) return false; + return true; } export function UpdateLayerFromJSON(json: any): UpdateLayer { @@ -87,35 +87,37 @@ export function UpdateLayerFromJSON(json: any): UpdateLayer { } export function UpdateLayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateLayer { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], - 'metadata': !exists(json, 'metadata') ? undefined : json['metadata'], + 'metadata': json['metadata'] == null ? undefined : json['metadata'], 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], - 'symbology': !exists(json, 'symbology') ? undefined : SymbologyFromJSON(json['symbology']), + 'properties': json['properties'] == null ? undefined : json['properties'], + 'symbology': json['symbology'] == null ? undefined : SymbologyFromJSON(json['symbology']), 'workflow': WorkflowFromJSON(json['workflow']), }; } -export function UpdateLayerToJSON(value?: UpdateLayer | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UpdateLayerToJSON(json: any): UpdateLayer { + return UpdateLayerToJSONTyped(json, false); +} + +export function UpdateLayerToJSONTyped(value?: UpdateLayer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'metadata': value.metadata, - 'name': value.name, - 'properties': value.properties, - 'symbology': SymbologyToJSON(value.symbology), - 'workflow': WorkflowToJSON(value.workflow), + 'description': value['description'], + 'metadata': value['metadata'], + 'name': value['name'], + 'properties': value['properties'], + 'symbology': SymbologyToJSON(value['symbology']), + 'workflow': WorkflowToJSON(value['workflow']), }; } diff --git a/typescript/src/models/UpdateLayerCollection.ts b/typescript/src/models/UpdateLayerCollection.ts index fb314925..d36fe85b 100644 --- a/typescript/src/models/UpdateLayerCollection.ts +++ b/typescript/src/models/UpdateLayerCollection.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -42,12 +42,10 @@ export interface UpdateLayerCollection { /** * Check if a given object implements the UpdateLayerCollection interface. */ -export function instanceOfUpdateLayerCollection(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "name" in value; - - return isInstance; +export function instanceOfUpdateLayerCollection(value: object): value is UpdateLayerCollection { + if (!('description' in value) || value['description'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + return true; } export function UpdateLayerCollectionFromJSON(json: any): UpdateLayerCollection { @@ -55,29 +53,31 @@ export function UpdateLayerCollectionFromJSON(json: any): UpdateLayerCollection } export function UpdateLayerCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateLayerCollection { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'description': json['description'], 'name': json['name'], - 'properties': !exists(json, 'properties') ? undefined : json['properties'], + 'properties': json['properties'] == null ? undefined : json['properties'], }; } -export function UpdateLayerCollectionToJSON(value?: UpdateLayerCollection | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UpdateLayerCollectionToJSON(json: any): UpdateLayerCollection { + return UpdateLayerCollectionToJSONTyped(json, false); +} + +export function UpdateLayerCollectionToJSONTyped(value?: UpdateLayerCollection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'description': value.description, - 'name': value.name, - 'properties': value.properties, + 'description': value['description'], + 'name': value['name'], + 'properties': value['properties'], }; } diff --git a/typescript/src/models/UpdateProject.ts b/typescript/src/models/UpdateProject.ts index a676a6be..5dbed48d 100644 --- a/typescript/src/models/UpdateProject.ts +++ b/typescript/src/models/UpdateProject.ts @@ -12,31 +12,35 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { LayerUpdate } from './LayerUpdate'; +import { mapValues } from '../runtime'; +import type { TimeStep } from './TimeStep'; import { - LayerUpdateFromJSON, - LayerUpdateFromJSONTyped, - LayerUpdateToJSON, -} from './LayerUpdate'; + TimeStepFromJSON, + TimeStepFromJSONTyped, + TimeStepToJSON, + TimeStepToJSONTyped, +} from './TimeStep'; import type { PlotUpdate } from './PlotUpdate'; import { PlotUpdateFromJSON, PlotUpdateFromJSONTyped, PlotUpdateToJSON, + PlotUpdateToJSONTyped, } from './PlotUpdate'; import type { STRectangle } from './STRectangle'; import { STRectangleFromJSON, STRectangleFromJSONTyped, STRectangleToJSON, + STRectangleToJSONTyped, } from './STRectangle'; -import type { TimeStep } from './TimeStep'; +import type { LayerUpdate } from './LayerUpdate'; import { - TimeStepFromJSON, - TimeStepFromJSONTyped, - TimeStepToJSON, -} from './TimeStep'; + LayerUpdateFromJSON, + LayerUpdateFromJSONTyped, + LayerUpdateToJSON, + LayerUpdateToJSONTyped, +} from './LayerUpdate'; /** * @@ -91,11 +95,9 @@ export interface UpdateProject { /** * Check if a given object implements the UpdateProject interface. */ -export function instanceOfUpdateProject(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - - return isInstance; +export function instanceOfUpdateProject(value: object): value is UpdateProject { + if (!('id' in value) || value['id'] === undefined) return false; + return true; } export function UpdateProjectFromJSON(json: any): UpdateProject { @@ -103,37 +105,39 @@ export function UpdateProjectFromJSON(json: any): UpdateProject { } export function UpdateProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateProject { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bounds': !exists(json, 'bounds') ? undefined : STRectangleFromJSON(json['bounds']), - 'description': !exists(json, 'description') ? undefined : json['description'], + 'bounds': json['bounds'] == null ? undefined : STRectangleFromJSON(json['bounds']), + 'description': json['description'] == null ? undefined : json['description'], 'id': json['id'], - 'layers': !exists(json, 'layers') ? undefined : (json['layers'] === null ? null : (json['layers'] as Array).map(LayerUpdateFromJSON)), - 'name': !exists(json, 'name') ? undefined : json['name'], - 'plots': !exists(json, 'plots') ? undefined : (json['plots'] === null ? null : (json['plots'] as Array).map(PlotUpdateFromJSON)), - 'timeStep': !exists(json, 'timeStep') ? undefined : TimeStepFromJSON(json['timeStep']), + 'layers': json['layers'] == null ? undefined : ((json['layers'] as Array).map(LayerUpdateFromJSON)), + 'name': json['name'] == null ? undefined : json['name'], + 'plots': json['plots'] == null ? undefined : ((json['plots'] as Array).map(PlotUpdateFromJSON)), + 'timeStep': json['timeStep'] == null ? undefined : TimeStepFromJSON(json['timeStep']), }; } -export function UpdateProjectToJSON(value?: UpdateProject | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UpdateProjectToJSON(json: any): UpdateProject { + return UpdateProjectToJSONTyped(json, false); +} + +export function UpdateProjectToJSONTyped(value?: UpdateProject | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bounds': STRectangleToJSON(value.bounds), - 'description': value.description, - 'id': value.id, - 'layers': value.layers === undefined ? undefined : (value.layers === null ? null : (value.layers as Array).map(LayerUpdateToJSON)), - 'name': value.name, - 'plots': value.plots === undefined ? undefined : (value.plots === null ? null : (value.plots as Array).map(PlotUpdateToJSON)), - 'timeStep': TimeStepToJSON(value.timeStep), + 'bounds': STRectangleToJSON(value['bounds']), + 'description': value['description'], + 'id': value['id'], + 'layers': value['layers'] == null ? undefined : ((value['layers'] as Array).map(LayerUpdateToJSON)), + 'name': value['name'], + 'plots': value['plots'] == null ? undefined : ((value['plots'] as Array).map(PlotUpdateToJSON)), + 'timeStep': TimeStepToJSON(value['timeStep']), }; } diff --git a/typescript/src/models/UpdateQuota.ts b/typescript/src/models/UpdateQuota.ts index fe39970b..4d5461d0 100644 --- a/typescript/src/models/UpdateQuota.ts +++ b/typescript/src/models/UpdateQuota.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface UpdateQuota { /** * Check if a given object implements the UpdateQuota interface. */ -export function instanceOfUpdateQuota(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "available" in value; - - return isInstance; +export function instanceOfUpdateQuota(value: object): value is UpdateQuota { + if (!('available' in value) || value['available'] === undefined) return false; + return true; } export function UpdateQuotaFromJSON(json: any): UpdateQuota { @@ -42,7 +40,7 @@ export function UpdateQuotaFromJSON(json: any): UpdateQuota { } export function UpdateQuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateQuota { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function UpdateQuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean }; } -export function UpdateQuotaToJSON(value?: UpdateQuota | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UpdateQuotaToJSON(json: any): UpdateQuota { + return UpdateQuotaToJSONTyped(json, false); +} + +export function UpdateQuotaToJSONTyped(value?: UpdateQuota | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'available': value.available, + 'available': value['available'], }; } diff --git a/typescript/src/models/UploadFileLayersResponse.ts b/typescript/src/models/UploadFileLayersResponse.ts index bc8e5917..659b9e43 100644 --- a/typescript/src/models/UploadFileLayersResponse.ts +++ b/typescript/src/models/UploadFileLayersResponse.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface UploadFileLayersResponse { /** * Check if a given object implements the UploadFileLayersResponse interface. */ -export function instanceOfUploadFileLayersResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "layers" in value; - - return isInstance; +export function instanceOfUploadFileLayersResponse(value: object): value is UploadFileLayersResponse { + if (!('layers' in value) || value['layers'] === undefined) return false; + return true; } export function UploadFileLayersResponseFromJSON(json: any): UploadFileLayersResponse { @@ -42,7 +40,7 @@ export function UploadFileLayersResponseFromJSON(json: any): UploadFileLayersRes } export function UploadFileLayersResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UploadFileLayersResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function UploadFileLayersResponseFromJSONTyped(json: any, ignoreDiscrimin }; } -export function UploadFileLayersResponseToJSON(value?: UploadFileLayersResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UploadFileLayersResponseToJSON(json: any): UploadFileLayersResponse { + return UploadFileLayersResponseToJSONTyped(json, false); +} + +export function UploadFileLayersResponseToJSONTyped(value?: UploadFileLayersResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'layers': value.layers, + 'layers': value['layers'], }; } diff --git a/typescript/src/models/UploadFilesResponse.ts b/typescript/src/models/UploadFilesResponse.ts index 3e65a89c..aab62aa0 100644 --- a/typescript/src/models/UploadFilesResponse.ts +++ b/typescript/src/models/UploadFilesResponse.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface UploadFilesResponse { /** * Check if a given object implements the UploadFilesResponse interface. */ -export function instanceOfUploadFilesResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "files" in value; - - return isInstance; +export function instanceOfUploadFilesResponse(value: object): value is UploadFilesResponse { + if (!('files' in value) || value['files'] === undefined) return false; + return true; } export function UploadFilesResponseFromJSON(json: any): UploadFilesResponse { @@ -42,7 +40,7 @@ export function UploadFilesResponseFromJSON(json: any): UploadFilesResponse { } export function UploadFilesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UploadFilesResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function UploadFilesResponseFromJSONTyped(json: any, ignoreDiscriminator: }; } -export function UploadFilesResponseToJSON(value?: UploadFilesResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UploadFilesResponseToJSON(json: any): UploadFilesResponse { + return UploadFilesResponseToJSONTyped(json, false); +} + +export function UploadFilesResponseToJSONTyped(value?: UploadFilesResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'files': value.files, + 'files': value['files'], }; } diff --git a/typescript/src/models/UsageSummaryGranularity.ts b/typescript/src/models/UsageSummaryGranularity.ts index 85d3d84b..2aa87838 100644 --- a/typescript/src/models/UsageSummaryGranularity.ts +++ b/typescript/src/models/UsageSummaryGranularity.ts @@ -27,6 +27,17 @@ export const UsageSummaryGranularity = { export type UsageSummaryGranularity = typeof UsageSummaryGranularity[keyof typeof UsageSummaryGranularity]; +export function instanceOfUsageSummaryGranularity(value: any): boolean { + for (const key in UsageSummaryGranularity) { + if (Object.prototype.hasOwnProperty.call(UsageSummaryGranularity, key)) { + if (UsageSummaryGranularity[key as keyof typeof UsageSummaryGranularity] === value) { + return true; + } + } + } + return false; +} + export function UsageSummaryGranularityFromJSON(json: any): UsageSummaryGranularity { return UsageSummaryGranularityFromJSONTyped(json, false); } @@ -39,3 +50,7 @@ export function UsageSummaryGranularityToJSON(value?: UsageSummaryGranularity | return value as any; } +export function UsageSummaryGranularityToJSONTyped(value: any, ignoreDiscriminator: boolean): UsageSummaryGranularity { + return value as UsageSummaryGranularity; +} + diff --git a/typescript/src/models/UserCredentials.ts b/typescript/src/models/UserCredentials.ts index 66697de0..6975df0b 100644 --- a/typescript/src/models/UserCredentials.ts +++ b/typescript/src/models/UserCredentials.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,12 +36,10 @@ export interface UserCredentials { /** * Check if a given object implements the UserCredentials interface. */ -export function instanceOfUserCredentials(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "email" in value; - isInstance = isInstance && "password" in value; - - return isInstance; +export function instanceOfUserCredentials(value: object): value is UserCredentials { + if (!('email' in value) || value['email'] === undefined) return false; + if (!('password' in value) || value['password'] === undefined) return false; + return true; } export function UserCredentialsFromJSON(json: any): UserCredentials { @@ -49,7 +47,7 @@ export function UserCredentialsFromJSON(json: any): UserCredentials { } export function UserCredentialsFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserCredentials { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,17 +57,19 @@ export function UserCredentialsFromJSONTyped(json: any, ignoreDiscriminator: boo }; } -export function UserCredentialsToJSON(value?: UserCredentials | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserCredentialsToJSON(json: any): UserCredentials { + return UserCredentialsToJSONTyped(json, false); +} + +export function UserCredentialsToJSONTyped(value?: UserCredentials | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'email': value.email, - 'password': value.password, + 'email': value['email'], + 'password': value['password'], }; } diff --git a/typescript/src/models/UserInfo.ts b/typescript/src/models/UserInfo.ts index 1461dd49..d11b9274 100644 --- a/typescript/src/models/UserInfo.ts +++ b/typescript/src/models/UserInfo.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -42,11 +42,9 @@ export interface UserInfo { /** * Check if a given object implements the UserInfo interface. */ -export function instanceOfUserInfo(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - - return isInstance; +export function instanceOfUserInfo(value: object): value is UserInfo { + if (!('id' in value) || value['id'] === undefined) return false; + return true; } export function UserInfoFromJSON(json: any): UserInfo { @@ -54,29 +52,31 @@ export function UserInfoFromJSON(json: any): UserInfo { } export function UserInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserInfo { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'email': !exists(json, 'email') ? undefined : json['email'], + 'email': json['email'] == null ? undefined : json['email'], 'id': json['id'], - 'realName': !exists(json, 'realName') ? undefined : json['realName'], + 'realName': json['realName'] == null ? undefined : json['realName'], }; } -export function UserInfoToJSON(value?: UserInfo | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserInfoToJSON(json: any): UserInfo { + return UserInfoToJSONTyped(json, false); +} + +export function UserInfoToJSONTyped(value?: UserInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'email': value.email, - 'id': value.id, - 'realName': value.realName, + 'email': value['email'], + 'id': value['id'], + 'realName': value['realName'], }; } diff --git a/typescript/src/models/UserRegistration.ts b/typescript/src/models/UserRegistration.ts index 1c28e304..8651a845 100644 --- a/typescript/src/models/UserRegistration.ts +++ b/typescript/src/models/UserRegistration.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -42,13 +42,11 @@ export interface UserRegistration { /** * Check if a given object implements the UserRegistration interface. */ -export function instanceOfUserRegistration(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "email" in value; - isInstance = isInstance && "password" in value; - isInstance = isInstance && "realName" in value; - - return isInstance; +export function instanceOfUserRegistration(value: object): value is UserRegistration { + if (!('email' in value) || value['email'] === undefined) return false; + if (!('password' in value) || value['password'] === undefined) return false; + if (!('realName' in value) || value['realName'] === undefined) return false; + return true; } export function UserRegistrationFromJSON(json: any): UserRegistration { @@ -56,7 +54,7 @@ export function UserRegistrationFromJSON(json: any): UserRegistration { } export function UserRegistrationFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserRegistration { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,18 +65,20 @@ export function UserRegistrationFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function UserRegistrationToJSON(value?: UserRegistration | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserRegistrationToJSON(json: any): UserRegistration { + return UserRegistrationToJSONTyped(json, false); +} + +export function UserRegistrationToJSONTyped(value?: UserRegistration | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'email': value.email, - 'password': value.password, - 'realName': value.realName, + 'email': value['email'], + 'password': value['password'], + 'realName': value['realName'], }; } diff --git a/typescript/src/models/UserSession.ts b/typescript/src/models/UserSession.ts index 329ff59a..6f0115b3 100644 --- a/typescript/src/models/UserSession.ts +++ b/typescript/src/models/UserSession.ts @@ -12,18 +12,20 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { STRectangle } from './STRectangle'; import { STRectangleFromJSON, STRectangleFromJSONTyped, STRectangleToJSON, + STRectangleToJSONTyped, } from './STRectangle'; import type { UserInfo } from './UserInfo'; import { UserInfoFromJSON, UserInfoFromJSONTyped, UserInfoToJSON, + UserInfoToJSONTyped, } from './UserInfo'; /** @@ -79,15 +81,13 @@ export interface UserSession { /** * Check if a given object implements the UserSession interface. */ -export function instanceOfUserSession(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "created" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "roles" in value; - isInstance = isInstance && "user" in value; - isInstance = isInstance && "validUntil" in value; - - return isInstance; +export function instanceOfUserSession(value: object): value is UserSession { + if (!('created' in value) || value['created'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('roles' in value) || value['roles'] === undefined) return false; + if (!('user' in value) || value['user'] === undefined) return false; + if (!('validUntil' in value) || value['validUntil'] === undefined) return false; + return true; } export function UserSessionFromJSON(json: any): UserSession { @@ -95,37 +95,39 @@ export function UserSessionFromJSON(json: any): UserSession { } export function UserSessionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserSession { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'created': (new Date(json['created'])), 'id': json['id'], - 'project': !exists(json, 'project') ? undefined : json['project'], + 'project': json['project'] == null ? undefined : json['project'], 'roles': json['roles'], 'user': UserInfoFromJSON(json['user']), 'validUntil': (new Date(json['validUntil'])), - 'view': !exists(json, 'view') ? undefined : STRectangleFromJSON(json['view']), + 'view': json['view'] == null ? undefined : STRectangleFromJSON(json['view']), }; } -export function UserSessionToJSON(value?: UserSession | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function UserSessionToJSON(json: any): UserSession { + return UserSessionToJSONTyped(json, false); +} + +export function UserSessionToJSONTyped(value?: UserSession | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'created': (value.created.toISOString()), - 'id': value.id, - 'project': value.project, - 'roles': value.roles, - 'user': UserInfoToJSON(value.user), - 'validUntil': (value.validUntil.toISOString()), - 'view': STRectangleToJSON(value.view), + 'created': ((value['created']).toISOString()), + 'id': value['id'], + 'project': value['project'], + 'roles': value['roles'], + 'user': UserInfoToJSON(value['user']), + 'validUntil': ((value['validUntil']).toISOString()), + 'view': STRectangleToJSON(value['view']), }; } diff --git a/typescript/src/models/VectorColumnInfo.ts b/typescript/src/models/VectorColumnInfo.ts index 4ba165f5..25ffa4e7 100644 --- a/typescript/src/models/VectorColumnInfo.ts +++ b/typescript/src/models/VectorColumnInfo.ts @@ -12,19 +12,21 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { FeatureDataType } from './FeatureDataType'; -import { - FeatureDataTypeFromJSON, - FeatureDataTypeFromJSONTyped, - FeatureDataTypeToJSON, -} from './FeatureDataType'; +import { mapValues } from '../runtime'; import type { Measurement } from './Measurement'; import { MeasurementFromJSON, MeasurementFromJSONTyped, MeasurementToJSON, + MeasurementToJSONTyped, } from './Measurement'; +import type { FeatureDataType } from './FeatureDataType'; +import { + FeatureDataTypeFromJSON, + FeatureDataTypeFromJSONTyped, + FeatureDataTypeToJSON, + FeatureDataTypeToJSONTyped, +} from './FeatureDataType'; /** * @@ -46,15 +48,15 @@ export interface VectorColumnInfo { measurement: Measurement; } + + /** * Check if a given object implements the VectorColumnInfo interface. */ -export function instanceOfVectorColumnInfo(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "measurement" in value; - - return isInstance; +export function instanceOfVectorColumnInfo(value: object): value is VectorColumnInfo { + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('measurement' in value) || value['measurement'] === undefined) return false; + return true; } export function VectorColumnInfoFromJSON(json: any): VectorColumnInfo { @@ -62,7 +64,7 @@ export function VectorColumnInfoFromJSON(json: any): VectorColumnInfo { } export function VectorColumnInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): VectorColumnInfo { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -72,17 +74,19 @@ export function VectorColumnInfoFromJSONTyped(json: any, ignoreDiscriminator: bo }; } -export function VectorColumnInfoToJSON(value?: VectorColumnInfo | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function VectorColumnInfoToJSON(json: any): VectorColumnInfo { + return VectorColumnInfoToJSONTyped(json, false); +} + +export function VectorColumnInfoToJSONTyped(value?: VectorColumnInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'dataType': FeatureDataTypeToJSON(value.dataType), - 'measurement': MeasurementToJSON(value.measurement), + 'dataType': FeatureDataTypeToJSON(value['dataType']), + 'measurement': MeasurementToJSON(value['measurement']), }; } diff --git a/typescript/src/models/VectorDataType.ts b/typescript/src/models/VectorDataType.ts index 2d118901..6fd9e6c6 100644 --- a/typescript/src/models/VectorDataType.ts +++ b/typescript/src/models/VectorDataType.ts @@ -26,6 +26,17 @@ export const VectorDataType = { export type VectorDataType = typeof VectorDataType[keyof typeof VectorDataType]; +export function instanceOfVectorDataType(value: any): boolean { + for (const key in VectorDataType) { + if (Object.prototype.hasOwnProperty.call(VectorDataType, key)) { + if (VectorDataType[key as keyof typeof VectorDataType] === value) { + return true; + } + } + } + return false; +} + export function VectorDataTypeFromJSON(json: any): VectorDataType { return VectorDataTypeFromJSONTyped(json, false); } @@ -38,3 +49,7 @@ export function VectorDataTypeToJSON(value?: VectorDataType | null): any { return value as any; } +export function VectorDataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): VectorDataType { + return value as VectorDataType; +} + diff --git a/typescript/src/models/VectorQueryRectangle.ts b/typescript/src/models/VectorQueryRectangle.ts index b8401817..2f3b7256 100644 --- a/typescript/src/models/VectorQueryRectangle.ts +++ b/typescript/src/models/VectorQueryRectangle.ts @@ -12,25 +12,28 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { BoundingBox2D } from './BoundingBox2D'; -import { - BoundingBox2DFromJSON, - BoundingBox2DFromJSONTyped, - BoundingBox2DToJSON, -} from './BoundingBox2D'; +import { mapValues } from '../runtime'; import type { SpatialResolution } from './SpatialResolution'; import { SpatialResolutionFromJSON, SpatialResolutionFromJSONTyped, SpatialResolutionToJSON, + SpatialResolutionToJSONTyped, } from './SpatialResolution'; import type { TimeInterval } from './TimeInterval'; import { TimeIntervalFromJSON, TimeIntervalFromJSONTyped, TimeIntervalToJSON, + TimeIntervalToJSONTyped, } from './TimeInterval'; +import type { BoundingBox2D } from './BoundingBox2D'; +import { + BoundingBox2DFromJSON, + BoundingBox2DFromJSONTyped, + BoundingBox2DToJSON, + BoundingBox2DToJSONTyped, +} from './BoundingBox2D'; /** * A spatio-temporal rectangle with a specified resolution @@ -61,13 +64,11 @@ export interface VectorQueryRectangle { /** * Check if a given object implements the VectorQueryRectangle interface. */ -export function instanceOfVectorQueryRectangle(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "spatialBounds" in value; - isInstance = isInstance && "spatialResolution" in value; - isInstance = isInstance && "timeInterval" in value; - - return isInstance; +export function instanceOfVectorQueryRectangle(value: object): value is VectorQueryRectangle { + if (!('spatialBounds' in value) || value['spatialBounds'] === undefined) return false; + if (!('spatialResolution' in value) || value['spatialResolution'] === undefined) return false; + if (!('timeInterval' in value) || value['timeInterval'] === undefined) return false; + return true; } export function VectorQueryRectangleFromJSON(json: any): VectorQueryRectangle { @@ -75,7 +76,7 @@ export function VectorQueryRectangleFromJSON(json: any): VectorQueryRectangle { } export function VectorQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator: boolean): VectorQueryRectangle { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -86,18 +87,20 @@ export function VectorQueryRectangleFromJSONTyped(json: any, ignoreDiscriminator }; } -export function VectorQueryRectangleToJSON(value?: VectorQueryRectangle | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function VectorQueryRectangleToJSON(json: any): VectorQueryRectangle { + return VectorQueryRectangleToJSONTyped(json, false); +} + +export function VectorQueryRectangleToJSONTyped(value?: VectorQueryRectangle | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'spatialBounds': BoundingBox2DToJSON(value.spatialBounds), - 'spatialResolution': SpatialResolutionToJSON(value.spatialResolution), - 'timeInterval': TimeIntervalToJSON(value.timeInterval), + 'spatialBounds': BoundingBox2DToJSON(value['spatialBounds']), + 'spatialResolution': SpatialResolutionToJSON(value['spatialResolution']), + 'timeInterval': TimeIntervalToJSON(value['timeInterval']), }; } diff --git a/typescript/src/models/VectorResultDescriptor.ts b/typescript/src/models/VectorResultDescriptor.ts index e47063c7..4a7541d7 100644 --- a/typescript/src/models/VectorResultDescriptor.ts +++ b/typescript/src/models/VectorResultDescriptor.ts @@ -12,31 +12,35 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; -import type { BoundingBox2D } from './BoundingBox2D'; +import { mapValues } from '../runtime'; +import type { VectorDataType } from './VectorDataType'; import { - BoundingBox2DFromJSON, - BoundingBox2DFromJSONTyped, - BoundingBox2DToJSON, -} from './BoundingBox2D'; + VectorDataTypeFromJSON, + VectorDataTypeFromJSONTyped, + VectorDataTypeToJSON, + VectorDataTypeToJSONTyped, +} from './VectorDataType'; import type { TimeInterval } from './TimeInterval'; import { TimeIntervalFromJSON, TimeIntervalFromJSONTyped, TimeIntervalToJSON, + TimeIntervalToJSONTyped, } from './TimeInterval'; import type { VectorColumnInfo } from './VectorColumnInfo'; import { VectorColumnInfoFromJSON, VectorColumnInfoFromJSONTyped, VectorColumnInfoToJSON, + VectorColumnInfoToJSONTyped, } from './VectorColumnInfo'; -import type { VectorDataType } from './VectorDataType'; +import type { BoundingBox2D } from './BoundingBox2D'; import { - VectorDataTypeFromJSON, - VectorDataTypeFromJSONTyped, - VectorDataTypeToJSON, -} from './VectorDataType'; + BoundingBox2DFromJSON, + BoundingBox2DFromJSONTyped, + BoundingBox2DToJSON, + BoundingBox2DToJSONTyped, +} from './BoundingBox2D'; /** * @@ -76,16 +80,16 @@ export interface VectorResultDescriptor { time?: TimeInterval | null; } + + /** * Check if a given object implements the VectorResultDescriptor interface. */ -export function instanceOfVectorResultDescriptor(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "columns" in value; - isInstance = isInstance && "dataType" in value; - isInstance = isInstance && "spatialReference" in value; - - return isInstance; +export function instanceOfVectorResultDescriptor(value: object): value is VectorResultDescriptor { + if (!('columns' in value) || value['columns'] === undefined) return false; + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('spatialReference' in value) || value['spatialReference'] === undefined) return false; + return true; } export function VectorResultDescriptorFromJSON(json: any): VectorResultDescriptor { @@ -93,33 +97,35 @@ export function VectorResultDescriptorFromJSON(json: any): VectorResultDescripto } export function VectorResultDescriptorFromJSONTyped(json: any, ignoreDiscriminator: boolean): VectorResultDescriptor { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'bbox': !exists(json, 'bbox') ? undefined : BoundingBox2DFromJSON(json['bbox']), + 'bbox': json['bbox'] == null ? undefined : BoundingBox2DFromJSON(json['bbox']), 'columns': (mapValues(json['columns'], VectorColumnInfoFromJSON)), 'dataType': VectorDataTypeFromJSON(json['dataType']), 'spatialReference': json['spatialReference'], - 'time': !exists(json, 'time') ? undefined : TimeIntervalFromJSON(json['time']), + 'time': json['time'] == null ? undefined : TimeIntervalFromJSON(json['time']), }; } -export function VectorResultDescriptorToJSON(value?: VectorResultDescriptor | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function VectorResultDescriptorToJSON(json: any): VectorResultDescriptor { + return VectorResultDescriptorToJSONTyped(json, false); +} + +export function VectorResultDescriptorToJSONTyped(value?: VectorResultDescriptor | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bbox': BoundingBox2DToJSON(value.bbox), - 'columns': (mapValues(value.columns, VectorColumnInfoToJSON)), - 'dataType': VectorDataTypeToJSON(value.dataType), - 'spatialReference': value.spatialReference, - 'time': TimeIntervalToJSON(value.time), + 'bbox': BoundingBox2DToJSON(value['bbox']), + 'columns': (mapValues(value['columns'], VectorColumnInfoToJSON)), + 'dataType': VectorDataTypeToJSON(value['dataType']), + 'spatialReference': value['spatialReference'], + 'time': TimeIntervalToJSON(value['time']), }; } diff --git a/typescript/src/models/Volume.ts b/typescript/src/models/Volume.ts index 57d80047..7c29c4cb 100644 --- a/typescript/src/models/Volume.ts +++ b/typescript/src/models/Volume.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,11 +36,9 @@ export interface Volume { /** * Check if a given object implements the Volume interface. */ -export function instanceOfVolume(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "name" in value; - - return isInstance; +export function instanceOfVolume(value: object): value is Volume { + if (!('name' in value) || value['name'] === undefined) return false; + return true; } export function VolumeFromJSON(json: any): Volume { @@ -48,27 +46,29 @@ export function VolumeFromJSON(json: any): Volume { } export function VolumeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Volume { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'name': json['name'], - 'path': !exists(json, 'path') ? undefined : json['path'], + 'path': json['path'] == null ? undefined : json['path'], }; } -export function VolumeToJSON(value?: Volume | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function VolumeToJSON(json: any): Volume { + return VolumeToJSONTyped(json, false); +} + +export function VolumeToJSONTyped(value?: Volume | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'name': value.name, - 'path': value.path, + 'name': value['name'], + 'path': value['path'], }; } diff --git a/typescript/src/models/VolumeFileLayersResponse.ts b/typescript/src/models/VolumeFileLayersResponse.ts index 28aa2f87..b067dfb0 100644 --- a/typescript/src/models/VolumeFileLayersResponse.ts +++ b/typescript/src/models/VolumeFileLayersResponse.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -30,11 +30,9 @@ export interface VolumeFileLayersResponse { /** * Check if a given object implements the VolumeFileLayersResponse interface. */ -export function instanceOfVolumeFileLayersResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "layers" in value; - - return isInstance; +export function instanceOfVolumeFileLayersResponse(value: object): value is VolumeFileLayersResponse { + if (!('layers' in value) || value['layers'] === undefined) return false; + return true; } export function VolumeFileLayersResponseFromJSON(json: any): VolumeFileLayersResponse { @@ -42,7 +40,7 @@ export function VolumeFileLayersResponseFromJSON(json: any): VolumeFileLayersRes } export function VolumeFileLayersResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): VolumeFileLayersResponse { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -51,16 +49,18 @@ export function VolumeFileLayersResponseFromJSONTyped(json: any, ignoreDiscrimin }; } -export function VolumeFileLayersResponseToJSON(value?: VolumeFileLayersResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function VolumeFileLayersResponseToJSON(json: any): VolumeFileLayersResponse { + return VolumeFileLayersResponseToJSONTyped(json, false); +} + +export function VolumeFileLayersResponseToJSONTyped(value?: VolumeFileLayersResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'layers': value.layers, + 'layers': value['layers'], }; } diff --git a/typescript/src/models/WcsBoundingbox.ts b/typescript/src/models/WcsBoundingbox.ts index 6f99dfaf..07df170a 100644 --- a/typescript/src/models/WcsBoundingbox.ts +++ b/typescript/src/models/WcsBoundingbox.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -36,11 +36,9 @@ export interface WcsBoundingbox { /** * Check if a given object implements the WcsBoundingbox interface. */ -export function instanceOfWcsBoundingbox(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "bbox" in value; - - return isInstance; +export function instanceOfWcsBoundingbox(value: object): value is WcsBoundingbox { + if (!('bbox' in value) || value['bbox'] === undefined) return false; + return true; } export function WcsBoundingboxFromJSON(json: any): WcsBoundingbox { @@ -48,27 +46,29 @@ export function WcsBoundingboxFromJSON(json: any): WcsBoundingbox { } export function WcsBoundingboxFromJSONTyped(json: any, ignoreDiscriminator: boolean): WcsBoundingbox { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'bbox': json['bbox'], - 'spatialReference': !exists(json, 'spatial_reference') ? undefined : json['spatial_reference'], + 'spatialReference': json['spatial_reference'] == null ? undefined : json['spatial_reference'], }; } -export function WcsBoundingboxToJSON(value?: WcsBoundingbox | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function WcsBoundingboxToJSON(json: any): WcsBoundingbox { + return WcsBoundingboxToJSONTyped(json, false); +} + +export function WcsBoundingboxToJSONTyped(value?: WcsBoundingbox | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'bbox': value.bbox, - 'spatial_reference': value.spatialReference, + 'bbox': value['bbox'], + 'spatial_reference': value['spatialReference'], }; } diff --git a/typescript/src/models/WcsService.ts b/typescript/src/models/WcsService.ts index 89bdd256..0e534c46 100644 --- a/typescript/src/models/WcsService.ts +++ b/typescript/src/models/WcsService.ts @@ -23,6 +23,17 @@ export const WcsService = { export type WcsService = typeof WcsService[keyof typeof WcsService]; +export function instanceOfWcsService(value: any): boolean { + for (const key in WcsService) { + if (Object.prototype.hasOwnProperty.call(WcsService, key)) { + if (WcsService[key as keyof typeof WcsService] === value) { + return true; + } + } + } + return false; +} + export function WcsServiceFromJSON(json: any): WcsService { return WcsServiceFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function WcsServiceToJSON(value?: WcsService | null): any { return value as any; } +export function WcsServiceToJSONTyped(value: any, ignoreDiscriminator: boolean): WcsService { + return value as WcsService; +} + diff --git a/typescript/src/models/WcsVersion.ts b/typescript/src/models/WcsVersion.ts index 43385ced..71af8e2d 100644 --- a/typescript/src/models/WcsVersion.ts +++ b/typescript/src/models/WcsVersion.ts @@ -18,12 +18,23 @@ * @export */ export const WcsVersion = { - _0: '1.1.0', - _1: '1.1.1' + _110: '1.1.0', + _111: '1.1.1' } as const; export type WcsVersion = typeof WcsVersion[keyof typeof WcsVersion]; +export function instanceOfWcsVersion(value: any): boolean { + for (const key in WcsVersion) { + if (Object.prototype.hasOwnProperty.call(WcsVersion, key)) { + if (WcsVersion[key as keyof typeof WcsVersion] === value) { + return true; + } + } + } + return false; +} + export function WcsVersionFromJSON(json: any): WcsVersion { return WcsVersionFromJSONTyped(json, false); } @@ -36,3 +47,7 @@ export function WcsVersionToJSON(value?: WcsVersion | null): any { return value as any; } +export function WcsVersionToJSONTyped(value: any, ignoreDiscriminator: boolean): WcsVersion { + return value as WcsVersion; +} + diff --git a/typescript/src/models/WfsService.ts b/typescript/src/models/WfsService.ts index 2af42b47..6cd95600 100644 --- a/typescript/src/models/WfsService.ts +++ b/typescript/src/models/WfsService.ts @@ -23,6 +23,17 @@ export const WfsService = { export type WfsService = typeof WfsService[keyof typeof WfsService]; +export function instanceOfWfsService(value: any): boolean { + for (const key in WfsService) { + if (Object.prototype.hasOwnProperty.call(WfsService, key)) { + if (WfsService[key as keyof typeof WfsService] === value) { + return true; + } + } + } + return false; +} + export function WfsServiceFromJSON(json: any): WfsService { return WfsServiceFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function WfsServiceToJSON(value?: WfsService | null): any { return value as any; } +export function WfsServiceToJSONTyped(value: any, ignoreDiscriminator: boolean): WfsService { + return value as WfsService; +} + diff --git a/typescript/src/models/WfsVersion.ts b/typescript/src/models/WfsVersion.ts index acc8f82e..2fe64b30 100644 --- a/typescript/src/models/WfsVersion.ts +++ b/typescript/src/models/WfsVersion.ts @@ -23,6 +23,17 @@ export const WfsVersion = { export type WfsVersion = typeof WfsVersion[keyof typeof WfsVersion]; +export function instanceOfWfsVersion(value: any): boolean { + for (const key in WfsVersion) { + if (Object.prototype.hasOwnProperty.call(WfsVersion, key)) { + if (WfsVersion[key as keyof typeof WfsVersion] === value) { + return true; + } + } + } + return false; +} + export function WfsVersionFromJSON(json: any): WfsVersion { return WfsVersionFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function WfsVersionToJSON(value?: WfsVersion | null): any { return value as any; } +export function WfsVersionToJSONTyped(value: any, ignoreDiscriminator: boolean): WfsVersion { + return value as WfsVersion; +} + diff --git a/typescript/src/models/WmsService.ts b/typescript/src/models/WmsService.ts index b34355f5..ce374b0c 100644 --- a/typescript/src/models/WmsService.ts +++ b/typescript/src/models/WmsService.ts @@ -23,6 +23,17 @@ export const WmsService = { export type WmsService = typeof WmsService[keyof typeof WmsService]; +export function instanceOfWmsService(value: any): boolean { + for (const key in WmsService) { + if (Object.prototype.hasOwnProperty.call(WmsService, key)) { + if (WmsService[key as keyof typeof WmsService] === value) { + return true; + } + } + } + return false; +} + export function WmsServiceFromJSON(json: any): WmsService { return WmsServiceFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function WmsServiceToJSON(value?: WmsService | null): any { return value as any; } +export function WmsServiceToJSONTyped(value: any, ignoreDiscriminator: boolean): WmsService { + return value as WmsService; +} + diff --git a/typescript/src/models/WmsVersion.ts b/typescript/src/models/WmsVersion.ts index cf7c526d..35513d59 100644 --- a/typescript/src/models/WmsVersion.ts +++ b/typescript/src/models/WmsVersion.ts @@ -23,6 +23,17 @@ export const WmsVersion = { export type WmsVersion = typeof WmsVersion[keyof typeof WmsVersion]; +export function instanceOfWmsVersion(value: any): boolean { + for (const key in WmsVersion) { + if (Object.prototype.hasOwnProperty.call(WmsVersion, key)) { + if (WmsVersion[key as keyof typeof WmsVersion] === value) { + return true; + } + } + } + return false; +} + export function WmsVersionFromJSON(json: any): WmsVersion { return WmsVersionFromJSONTyped(json, false); } @@ -35,3 +46,7 @@ export function WmsVersionToJSON(value?: WmsVersion | null): any { return value as any; } +export function WmsVersionToJSONTyped(value: any, ignoreDiscriminator: boolean): WmsVersion { + return value as WmsVersion; +} + diff --git a/typescript/src/models/Workflow.ts b/typescript/src/models/Workflow.ts index cb7468c0..69549af4 100644 --- a/typescript/src/models/Workflow.ts +++ b/typescript/src/models/Workflow.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TypedOperatorOperator } from './TypedOperatorOperator'; import { TypedOperatorOperatorFromJSON, TypedOperatorOperatorFromJSONTyped, TypedOperatorOperatorToJSON, + TypedOperatorOperatorToJSONTyped, } from './TypedOperatorOperator'; /** @@ -55,12 +56,10 @@ export type WorkflowTypeEnum = typeof WorkflowTypeEnum[keyof typeof WorkflowType /** * Check if a given object implements the Workflow interface. */ -export function instanceOfWorkflow(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "operator" in value; - isInstance = isInstance && "type" in value; - - return isInstance; +export function instanceOfWorkflow(value: object): value is Workflow { + if (!('operator' in value) || value['operator'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + return true; } export function WorkflowFromJSON(json: any): Workflow { @@ -68,7 +67,7 @@ export function WorkflowFromJSON(json: any): Workflow { } export function WorkflowFromJSONTyped(json: any, ignoreDiscriminator: boolean): Workflow { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -78,17 +77,19 @@ export function WorkflowFromJSONTyped(json: any, ignoreDiscriminator: boolean): }; } -export function WorkflowToJSON(value?: Workflow | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function WorkflowToJSON(json: any): Workflow { + return WorkflowToJSONTyped(json, false); +} + +export function WorkflowToJSONTyped(value?: Workflow | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'operator': TypedOperatorOperatorToJSON(value.operator), - 'type': value.type, + 'operator': TypedOperatorOperatorToJSON(value['operator']), + 'type': value['type'], }; } diff --git a/typescript/src/models/WrappedPlotOutput.ts b/typescript/src/models/WrappedPlotOutput.ts index 90e045d3..553417a2 100644 --- a/typescript/src/models/WrappedPlotOutput.ts +++ b/typescript/src/models/WrappedPlotOutput.ts @@ -12,12 +12,13 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { PlotOutputFormat } from './PlotOutputFormat'; import { PlotOutputFormatFromJSON, PlotOutputFormatFromJSONTyped, PlotOutputFormatToJSON, + PlotOutputFormatToJSONTyped, } from './PlotOutputFormat'; /** @@ -46,16 +47,16 @@ export interface WrappedPlotOutput { plotType: string; } + + /** * Check if a given object implements the WrappedPlotOutput interface. */ -export function instanceOfWrappedPlotOutput(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "outputFormat" in value; - isInstance = isInstance && "plotType" in value; - - return isInstance; +export function instanceOfWrappedPlotOutput(value: object): value is WrappedPlotOutput { + if (!('data' in value) || value['data'] === undefined) return false; + if (!('outputFormat' in value) || value['outputFormat'] === undefined) return false; + if (!('plotType' in value) || value['plotType'] === undefined) return false; + return true; } export function WrappedPlotOutputFromJSON(json: any): WrappedPlotOutput { @@ -63,7 +64,7 @@ export function WrappedPlotOutputFromJSON(json: any): WrappedPlotOutput { } export function WrappedPlotOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): WrappedPlotOutput { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -74,18 +75,20 @@ export function WrappedPlotOutputFromJSONTyped(json: any, ignoreDiscriminator: b }; } -export function WrappedPlotOutputToJSON(value?: WrappedPlotOutput | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; +export function WrappedPlotOutputToJSON(json: any): WrappedPlotOutput { + return WrappedPlotOutputToJSONTyped(json, false); +} + +export function WrappedPlotOutputToJSONTyped(value?: WrappedPlotOutput | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; } + return { - 'data': value.data, - 'outputFormat': PlotOutputFormatToJSON(value.outputFormat), - 'plotType': value.plotType, + 'data': value['data'], + 'outputFormat': PlotOutputFormatToJSON(value['outputFormat']), + 'plotType': value['plotType'], }; } diff --git a/typescript/src/models/index.ts b/typescript/src/models/index.ts index 762a3e8b..f2d0bb1b 100644 --- a/typescript/src/models/index.ts +++ b/typescript/src/models/index.ts @@ -64,6 +64,7 @@ export * from './GetLegendGraphicRequest'; export * from './GetMapExceptionFormat'; export * from './GetMapFormat'; export * from './GetMapRequest'; +export * from './InlineObject'; export * from './InternalDataId'; export * from './Layer'; export * from './LayerCollection'; diff --git a/typescript/src/runtime.ts b/typescript/src/runtime.ts index 083f0e5b..04c5abfe 100644 --- a/typescript/src/runtime.ts +++ b/typescript/src/runtime.ts @@ -22,7 +22,7 @@ export interface ConfigurationParameters { queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings username?: string; // parameter for basic security password?: string; // parameter for basic security - apiKey?: string | ((name: string) => string); // parameter for apiKey security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security headers?: HTTPHeaders; //header params we want to use on every request credentials?: RequestCredentials; //value for the credentials param we want to use on each request @@ -59,7 +59,7 @@ export class Configuration { return this.configuration.password; } - get apiKey(): ((name: string) => string) | undefined { + get apiKey(): ((name: string) => string | Promise) | undefined { const apiKey = this.configuration.apiKey; if (apiKey) { return typeof apiKey === 'function' ? apiKey : () => apiKey; @@ -86,7 +86,7 @@ export class Configuration { export const DefaultConfig = new Configuration({ headers: { - 'User-Agent': 'geoengine/openapi-client/typescript/0.0.20' + 'User-Agent': 'geoengine/openapi-client/typescript/0.0.21' } }); @@ -95,7 +95,7 @@ export const DefaultConfig = new Configuration({ */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { @@ -314,11 +314,6 @@ export interface RequestOpts { body?: HTTPBody; } -export function exists(json: any, key: string) { - const value = json[key]; - return value !== null && value !== undefined; -} - export function querystring(params: HTTPQuery, prefix: string = ''): string { return Object.keys(params) .map(key => querystringSingleKey(key, params[key], prefix)) @@ -346,6 +341,11 @@ function querystringSingleKey(key: string, value: string | number | null | undef return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; } +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + export function mapValues(data: any, fn: (item: any) => any) { return Object.keys(data).reduce( (acc, key) => ({ ...acc, [key]: fn(data[key]) }),