From 5935d92459eaa7ee20c1d715c905c53fa4163e4e Mon Sep 17 00:00:00 2001 From: Michael Mattig Date: Fri, 30 Aug 2024 10:49:55 +0200 Subject: [PATCH] add ml routes --- .generation/config.ini | 6 +- .generation/input/openapi.json | 206 +++++++- python/.openapi-generator/FILES | 13 +- python/README.md | 8 +- python/geoengine_openapi_client/__init__.py | 6 +- .../geoengine_openapi_client/api/__init__.py | 1 + python/geoengine_openapi_client/api/ml_api.py | 454 ++++++++++++++++++ python/geoengine_openapi_client/api_client.py | 2 +- .../geoengine_openapi_client/configuration.py | 2 +- .../models/__init__.py | 3 + .../models/ml_model.py | 84 ++++ .../models/ml_model_metadata.py | 79 +++ .../models/resource_id.py | 36 +- .../models/resource_id_layer.py | 4 +- .../models/resource_id_ml_model.py | 81 ++++ python/pyproject.toml | 2 +- python/setup.py | 2 +- python/test/test_ml_api.py | 53 ++ python/test/test_ml_model.py | 70 +++ python/test/test_ml_model_metadata.py | 60 +++ python/test/test_resource_id_ml_model.py | 56 +++ typescript/README.md | 4 +- typescript/dist/apis/MLApi.d.ts | 48 ++ typescript/dist/apis/MLApi.js | 136 ++++++ typescript/dist/apis/index.d.ts | 1 + typescript/dist/apis/index.js | 1 + typescript/dist/esm/apis/MLApi.d.ts | 48 ++ typescript/dist/esm/apis/MLApi.js | 132 +++++ typescript/dist/esm/apis/index.d.ts | 1 + typescript/dist/esm/apis/index.js | 1 + typescript/dist/esm/models/MlModel.d.ts | 56 +++ typescript/dist/esm/models/MlModel.js | 56 +++ .../dist/esm/models/MlModelMetadata.d.ts | 50 ++ typescript/dist/esm/models/MlModelMetadata.js | 53 ++ typescript/dist/esm/models/ResourceId.d.ts | 3 + typescript/dist/esm/models/ResourceId.js | 5 + .../dist/esm/models/ResourceIdLayer.d.ts | 1 + typescript/dist/esm/models/ResourceIdLayer.js | 3 +- .../dist/esm/models/ResourceIdMlModel.d.ts | 44 ++ .../dist/esm/models/ResourceIdMlModel.js | 52 ++ typescript/dist/esm/models/index.d.ts | 3 + typescript/dist/esm/models/index.js | 3 + typescript/dist/esm/runtime.js | 2 +- typescript/dist/models/MlModel.d.ts | 56 +++ typescript/dist/models/MlModel.js | 63 +++ typescript/dist/models/MlModelMetadata.d.ts | 50 ++ typescript/dist/models/MlModelMetadata.js | 60 +++ typescript/dist/models/ResourceId.d.ts | 3 + typescript/dist/models/ResourceId.js | 5 + typescript/dist/models/ResourceIdLayer.d.ts | 1 + typescript/dist/models/ResourceIdLayer.js | 3 +- typescript/dist/models/ResourceIdMlModel.d.ts | 44 ++ typescript/dist/models/ResourceIdMlModel.js | 59 +++ typescript/dist/models/index.d.ts | 3 + typescript/dist/models/index.js | 3 + typescript/dist/runtime.js | 2 +- typescript/package.json | 2 +- typescript/src/apis/MLApi.ts | 150 ++++++ typescript/src/apis/index.ts | 1 + typescript/src/models/MlModel.ts | 109 +++++ typescript/src/models/MlModelMetadata.ts | 100 ++++ typescript/src/models/ResourceId.ts | 13 +- typescript/src/models/ResourceIdLayer.ts | 3 +- typescript/src/models/ResourceIdMlModel.ts | 85 ++++ typescript/src/models/index.ts | 3 + typescript/src/runtime.ts | 2 +- 66 files changed, 2707 insertions(+), 44 deletions(-) create mode 100644 python/geoengine_openapi_client/api/ml_api.py create mode 100644 python/geoengine_openapi_client/models/ml_model.py create mode 100644 python/geoengine_openapi_client/models/ml_model_metadata.py create mode 100644 python/geoengine_openapi_client/models/resource_id_ml_model.py create mode 100644 python/test/test_ml_api.py create mode 100644 python/test/test_ml_model.py create mode 100644 python/test/test_ml_model_metadata.py create mode 100644 python/test/test_resource_id_ml_model.py create mode 100644 typescript/dist/apis/MLApi.d.ts create mode 100644 typescript/dist/apis/MLApi.js create mode 100644 typescript/dist/esm/apis/MLApi.d.ts create mode 100644 typescript/dist/esm/apis/MLApi.js create mode 100644 typescript/dist/esm/models/MlModel.d.ts create mode 100644 typescript/dist/esm/models/MlModel.js create mode 100644 typescript/dist/esm/models/MlModelMetadata.d.ts create mode 100644 typescript/dist/esm/models/MlModelMetadata.js create mode 100644 typescript/dist/esm/models/ResourceIdMlModel.d.ts create mode 100644 typescript/dist/esm/models/ResourceIdMlModel.js create mode 100644 typescript/dist/models/MlModel.d.ts create mode 100644 typescript/dist/models/MlModel.js create mode 100644 typescript/dist/models/MlModelMetadata.d.ts create mode 100644 typescript/dist/models/MlModelMetadata.js create mode 100644 typescript/dist/models/ResourceIdMlModel.d.ts create mode 100644 typescript/dist/models/ResourceIdMlModel.js create mode 100644 typescript/src/apis/MLApi.ts create mode 100644 typescript/src/models/MlModel.ts create mode 100644 typescript/src/models/MlModelMetadata.ts create mode 100644 typescript/src/models/ResourceIdMlModel.ts diff --git a/.generation/config.ini b/.generation/config.ini index b80a4563..77106364 100644 --- a/.generation/config.ini +++ b/.generation/config.ini @@ -1,14 +1,14 @@ [input] -backendTag = pro-nightly-2024-08-23 +backendTag = pro-nightly-2024-08-31 [general] githubUrl = https://github.com/geo-engine/openapi-client [python] name = geoengine_openapi_client -version = 0.0.11 +version = 0.0.12 [typescript] name = @geoengine/openapi-client -version = 0.0.11 +version = 0.0.12 diff --git a/.generation/input/openapi.json b/.generation/input/openapi.json index 44511428..374028b6 100644 --- a/.generation/input/openapi.json +++ b/.generation/input/openapi.json @@ -195,7 +195,7 @@ "Admin tried to create dataset from an upload": { "value": { "error": "AdminsCannotCreateDatasetFromUpload", - "message": "AdminsCannotCreateDatasetFromUpload" + "message": "Admins cannot create dataset from upload" } }, "Body is invalid json": { @@ -219,7 +219,7 @@ "Normal user tried to create dataset from a volume": { "value": { "error": "OnlyAdminsCanCreateDatasetFromVolume", - "message": "OnlyAdminsCanCreateDatasetFromVolume" + "message": "Only admins can create dataset from volume" } }, "Referenced an unknown upload": { @@ -231,7 +231,7 @@ "Referenced an unknown volume": { "value": { "error": "UnknownVolume", - "message": "UnknownVolume" + "message": "Unknown volume" } } } @@ -318,13 +318,13 @@ "Dataset has no auto-importable layer": { "value": { "error": "DatasetHasNoAutoImportableLayer", - "message": "DatasetHasNoAutoImportableLayer" + "message": "Dataset has no auto importable layer" } }, "Dataset name is empty": { "value": { "error": "InvalidDatasetName", - "message": "InvalidDatasetName" + "message": "Invalid dataset name" } }, "Failed to read body": { @@ -335,20 +335,20 @@ }, "File does not exist": { "value": { - "error": "Operator", - "message": "Operator: GdalError: GDAL method 'GDALOpenEx' returned a NULL pointer. Error msg: 'upload/0bdd1062-7796-4d44-a655-e548144281a6/asdf: No such file or directory'" + "error": "GdalError", + "message": "GdalError: GDAL method 'GDALOpenEx' returned a NULL pointer. Error msg: 'upload/0bdd1062-7796-4d44-a655-e548144281a6/asdf: No such file or directory'" } }, "Referenced an unknown upload": { "value": { "error": "UnknownUploadId", - "message": "UnknownUploadId" + "message": "Unknown upload id" } }, "Upload filename is invalid": { "value": { "error": "InvalidUploadFileName", - "message": "InvalidUploadFileName" + "message": "Invalid upload file name" } } } @@ -450,13 +450,13 @@ "Dataset has no auto-importable layer": { "value": { "error": "DatasetHasNoAutoImportableLayer", - "message": "DatasetHasNoAutoImportableLayer" + "message": "Dataset has no auto importable layer" } }, "File does not exist": { "value": { - "error": "Operator", - "message": "Operator: GdalError: GDAL method 'GDALOpenEx' returned a NULL pointer. Error msg: 'upload/0bdd1062-7796-4d44-a655-e548144281a6/asdf: No such file or directory'" + "error": "GdalError", + "message": "GdalError: GDAL method 'GDALOpenEx' returned a NULL pointer. Error msg: 'upload/0bdd1062-7796-4d44-a655-e548144281a6/asdf: No such file or directory'" } }, "Missing field in query string": { @@ -468,7 +468,7 @@ "No suitable mainfile found": { "value": { "error": "NoMainFileCandidateFound", - "message": "NoMainFileCandidateFound" + "message": "No main file candidate found" } }, "Number in query string contains letters": { @@ -480,7 +480,7 @@ "Referenced an unknown upload": { "value": { "error": "UnknownUploadId", - "message": "UnknownUploadId" + "message": "Unknown upload id" } } } @@ -699,13 +699,13 @@ "Given dataset can only be deleted by owner": { "value": { "error": "OperationRequiresOwnerPermission", - "message": "OperationRequiresOwnerPermission" + "message": "Operation requires owner permission" } }, "Referenced an unknown dataset": { "value": { "error": "UnknownDatasetName", - "message": "UnknownDatasetName" + "message": "Unknown dataset name" } } } @@ -2154,6 +2154,99 @@ ] } }, + "/ml/models": { + "get": { + "tags": [ + "ML" + ], + "summary": "List ml models.", + "operationId": "list_ml_models", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MlModel" + } + } + } + } + } + }, + "security": [ + { + "session_token": [] + } + ] + }, + "post": { + "tags": [ + "ML" + ], + "summary": "Create a new ml model.", + "operationId": "add_ml_model", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MlModel" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "" + } + }, + "security": [ + { + "session_token": [] + } + ] + } + }, + "/ml/models/{model_name}": { + "get": { + "tags": [ + "ML" + ], + "summary": "Get ml model by name.", + "operationId": "get_ml_model", + "parameters": [ + { + "name": "model_name", + "in": "path", + "description": "Ml Model Name", + "required": true, + "schema": { + "$ref": "#/components/schemas/MlModelName" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MlModel" + } + } + } + } + }, + "security": [ + { + "session_token": [] + } + ] + } + }, "/oidcInit": { "post": { "tags": [ @@ -6463,6 +6556,65 @@ } } }, + "MlModel": { + "type": "object", + "required": [ + "name", + "displayName", + "description", + "upload", + "metadata" + ], + "properties": { + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/MlModelMetadata" + }, + "name": { + "$ref": "#/components/schemas/MlModelName" + }, + "upload": { + "$ref": "#/components/schemas/UploadId" + } + } + }, + "MlModelId": { + "type": "string", + "format": "uuid" + }, + "MlModelMetadata": { + "type": "object", + "required": [ + "fileName", + "inputType", + "numInputBands", + "outputType" + ], + "properties": { + "fileName": { + "type": "string" + }, + "inputType": { + "$ref": "#/components/schemas/RasterDataType" + }, + "numInputBands": { + "type": "integer", + "format": "int32", + "minimum": 0 + }, + "outputType": { + "$ref": "#/components/schemas/RasterDataType" + } + } + }, + "MlModelName": { + "type": "string" + }, "MockDatasetDataSourceLoadingInfo": { "type": "object", "required": [ @@ -7821,6 +7973,9 @@ }, { "$ref": "#/components/schemas/ResourceIdDatasetId" + }, + { + "$ref": "#/components/schemas/ResourceIdMlModel" } ], "discriminator": { @@ -7829,6 +7984,7 @@ "DatasetId": "#/components/schemas/ResourceIdDatasetId", "Layer": "#/components/schemas/ResourceIdLayer", "LayerCollection": "#/components/schemas/ResourceIdLayerCollection", + "MlModel": "#/components/schemas/ResourceIdMlModel", "Project": "#/components/schemas/ResourceIdProject" } } @@ -7887,6 +8043,24 @@ } } }, + "ResourceIdMlModel": { + "type": "object", + "required": [ + "type", + "id" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/MlModelId" + }, + "type": { + "type": "string", + "enum": [ + "MlModel" + ] + } + } + }, "ResourceIdProject": { "type": "object", "required": [ diff --git a/python/.openapi-generator/FILES b/python/.openapi-generator/FILES index db8c3687..5c075de8 100644 --- a/python/.openapi-generator/FILES +++ b/python/.openapi-generator/FILES @@ -1,7 +1,6 @@ .github/workflows/python.yml .gitignore .gitlab-ci.yml -.openapi-generator-ignore .travis.yml README.md docs/AddCollection200Response.md @@ -81,9 +80,12 @@ docs/LayersApi.md docs/LineSymbology.md docs/LinearGradient.md docs/LogarithmicGradient.md +docs/MLApi.md docs/Measurement.md docs/MetaDataDefinition.md docs/MetaDataSuggestion.md +docs/MlModel.md +docs/MlModelMetadata.md docs/MockDatasetDataSourceLoadingInfo.md docs/MockMetaData.md docs/MultiLineString.md @@ -156,6 +158,7 @@ docs/ResourceId.md docs/ResourceIdDatasetId.md docs/ResourceIdLayer.md docs/ResourceIdLayerCollection.md +docs/ResourceIdMlModel.md docs/ResourceIdProject.md docs/RgbaColorizer.md docs/Role.md @@ -236,6 +239,7 @@ geoengine_openapi_client/api/__init__.py geoengine_openapi_client/api/datasets_api.py geoengine_openapi_client/api/general_api.py geoengine_openapi_client/api/layers_api.py +geoengine_openapi_client/api/ml_api.py geoengine_openapi_client/api/ogcwcs_api.py geoengine_openapi_client/api/ogcwfs_api.py geoengine_openapi_client/api/ogcwms_api.py @@ -330,6 +334,8 @@ geoengine_openapi_client/models/logarithmic_gradient.py geoengine_openapi_client/models/measurement.py geoengine_openapi_client/models/meta_data_definition.py geoengine_openapi_client/models/meta_data_suggestion.py +geoengine_openapi_client/models/ml_model.py +geoengine_openapi_client/models/ml_model_metadata.py geoengine_openapi_client/models/mock_dataset_data_source_loading_info.py geoengine_openapi_client/models/mock_meta_data.py geoengine_openapi_client/models/multi_line_string.py @@ -396,6 +402,7 @@ geoengine_openapi_client/models/resource_id.py geoengine_openapi_client/models/resource_id_dataset_id.py geoengine_openapi_client/models/resource_id_layer.py geoengine_openapi_client/models/resource_id_layer_collection.py +geoengine_openapi_client/models/resource_id_ml_model.py geoengine_openapi_client/models/resource_id_project.py geoengine_openapi_client/models/rgba_colorizer.py geoengine_openapi_client/models/role.py @@ -554,6 +561,9 @@ test/test_logarithmic_gradient.py test/test_measurement.py test/test_meta_data_definition.py test/test_meta_data_suggestion.py +test/test_ml_api.py +test/test_ml_model.py +test/test_ml_model_metadata.py test/test_mock_dataset_data_source_loading_info.py test/test_mock_meta_data.py test/test_multi_line_string.py @@ -626,6 +636,7 @@ test/test_resource_id.py test/test_resource_id_dataset_id.py test/test_resource_id_layer.py test/test_resource_id_layer_collection.py +test/test_resource_id_ml_model.py test/test_resource_id_project.py test/test_rgba_colorizer.py test/test_role.py diff --git a/python/README.md b/python/README.md index be12fbe2..8b15bb46 100644 --- a/python/README.md +++ b/python/README.md @@ -4,7 +4,7 @@ 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.11 +- Package version: 0.0.12 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. @@ -123,6 +123,9 @@ Class | Method | HTTP request | Description *LayersApi* | [**remove_collection_from_collection**](docs/LayersApi.md#remove_collection_from_collection) | **DELETE** /layerDb/collections/{parent}/collections/{collection} | Delete a collection from a collection *LayersApi* | [**remove_layer_from_collection**](docs/LayersApi.md#remove_layer_from_collection) | **DELETE** /layerDb/collections/{collection}/layers/{layer} | Remove a layer from a collection *LayersApi* | [**search_handler**](docs/LayersApi.md#search_handler) | **GET** /layers/collections/search/{provider}/{collection} | Searches the contents of the collection of the given provider +*MLApi* | [**add_ml_model**](docs/MLApi.md#add_ml_model) | **POST** /ml/models | Create a new ml model. +*MLApi* | [**get_ml_model**](docs/MLApi.md#get_ml_model) | **GET** /ml/models/{model_name} | Get ml model by name. +*MLApi* | [**list_ml_models**](docs/MLApi.md#list_ml_models) | **GET** /ml/models | List ml models. *OGCWCSApi* | [**wcs_capabilities_handler**](docs/OGCWCSApi.md#wcs_capabilities_handler) | **GET** /wcs/{workflow}?request=GetCapabilities | Get WCS Capabilities *OGCWCSApi* | [**wcs_describe_coverage_handler**](docs/OGCWCSApi.md#wcs_describe_coverage_handler) | **GET** /wcs/{workflow}?request=DescribeCoverage | Get WCS Coverage Description *OGCWCSApi* | [**wcs_get_coverage_handler**](docs/OGCWCSApi.md#wcs_get_coverage_handler) | **GET** /wcs/{workflow}?request=GetCoverage | Get WCS Coverage @@ -253,6 +256,8 @@ Class | Method | HTTP request | Description - [Measurement](docs/Measurement.md) - [MetaDataDefinition](docs/MetaDataDefinition.md) - [MetaDataSuggestion](docs/MetaDataSuggestion.md) + - [MlModel](docs/MlModel.md) + - [MlModelMetadata](docs/MlModelMetadata.md) - [MockDatasetDataSourceLoadingInfo](docs/MockDatasetDataSourceLoadingInfo.md) - [MockMetaData](docs/MockMetaData.md) - [MultiLineString](docs/MultiLineString.md) @@ -319,6 +324,7 @@ Class | Method | HTTP request | Description - [ResourceIdDatasetId](docs/ResourceIdDatasetId.md) - [ResourceIdLayer](docs/ResourceIdLayer.md) - [ResourceIdLayerCollection](docs/ResourceIdLayerCollection.md) + - [ResourceIdMlModel](docs/ResourceIdMlModel.md) - [ResourceIdProject](docs/ResourceIdProject.md) - [RgbaColorizer](docs/RgbaColorizer.md) - [Role](docs/Role.md) diff --git a/python/geoengine_openapi_client/__init__.py b/python/geoengine_openapi_client/__init__.py index 5092e833..14b01413 100644 --- a/python/geoengine_openapi_client/__init__.py +++ b/python/geoengine_openapi_client/__init__.py @@ -15,12 +15,13 @@ """ # noqa: E501 -__version__ = "0.0.11" +__version__ = "0.0.12" # import apis into sdk package from geoengine_openapi_client.api.datasets_api import DatasetsApi from geoengine_openapi_client.api.general_api import GeneralApi from geoengine_openapi_client.api.layers_api import LayersApi +from geoengine_openapi_client.api.ml_api import MLApi from geoengine_openapi_client.api.ogcwcs_api import OGCWCSApi from geoengine_openapi_client.api.ogcwfs_api import OGCWFSApi from geoengine_openapi_client.api.ogcwms_api import OGCWMSApi @@ -123,6 +124,8 @@ from geoengine_openapi_client.models.measurement import Measurement from geoengine_openapi_client.models.meta_data_definition import MetaDataDefinition from geoengine_openapi_client.models.meta_data_suggestion import MetaDataSuggestion +from geoengine_openapi_client.models.ml_model import MlModel +from geoengine_openapi_client.models.ml_model_metadata import MlModelMetadata from geoengine_openapi_client.models.mock_dataset_data_source_loading_info import MockDatasetDataSourceLoadingInfo from geoengine_openapi_client.models.mock_meta_data import MockMetaData from geoengine_openapi_client.models.multi_line_string import MultiLineString @@ -189,6 +192,7 @@ 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 geoengine_openapi_client.models.rgba_colorizer import RgbaColorizer from geoengine_openapi_client.models.role import Role diff --git a/python/geoengine_openapi_client/api/__init__.py b/python/geoengine_openapi_client/api/__init__.py index bae02e8b..9f6abc5d 100644 --- a/python/geoengine_openapi_client/api/__init__.py +++ b/python/geoengine_openapi_client/api/__init__.py @@ -4,6 +4,7 @@ from geoengine_openapi_client.api.datasets_api import DatasetsApi from geoengine_openapi_client.api.general_api import GeneralApi from geoengine_openapi_client.api.layers_api import LayersApi +from geoengine_openapi_client.api.ml_api import MLApi from geoengine_openapi_client.api.ogcwcs_api import OGCWCSApi from geoengine_openapi_client.api.ogcwfs_api import OGCWFSApi from geoengine_openapi_client.api.ogcwms_api import OGCWMSApi diff --git a/python/geoengine_openapi_client/api/ml_api.py b/python/geoengine_openapi_client/api/ml_api.py new file mode 100644 index 00000000..a4a12254 --- /dev/null +++ b/python/geoengine_openapi_client/api/ml_api.py @@ -0,0 +1,454 @@ +# coding: utf-8 + +""" + Geo Engine Pro API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.8.0 + Contact: dev@geoengine.de + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +from pydantic import validate_arguments, ValidationError + +from typing_extensions import Annotated +from pydantic import Field, StrictStr + +from typing import List + +from geoengine_openapi_client.models.ml_model import MlModel + +from geoengine_openapi_client.api_client import ApiClient +from geoengine_openapi_client.api_response import ApiResponse +from geoengine_openapi_client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class MLApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_arguments + def add_ml_model(self, ml_model : MlModel, **kwargs) -> None: # 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(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. + :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_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() + + :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. + :param _request_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 + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [ + 'ml_model' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # 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'] + + _collection_formats = {} + + # 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 + if _params['ml_model'] is not None: + _body_params = _params['ml_model'] + + # 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 + + # authentication setting + _auth_settings = ['session_token'] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/ml/models', 'POST', + _path_params, + _query_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')) + + @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() + + :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. + :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() + + :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. + :param _request_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 + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(MlModel, status_code(int), headers(HTTPHeaderDict)) + """ + + _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 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'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['model_name']: + _path_params['model_name'] = _params['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 + + # authentication setting + _auth_settings = ['session_token'] # noqa: E501 + + _response_types_map = { + '200': "MlModel", + } + + return self.api_client.call_api( + '/ml/models/{model_name}', 'GET', + _path_params, + _query_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')) + + @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. + :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 + :param _request_timeout: timeout setting 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_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[MlModel], 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' + ] + ) + + # 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'] + + _collection_formats = {} + + # 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 + + # authentication setting + _auth_settings = ['session_token'] # noqa: E501 + + _response_types_map = { + '200': "List[MlModel]", + } + + return self.api_client.call_api( + '/ml/models', 'GET', + _path_params, + _query_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')) diff --git a/python/geoengine_openapi_client/api_client.py b/python/geoengine_openapi_client/api_client.py index b59d67c7..540da7ab 100644 --- a/python/geoengine_openapi_client/api_client.py +++ b/python/geoengine_openapi_client/api_client.py @@ -76,7 +76,7 @@ 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.11' + self.user_agent = 'geoengine/openapi-client/python/0.0.12' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/python/geoengine_openapi_client/configuration.py b/python/geoengine_openapi_client/configuration.py index f1e28803..ef9adca5 100644 --- a/python/geoengine_openapi_client/configuration.py +++ b/python/geoengine_openapi_client/configuration.py @@ -378,7 +378,7 @@ 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.11".\ + "SDK Package Version: 0.0.12".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/python/geoengine_openapi_client/models/__init__.py b/python/geoengine_openapi_client/models/__init__.py index 52c9f5a5..d69cd871 100644 --- a/python/geoengine_openapi_client/models/__init__.py +++ b/python/geoengine_openapi_client/models/__init__.py @@ -92,6 +92,8 @@ from geoengine_openapi_client.models.measurement import Measurement from geoengine_openapi_client.models.meta_data_definition import MetaDataDefinition from geoengine_openapi_client.models.meta_data_suggestion import MetaDataSuggestion +from geoengine_openapi_client.models.ml_model import MlModel +from geoengine_openapi_client.models.ml_model_metadata import MlModelMetadata from geoengine_openapi_client.models.mock_dataset_data_source_loading_info import MockDatasetDataSourceLoadingInfo from geoengine_openapi_client.models.mock_meta_data import MockMetaData from geoengine_openapi_client.models.multi_line_string import MultiLineString @@ -158,6 +160,7 @@ 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 geoengine_openapi_client.models.rgba_colorizer import RgbaColorizer from geoengine_openapi_client.models.role import Role diff --git a/python/geoengine_openapi_client/models/ml_model.py b/python/geoengine_openapi_client/models/ml_model.py new file mode 100644 index 00000000..da2dfd28 --- /dev/null +++ b/python/geoengine_openapi_client/models/ml_model.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Geo Engine Pro API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.8.0 + Contact: 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, Field, StrictStr +from geoengine_openapi_client.models.ml_model_metadata import MlModelMetadata + +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 + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MlModel: + """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) + # 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: + """Create an instance of MlModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MlModel.parse_obj(obj) + + _obj = MlModel.parse_obj({ + "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, + "name": obj.get("name"), + "upload": obj.get("upload") + }) + return _obj + + diff --git a/python/geoengine_openapi_client/models/ml_model_metadata.py b/python/geoengine_openapi_client/models/ml_model_metadata.py new file mode 100644 index 00000000..44254b96 --- /dev/null +++ b/python/geoengine_openapi_client/models/ml_model_metadata.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Geo Engine Pro API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.8.0 + Contact: 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, Field, StrictStr, conint +from geoengine_openapi_client.models.raster_data_type import RasterDataType + +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"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> MlModelMetadata: + """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) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> MlModelMetadata: + """Create an instance of MlModelMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MlModelMetadata.parse_obj(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") + }) + return _obj + + diff --git a/python/geoengine_openapi_client/models/resource_id.py b/python/geoengine_openapi_client/models/resource_id.py index 7913ba99..62d31924 100644 --- a/python/geoengine_openapi_client/models/resource_id.py +++ b/python/geoengine_openapi_client/models/resource_id.py @@ -24,11 +24,12 @@ 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 -RESOURCEID_ONE_OF_SCHEMAS = ["ResourceIdDatasetId", "ResourceIdLayer", "ResourceIdLayerCollection", "ResourceIdProject"] +RESOURCEID_ONE_OF_SCHEMAS = ["ResourceIdDatasetId", "ResourceIdLayer", "ResourceIdLayerCollection", "ResourceIdMlModel", "ResourceIdProject"] class ResourceId(BaseModel): """ @@ -42,8 +43,10 @@ class ResourceId(BaseModel): oneof_schema_3_validator: Optional[ResourceIdProject] = None # data type: ResourceIdDatasetId 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, ResourceIdProject] + actual_instance: Union[ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdMlModel, ResourceIdProject] else: actual_instance: Any one_of_schemas: List[str] = Field(RESOURCEID_ONE_OF_SCHEMAS, const=True) @@ -89,12 +92,17 @@ def actual_instance_must_validate_oneof(cls, v): error_messages.append(f"Error! Input type `{type(v)}` is not `ResourceIdDatasetId`") else: match += 1 + # validate data type: ResourceIdMlModel + if not isinstance(v, ResourceIdMlModel): + error_messages.append(f"Error! Input type `{type(v)}` is not `ResourceIdMlModel`") + else: + match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in ResourceId with oneOf schemas: ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdProject. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in ResourceId with oneOf schemas: ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdMlModel, ResourceIdProject. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in ResourceId with oneOf schemas: ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdProject. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in ResourceId with oneOf schemas: ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdMlModel, ResourceIdProject. Details: " + ", ".join(error_messages)) else: return v @@ -129,6 +137,11 @@ def from_json(cls, json_str: str) -> ResourceId: instance.actual_instance = ResourceIdLayerCollection.from_json(json_str) return instance + # check if data type is `ResourceIdMlModel` + if _data_type == "MlModel": + instance.actual_instance = ResourceIdMlModel.from_json(json_str) + return instance + # check if data type is `ResourceIdProject` if _data_type == "Project": instance.actual_instance = ResourceIdProject.from_json(json_str) @@ -149,6 +162,11 @@ def from_json(cls, json_str: str) -> ResourceId: instance.actual_instance = ResourceIdLayerCollection.from_json(json_str) return instance + # check if data type is `ResourceIdMlModel` + if _data_type == "ResourceIdMlModel": + instance.actual_instance = ResourceIdMlModel.from_json(json_str) + return instance + # check if data type is `ResourceIdProject` if _data_type == "ResourceIdProject": instance.actual_instance = ResourceIdProject.from_json(json_str) @@ -178,13 +196,19 @@ def from_json(cls, json_str: str) -> ResourceId: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) + # deserialize data into ResourceIdMlModel + try: + instance.actual_instance = ResourceIdMlModel.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into ResourceId with oneOf schemas: ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdProject. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into ResourceId with oneOf schemas: ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdMlModel, ResourceIdProject. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into ResourceId with oneOf schemas: ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdProject. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into ResourceId with oneOf schemas: ResourceIdDatasetId, ResourceIdLayer, ResourceIdLayerCollection, ResourceIdMlModel, ResourceIdProject. Details: " + ", ".join(error_messages)) else: return instance diff --git a/python/geoengine_openapi_client/models/resource_id_layer.py b/python/geoengine_openapi_client/models/resource_id_layer.py index 67ea0ece..ad6d45bc 100644 --- a/python/geoengine_openapi_client/models/resource_id_layer.py +++ b/python/geoengine_openapi_client/models/resource_id_layer.py @@ -33,8 +33,8 @@ class ResourceIdLayer(BaseModel): @validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('Layer', 'LayerCollection', 'Project', 'DatasetId'): - raise ValueError("must be one of enum values ('Layer', 'LayerCollection', 'Project', 'DatasetId')") + if value not in ('Layer', 'LayerCollection', 'Project', 'DatasetId', 'MlModel'): + raise ValueError("must be one of enum values ('Layer', 'LayerCollection', 'Project', 'DatasetId', 'MlModel')") return value class Config: diff --git a/python/geoengine_openapi_client/models/resource_id_ml_model.py b/python/geoengine_openapi_client/models/resource_id_ml_model.py new file mode 100644 index 00000000..745e33ff --- /dev/null +++ b/python/geoengine_openapi_client/models/resource_id_ml_model.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Geo Engine Pro API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.8.0 + Contact: 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, Field, StrictStr, validator + +class ResourceIdMlModel(BaseModel): + """ + ResourceIdMlModel + """ + id: StrictStr = Field(...) + type: StrictStr = Field(...) + __properties = ["id", "type"] + + @validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in ('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 + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ResourceIdMlModel: + """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) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ResourceIdMlModel: + """Create an instance of ResourceIdMlModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ResourceIdMlModel.parse_obj(obj) + + _obj = ResourceIdMlModel.parse_obj({ + "id": obj.get("id"), + "type": obj.get("type") + }) + return _obj + + diff --git a/python/pyproject.toml b/python/pyproject.toml index 5be242bc..56d2839a 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "geoengine_openapi_client" -version = "0.0.11" +version = "0.0.12" description = "Geo Engine Pro API" authors = ["Geo Engine Developers "] license = "Apache-2.0" diff --git a/python/setup.py b/python/setup.py index 412b05c8..9b332c7d 100644 --- a/python/setup.py +++ b/python/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "geoengine-openapi-client" -VERSION = "0.0.11" +VERSION = "0.0.12" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0", diff --git a/python/test/test_ml_api.py b/python/test/test_ml_api.py new file mode 100644 index 00000000..e4d409b4 --- /dev/null +++ b/python/test/test_ml_api.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Geo Engine Pro API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.8.0 + Contact: 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.api.ml_api import MLApi # noqa: E501 + + +class TestMLApi(unittest.TestCase): + """MLApi unit test stubs""" + + def setUp(self) -> None: + self.api = MLApi() # noqa: E501 + + def tearDown(self) -> None: + pass + + def test_add_ml_model(self) -> None: + """Test case for add_ml_model + + Create a new ml model. # noqa: E501 + """ + pass + + def test_get_ml_model(self) -> None: + """Test case for get_ml_model + + Get ml model by name. # noqa: E501 + """ + pass + + def test_list_ml_models(self) -> None: + """Test case for list_ml_models + + List ml models. # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_ml_model.py b/python/test/test_ml_model.py new file mode 100644 index 00000000..b492bfb4 --- /dev/null +++ b/python/test/test_ml_model.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Geo Engine Pro API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.8.0 + Contact: dev@geoengine.de + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from geoengine_openapi_client.models.ml_model import MlModel # noqa: E501 + +class TestMlModel(unittest.TestCase): + """MlModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MlModel: + """Test MlModel + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MlModel` + """ + model = MlModel() # noqa: E501 + if include_optional: + return MlModel( + description = '', + display_name = '', + metadata = geoengine_openapi_client.models.ml_model_metadata.MlModelMetadata( + file_name = '', + input_type = 'U8', + num_input_bands = 0, + output_type = 'U8', ), + name = '', + upload = '' + ) + else: + return MlModel( + description = '', + display_name = '', + metadata = geoengine_openapi_client.models.ml_model_metadata.MlModelMetadata( + file_name = '', + input_type = 'U8', + num_input_bands = 0, + output_type = 'U8', ), + name = '', + upload = '', + ) + """ + + def testMlModel(self): + """Test MlModel""" + # 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_ml_model_metadata.py b/python/test/test_ml_model_metadata.py new file mode 100644 index 00000000..a305ad7a --- /dev/null +++ b/python/test/test_ml_model_metadata.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Geo Engine Pro API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.8.0 + Contact: dev@geoengine.de + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from geoengine_openapi_client.models.ml_model_metadata import MlModelMetadata # noqa: E501 + +class TestMlModelMetadata(unittest.TestCase): + """MlModelMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MlModelMetadata: + """Test MlModelMetadata + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MlModelMetadata` + """ + model = MlModelMetadata() # noqa: E501 + if include_optional: + return MlModelMetadata( + file_name = '', + input_type = 'U8', + num_input_bands = 0, + output_type = 'U8' + ) + else: + return MlModelMetadata( + file_name = '', + input_type = 'U8', + num_input_bands = 0, + output_type = 'U8', + ) + """ + + def testMlModelMetadata(self): + """Test MlModelMetadata""" + # 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_resource_id_ml_model.py b/python/test/test_resource_id_ml_model.py new file mode 100644 index 00000000..e36eab49 --- /dev/null +++ b/python/test/test_resource_id_ml_model.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Geo Engine Pro API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.8.0 + Contact: dev@geoengine.de + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from geoengine_openapi_client.models.resource_id_ml_model import ResourceIdMlModel # noqa: E501 + +class TestResourceIdMlModel(unittest.TestCase): + """ResourceIdMlModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ResourceIdMlModel: + """Test ResourceIdMlModel + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ResourceIdMlModel` + """ + model = ResourceIdMlModel() # noqa: E501 + if include_optional: + return ResourceIdMlModel( + id = '', + type = 'MlModel' + ) + else: + return ResourceIdMlModel( + id = '', + type = 'MlModel', + ) + """ + + def testResourceIdMlModel(self): + """Test ResourceIdMlModel""" + # 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/typescript/README.md b/typescript/README.md index aa1ca6bc..77c01b62 100644 --- a/typescript/README.md +++ b/typescript/README.md @@ -1,4 +1,4 @@ -## @geoengine/openapi-client@0.0.11 +## @geoengine/openapi-client@0.0.12 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: @@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co _published:_ ``` -npm install @geoengine/openapi-client@0.0.11 --save +npm install @geoengine/openapi-client@0.0.12 --save ``` _unPublished (not recommended):_ diff --git a/typescript/dist/apis/MLApi.d.ts b/typescript/dist/apis/MLApi.d.ts new file mode 100644 index 00000000..f665e3f9 --- /dev/null +++ b/typescript/dist/apis/MLApi.d.ts @@ -0,0 +1,48 @@ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 * as runtime from '../runtime'; +import type { MlModel } from '../models/index'; +export interface AddMlModelRequest { + mlModel: MlModel; +} +export interface GetMlModelRequest { + modelName: string; +} +/** + * + */ +export declare class MLApi extends runtime.BaseAPI { + /** + * Create a new ml model. + */ + addMlModelRaw(requestParameters: AddMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + /** + * Create a new ml model. + */ + addMlModel(requestParameters: AddMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** + * Get ml model by name. + */ + getMlModelRaw(requestParameters: GetMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + /** + * Get ml model by name. + */ + getMlModel(requestParameters: GetMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** + * List ml models. + */ + listMlModelsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>>; + /** + * List ml models. + */ + listMlModels(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; +} diff --git a/typescript/dist/apis/MLApi.js b/typescript/dist/apis/MLApi.js new file mode 100644 index 00000000..7b6fb20e --- /dev/null +++ b/typescript/dist/apis/MLApi.js @@ -0,0 +1,136 @@ +"use strict"; +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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. + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MLApi = void 0; +const runtime = require("../runtime"); +const index_1 = require("../models/index"); +/** + * + */ +class MLApi extends runtime.BaseAPI { + /** + * Create a new ml model. + */ + 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.'); + } + const queryParameters = {}; + const headerParameters = {}; + headerParameters['Content-Type'] = 'application/json'; + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = yield token("session_token", []); + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = yield this.request({ + path: `/ml/models`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: (0, index_1.MlModelToJSON)(requestParameters.mlModel), + }, initOverrides); + return new runtime.VoidApiResponse(response); + }); + } + /** + * Create a new ml model. + */ + addMlModel(requestParameters, initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + yield this.addMlModelRaw(requestParameters, initOverrides); + }); + } + /** + * Get ml model by name. + */ + 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.'); + } + const queryParameters = {}; + const headerParameters = {}; + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = yield token("session_token", []); + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = yield this.request({ + path: `/ml/models/{model_name}`.replace(`{${"model_name"}}`, encodeURIComponent(String(requestParameters.modelName))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.MlModelFromJSON)(jsonValue)); + }); + } + /** + * Get ml model by name. + */ + getMlModel(requestParameters, initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + const response = yield this.getMlModelRaw(requestParameters, initOverrides); + return yield response.value(); + }); + } + /** + * List ml models. + */ + listMlModelsRaw(initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + const queryParameters = {}; + const headerParameters = {}; + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = yield token("session_token", []); + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = yield this.request({ + path: `/ml/models`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.MlModelFromJSON)); + }); + } + /** + * List ml models. + */ + listMlModels(initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + const response = yield this.listMlModelsRaw(initOverrides); + return yield response.value(); + }); + } +} +exports.MLApi = MLApi; diff --git a/typescript/dist/apis/index.d.ts b/typescript/dist/apis/index.d.ts index 7106ef1f..c5367b2f 100644 --- a/typescript/dist/apis/index.d.ts +++ b/typescript/dist/apis/index.d.ts @@ -1,6 +1,7 @@ export * from './DatasetsApi'; export * from './GeneralApi'; export * from './LayersApi'; +export * from './MLApi'; export * from './OGCWCSApi'; export * from './OGCWFSApi'; export * from './OGCWMSApi'; diff --git a/typescript/dist/apis/index.js b/typescript/dist/apis/index.js index 667ec476..25733265 100644 --- a/typescript/dist/apis/index.js +++ b/typescript/dist/apis/index.js @@ -19,6 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./DatasetsApi"), exports); __exportStar(require("./GeneralApi"), exports); __exportStar(require("./LayersApi"), exports); +__exportStar(require("./MLApi"), exports); __exportStar(require("./OGCWCSApi"), exports); __exportStar(require("./OGCWFSApi"), exports); __exportStar(require("./OGCWMSApi"), exports); diff --git a/typescript/dist/esm/apis/MLApi.d.ts b/typescript/dist/esm/apis/MLApi.d.ts new file mode 100644 index 00000000..f665e3f9 --- /dev/null +++ b/typescript/dist/esm/apis/MLApi.d.ts @@ -0,0 +1,48 @@ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 * as runtime from '../runtime'; +import type { MlModel } from '../models/index'; +export interface AddMlModelRequest { + mlModel: MlModel; +} +export interface GetMlModelRequest { + modelName: string; +} +/** + * + */ +export declare class MLApi extends runtime.BaseAPI { + /** + * Create a new ml model. + */ + addMlModelRaw(requestParameters: AddMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + /** + * Create a new ml model. + */ + addMlModel(requestParameters: AddMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** + * Get ml model by name. + */ + getMlModelRaw(requestParameters: GetMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + /** + * Get ml model by name. + */ + getMlModel(requestParameters: GetMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** + * List ml models. + */ + listMlModelsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>>; + /** + * List ml models. + */ + listMlModels(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; +} diff --git a/typescript/dist/esm/apis/MLApi.js b/typescript/dist/esm/apis/MLApi.js new file mode 100644 index 00000000..f65b905e --- /dev/null +++ b/typescript/dist/esm/apis/MLApi.js @@ -0,0 +1,132 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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. + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +import * as runtime from '../runtime'; +import { MlModelFromJSON, MlModelToJSON, } from '../models/index'; +/** + * + */ +export class MLApi extends runtime.BaseAPI { + /** + * Create a new ml model. + */ + 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.'); + } + const queryParameters = {}; + const headerParameters = {}; + headerParameters['Content-Type'] = 'application/json'; + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = yield token("session_token", []); + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = yield this.request({ + path: `/ml/models`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: MlModelToJSON(requestParameters.mlModel), + }, initOverrides); + return new runtime.VoidApiResponse(response); + }); + } + /** + * Create a new ml model. + */ + addMlModel(requestParameters, initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + yield this.addMlModelRaw(requestParameters, initOverrides); + }); + } + /** + * Get ml model by name. + */ + 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.'); + } + const queryParameters = {}; + const headerParameters = {}; + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = yield token("session_token", []); + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = yield this.request({ + path: `/ml/models/{model_name}`.replace(`{${"model_name"}}`, encodeURIComponent(String(requestParameters.modelName))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + return new runtime.JSONApiResponse(response, (jsonValue) => MlModelFromJSON(jsonValue)); + }); + } + /** + * Get ml model by name. + */ + getMlModel(requestParameters, initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + const response = yield this.getMlModelRaw(requestParameters, initOverrides); + return yield response.value(); + }); + } + /** + * List ml models. + */ + listMlModelsRaw(initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + const queryParameters = {}; + const headerParameters = {}; + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = yield token("session_token", []); + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = yield this.request({ + path: `/ml/models`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(MlModelFromJSON)); + }); + } + /** + * List ml models. + */ + listMlModels(initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + const response = yield this.listMlModelsRaw(initOverrides); + return yield response.value(); + }); + } +} diff --git a/typescript/dist/esm/apis/index.d.ts b/typescript/dist/esm/apis/index.d.ts index 7106ef1f..c5367b2f 100644 --- a/typescript/dist/esm/apis/index.d.ts +++ b/typescript/dist/esm/apis/index.d.ts @@ -1,6 +1,7 @@ export * from './DatasetsApi'; export * from './GeneralApi'; export * from './LayersApi'; +export * from './MLApi'; export * from './OGCWCSApi'; export * from './OGCWFSApi'; export * from './OGCWMSApi'; diff --git a/typescript/dist/esm/apis/index.js b/typescript/dist/esm/apis/index.js index 5d34e466..6cf969fc 100644 --- a/typescript/dist/esm/apis/index.js +++ b/typescript/dist/esm/apis/index.js @@ -3,6 +3,7 @@ export * from './DatasetsApi'; export * from './GeneralApi'; export * from './LayersApi'; +export * from './MLApi'; export * from './OGCWCSApi'; export * from './OGCWFSApi'; export * from './OGCWMSApi'; diff --git a/typescript/dist/esm/models/MlModel.d.ts b/typescript/dist/esm/models/MlModel.d.ts new file mode 100644 index 00000000..9f01845f --- /dev/null +++ b/typescript/dist/esm/models/MlModel.d.ts @@ -0,0 +1,56 @@ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 type { MlModelMetadata } from './MlModelMetadata'; +/** + * + * @export + * @interface MlModel + */ +export interface MlModel { + /** + * + * @type {string} + * @memberof MlModel + */ + description: string; + /** + * + * @type {string} + * @memberof MlModel + */ + displayName: string; + /** + * + * @type {MlModelMetadata} + * @memberof MlModel + */ + metadata: MlModelMetadata; + /** + * + * @type {string} + * @memberof MlModel + */ + name: string; + /** + * + * @type {string} + * @memberof MlModel + */ + upload: string; +} +/** + * Check if a given object implements the MlModel interface. + */ +export declare function instanceOfMlModel(value: object): boolean; +export declare function MlModelFromJSON(json: any): MlModel; +export declare function MlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModel; +export declare function MlModelToJSON(value?: MlModel | null): any; diff --git a/typescript/dist/esm/models/MlModel.js b/typescript/dist/esm/models/MlModel.js new file mode 100644 index 00000000..62b5d4df --- /dev/null +++ b/typescript/dist/esm/models/MlModel.js @@ -0,0 +1,56 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 { MlModelMetadataFromJSON, MlModelMetadataToJSON, } from './MlModelMetadata'; +/** + * 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; +} +export function MlModelFromJSON(json) { + return MlModelFromJSONTyped(json, false); +} +export function MlModelFromJSONTyped(json, ignoreDiscriminator) { + if ((json === undefined) || (json === null)) { + return json; + } + return { + 'description': json['description'], + 'displayName': json['displayName'], + 'metadata': MlModelMetadataFromJSON(json['metadata']), + 'name': json['name'], + 'upload': json['upload'], + }; +} +export function MlModelToJSON(value) { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + '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 new file mode 100644 index 00000000..8a7f989c --- /dev/null +++ b/typescript/dist/esm/models/MlModelMetadata.d.ts @@ -0,0 +1,50 @@ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 type { RasterDataType } from './RasterDataType'; +/** + * + * @export + * @interface MlModelMetadata + */ +export interface MlModelMetadata { + /** + * + * @type {string} + * @memberof MlModelMetadata + */ + fileName: string; + /** + * + * @type {RasterDataType} + * @memberof MlModelMetadata + */ + inputType: RasterDataType; + /** + * + * @type {number} + * @memberof MlModelMetadata + */ + numInputBands: number; + /** + * + * @type {RasterDataType} + * @memberof MlModelMetadata + */ + outputType: RasterDataType; +} +/** + * Check if a given object implements the MlModelMetadata interface. + */ +export declare function instanceOfMlModelMetadata(value: object): boolean; +export declare function MlModelMetadataFromJSON(json: any): MlModelMetadata; +export declare function MlModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelMetadata; +export declare function MlModelMetadataToJSON(value?: MlModelMetadata | null): any; diff --git a/typescript/dist/esm/models/MlModelMetadata.js b/typescript/dist/esm/models/MlModelMetadata.js new file mode 100644 index 00000000..133947d4 --- /dev/null +++ b/typescript/dist/esm/models/MlModelMetadata.js @@ -0,0 +1,53 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 { 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; +} +export function MlModelMetadataFromJSON(json) { + return MlModelMetadataFromJSONTyped(json, false); +} +export function MlModelMetadataFromJSONTyped(json, ignoreDiscriminator) { + if ((json === undefined) || (json === null)) { + return json; + } + return { + 'fileName': json['fileName'], + 'inputType': RasterDataTypeFromJSON(json['inputType']), + 'numInputBands': json['numInputBands'], + 'outputType': RasterDataTypeFromJSON(json['outputType']), + }; +} +export function MlModelMetadataToJSON(value) { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + 'fileName': value.fileName, + 'inputType': RasterDataTypeToJSON(value.inputType), + 'numInputBands': value.numInputBands, + 'outputType': RasterDataTypeToJSON(value.outputType), + }; +} diff --git a/typescript/dist/esm/models/ResourceId.d.ts b/typescript/dist/esm/models/ResourceId.d.ts index 4a270796..bbad54b7 100644 --- a/typescript/dist/esm/models/ResourceId.d.ts +++ b/typescript/dist/esm/models/ResourceId.d.ts @@ -12,6 +12,7 @@ import { ResourceIdDatasetId } from './ResourceIdDatasetId'; import { ResourceIdLayer } from './ResourceIdLayer'; import { ResourceIdLayerCollection } from './ResourceIdLayerCollection'; +import { ResourceIdMlModel } from './ResourceIdMlModel'; import { ResourceIdProject } from './ResourceIdProject'; /** * @type ResourceId @@ -25,6 +26,8 @@ export type ResourceId = { } & ResourceIdLayer | { type: 'LayerCollection'; } & ResourceIdLayerCollection | { + type: 'MlModel'; +} & ResourceIdMlModel | { type: 'Project'; } & ResourceIdProject; export declare function ResourceIdFromJSON(json: any): ResourceId; diff --git a/typescript/dist/esm/models/ResourceId.js b/typescript/dist/esm/models/ResourceId.js index 9d9a1cf3..2d973f4f 100644 --- a/typescript/dist/esm/models/ResourceId.js +++ b/typescript/dist/esm/models/ResourceId.js @@ -14,6 +14,7 @@ import { ResourceIdDatasetIdFromJSONTyped, ResourceIdDatasetIdToJSON, } from './ResourceIdDatasetId'; import { ResourceIdLayerFromJSONTyped, ResourceIdLayerToJSON, } from './ResourceIdLayer'; import { ResourceIdLayerCollectionFromJSONTyped, ResourceIdLayerCollectionToJSON, } from './ResourceIdLayerCollection'; +import { ResourceIdMlModelFromJSONTyped, ResourceIdMlModelToJSON, } from './ResourceIdMlModel'; import { ResourceIdProjectFromJSONTyped, ResourceIdProjectToJSON, } from './ResourceIdProject'; export function ResourceIdFromJSON(json) { return ResourceIdFromJSONTyped(json, false); @@ -29,6 +30,8 @@ export function ResourceIdFromJSONTyped(json, ignoreDiscriminator) { return Object.assign(Object.assign({}, ResourceIdLayerFromJSONTyped(json, true)), { type: 'Layer' }); case 'LayerCollection': return Object.assign(Object.assign({}, ResourceIdLayerCollectionFromJSONTyped(json, true)), { type: 'LayerCollection' }); + case 'MlModel': + return Object.assign(Object.assign({}, ResourceIdMlModelFromJSONTyped(json, true)), { type: 'MlModel' }); case 'Project': return Object.assign(Object.assign({}, ResourceIdProjectFromJSONTyped(json, true)), { type: 'Project' }); default: @@ -49,6 +52,8 @@ export function ResourceIdToJSON(value) { return ResourceIdLayerToJSON(value); case 'LayerCollection': return ResourceIdLayerCollectionToJSON(value); + case 'MlModel': + return ResourceIdMlModelToJSON(value); case 'Project': return ResourceIdProjectToJSON(value); default: diff --git a/typescript/dist/esm/models/ResourceIdLayer.d.ts b/typescript/dist/esm/models/ResourceIdLayer.d.ts index 7fc449c8..8c391c14 100644 --- a/typescript/dist/esm/models/ResourceIdLayer.d.ts +++ b/typescript/dist/esm/models/ResourceIdLayer.d.ts @@ -36,6 +36,7 @@ export declare const ResourceIdLayerTypeEnum: { readonly LayerCollection: "LayerCollection"; readonly Project: "Project"; readonly DatasetId: "DatasetId"; + readonly MlModel: "MlModel"; }; export type ResourceIdLayerTypeEnum = typeof ResourceIdLayerTypeEnum[keyof typeof ResourceIdLayerTypeEnum]; /** diff --git a/typescript/dist/esm/models/ResourceIdLayer.js b/typescript/dist/esm/models/ResourceIdLayer.js index 18116c0c..d103903a 100644 --- a/typescript/dist/esm/models/ResourceIdLayer.js +++ b/typescript/dist/esm/models/ResourceIdLayer.js @@ -18,7 +18,8 @@ export const ResourceIdLayerTypeEnum = { Layer: 'Layer', LayerCollection: 'LayerCollection', Project: 'Project', - DatasetId: 'DatasetId' + DatasetId: 'DatasetId', + MlModel: 'MlModel' }; /** * Check if a given object implements the ResourceIdLayer interface. diff --git a/typescript/dist/esm/models/ResourceIdMlModel.d.ts b/typescript/dist/esm/models/ResourceIdMlModel.d.ts new file mode 100644 index 00000000..5545ffcd --- /dev/null +++ b/typescript/dist/esm/models/ResourceIdMlModel.d.ts @@ -0,0 +1,44 @@ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 ResourceIdMlModel + */ +export interface ResourceIdMlModel { + /** + * + * @type {string} + * @memberof ResourceIdMlModel + */ + id: string; + /** + * + * @type {string} + * @memberof ResourceIdMlModel + */ + type: ResourceIdMlModelTypeEnum; +} +/** + * @export + */ +export declare const ResourceIdMlModelTypeEnum: { + readonly MlModel: "MlModel"; +}; +export type ResourceIdMlModelTypeEnum = typeof ResourceIdMlModelTypeEnum[keyof typeof ResourceIdMlModelTypeEnum]; +/** + * Check if a given object implements the ResourceIdMlModel interface. + */ +export declare function instanceOfResourceIdMlModel(value: object): boolean; +export declare function ResourceIdMlModelFromJSON(json: any): ResourceIdMlModel; +export declare function ResourceIdMlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdMlModel; +export declare function ResourceIdMlModelToJSON(value?: ResourceIdMlModel | null): any; diff --git a/typescript/dist/esm/models/ResourceIdMlModel.js b/typescript/dist/esm/models/ResourceIdMlModel.js new file mode 100644 index 00000000..5a3b2946 --- /dev/null +++ b/typescript/dist/esm/models/ResourceIdMlModel.js @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 + */ +export const ResourceIdMlModelTypeEnum = { + MlModel: 'MlModel' +}; +/** + * 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; +} +export function ResourceIdMlModelFromJSON(json) { + return ResourceIdMlModelFromJSONTyped(json, false); +} +export function ResourceIdMlModelFromJSONTyped(json, ignoreDiscriminator) { + if ((json === undefined) || (json === null)) { + return json; + } + return { + 'id': json['id'], + 'type': json['type'], + }; +} +export function ResourceIdMlModelToJSON(value) { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + 'id': value.id, + 'type': value.type, + }; +} diff --git a/typescript/dist/esm/models/index.d.ts b/typescript/dist/esm/models/index.d.ts index 8d6afd49..a443896a 100644 --- a/typescript/dist/esm/models/index.d.ts +++ b/typescript/dist/esm/models/index.d.ts @@ -75,6 +75,8 @@ export * from './LogarithmicGradient'; export * from './Measurement'; export * from './MetaDataDefinition'; export * from './MetaDataSuggestion'; +export * from './MlModel'; +export * from './MlModelMetadata'; export * from './MockDatasetDataSourceLoadingInfo'; export * from './MockMetaData'; export * from './MultiLineString'; @@ -141,6 +143,7 @@ export * from './ResourceId'; export * from './ResourceIdDatasetId'; export * from './ResourceIdLayer'; export * from './ResourceIdLayerCollection'; +export * from './ResourceIdMlModel'; export * from './ResourceIdProject'; export * from './RgbaColorizer'; export * from './Role'; diff --git a/typescript/dist/esm/models/index.js b/typescript/dist/esm/models/index.js index 77f147d6..a520c14a 100644 --- a/typescript/dist/esm/models/index.js +++ b/typescript/dist/esm/models/index.js @@ -77,6 +77,8 @@ export * from './LogarithmicGradient'; export * from './Measurement'; export * from './MetaDataDefinition'; export * from './MetaDataSuggestion'; +export * from './MlModel'; +export * from './MlModelMetadata'; export * from './MockDatasetDataSourceLoadingInfo'; export * from './MockMetaData'; export * from './MultiLineString'; @@ -143,6 +145,7 @@ export * from './ResourceId'; export * from './ResourceIdDatasetId'; export * from './ResourceIdLayer'; export * from './ResourceIdLayerCollection'; +export * from './ResourceIdMlModel'; export * from './ResourceIdProject'; export * from './RgbaColorizer'; export * from './Role'; diff --git a/typescript/dist/esm/runtime.js b/typescript/dist/esm/runtime.js index 25a431f8..a4626923 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.11' + 'User-Agent': 'geoengine/openapi-client/typescript/0.0.12' } }); /** diff --git a/typescript/dist/models/MlModel.d.ts b/typescript/dist/models/MlModel.d.ts new file mode 100644 index 00000000..9f01845f --- /dev/null +++ b/typescript/dist/models/MlModel.d.ts @@ -0,0 +1,56 @@ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 type { MlModelMetadata } from './MlModelMetadata'; +/** + * + * @export + * @interface MlModel + */ +export interface MlModel { + /** + * + * @type {string} + * @memberof MlModel + */ + description: string; + /** + * + * @type {string} + * @memberof MlModel + */ + displayName: string; + /** + * + * @type {MlModelMetadata} + * @memberof MlModel + */ + metadata: MlModelMetadata; + /** + * + * @type {string} + * @memberof MlModel + */ + name: string; + /** + * + * @type {string} + * @memberof MlModel + */ + upload: string; +} +/** + * Check if a given object implements the MlModel interface. + */ +export declare function instanceOfMlModel(value: object): boolean; +export declare function MlModelFromJSON(json: any): MlModel; +export declare function MlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModel; +export declare function MlModelToJSON(value?: MlModel | null): any; diff --git a/typescript/dist/models/MlModel.js b/typescript/dist/models/MlModel.js new file mode 100644 index 00000000..e7f6213e --- /dev/null +++ b/typescript/dist/models/MlModel.js @@ -0,0 +1,63 @@ +"use strict"; +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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.MlModelToJSON = exports.MlModelFromJSONTyped = exports.MlModelFromJSON = exports.instanceOfMlModel = void 0; +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; +} +exports.instanceOfMlModel = instanceOfMlModel; +function MlModelFromJSON(json) { + return MlModelFromJSONTyped(json, false); +} +exports.MlModelFromJSON = MlModelFromJSON; +function MlModelFromJSONTyped(json, ignoreDiscriminator) { + if ((json === undefined) || (json === null)) { + return json; + } + return { + 'description': json['description'], + 'displayName': json['displayName'], + 'metadata': (0, MlModelMetadata_1.MlModelMetadataFromJSON)(json['metadata']), + 'name': json['name'], + 'upload': json['upload'], + }; +} +exports.MlModelFromJSONTyped = MlModelFromJSONTyped; +function MlModelToJSON(value) { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + '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 new file mode 100644 index 00000000..8a7f989c --- /dev/null +++ b/typescript/dist/models/MlModelMetadata.d.ts @@ -0,0 +1,50 @@ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 type { RasterDataType } from './RasterDataType'; +/** + * + * @export + * @interface MlModelMetadata + */ +export interface MlModelMetadata { + /** + * + * @type {string} + * @memberof MlModelMetadata + */ + fileName: string; + /** + * + * @type {RasterDataType} + * @memberof MlModelMetadata + */ + inputType: RasterDataType; + /** + * + * @type {number} + * @memberof MlModelMetadata + */ + numInputBands: number; + /** + * + * @type {RasterDataType} + * @memberof MlModelMetadata + */ + outputType: RasterDataType; +} +/** + * Check if a given object implements the MlModelMetadata interface. + */ +export declare function instanceOfMlModelMetadata(value: object): boolean; +export declare function MlModelMetadataFromJSON(json: any): MlModelMetadata; +export declare function MlModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelMetadata; +export declare function MlModelMetadataToJSON(value?: MlModelMetadata | null): any; diff --git a/typescript/dist/models/MlModelMetadata.js b/typescript/dist/models/MlModelMetadata.js new file mode 100644 index 00000000..c8fe0382 --- /dev/null +++ b/typescript/dist/models/MlModelMetadata.js @@ -0,0 +1,60 @@ +"use strict"; +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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.MlModelMetadataToJSON = exports.MlModelMetadataFromJSONTyped = exports.MlModelMetadataFromJSON = exports.instanceOfMlModelMetadata = void 0; +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; +} +exports.instanceOfMlModelMetadata = instanceOfMlModelMetadata; +function MlModelMetadataFromJSON(json) { + return MlModelMetadataFromJSONTyped(json, false); +} +exports.MlModelMetadataFromJSON = MlModelMetadataFromJSON; +function MlModelMetadataFromJSONTyped(json, ignoreDiscriminator) { + if ((json === undefined) || (json === null)) { + return json; + } + return { + 'fileName': json['fileName'], + 'inputType': (0, RasterDataType_1.RasterDataTypeFromJSON)(json['inputType']), + 'numInputBands': json['numInputBands'], + 'outputType': (0, RasterDataType_1.RasterDataTypeFromJSON)(json['outputType']), + }; +} +exports.MlModelMetadataFromJSONTyped = MlModelMetadataFromJSONTyped; +function MlModelMetadataToJSON(value) { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + '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/ResourceId.d.ts b/typescript/dist/models/ResourceId.d.ts index 4a270796..bbad54b7 100644 --- a/typescript/dist/models/ResourceId.d.ts +++ b/typescript/dist/models/ResourceId.d.ts @@ -12,6 +12,7 @@ import { ResourceIdDatasetId } from './ResourceIdDatasetId'; import { ResourceIdLayer } from './ResourceIdLayer'; import { ResourceIdLayerCollection } from './ResourceIdLayerCollection'; +import { ResourceIdMlModel } from './ResourceIdMlModel'; import { ResourceIdProject } from './ResourceIdProject'; /** * @type ResourceId @@ -25,6 +26,8 @@ export type ResourceId = { } & ResourceIdLayer | { type: 'LayerCollection'; } & ResourceIdLayerCollection | { + type: 'MlModel'; +} & ResourceIdMlModel | { type: 'Project'; } & ResourceIdProject; export declare function ResourceIdFromJSON(json: any): ResourceId; diff --git a/typescript/dist/models/ResourceId.js b/typescript/dist/models/ResourceId.js index 4b92be39..a2c83752 100644 --- a/typescript/dist/models/ResourceId.js +++ b/typescript/dist/models/ResourceId.js @@ -17,6 +17,7 @@ exports.ResourceIdToJSON = exports.ResourceIdFromJSONTyped = exports.ResourceIdF const ResourceIdDatasetId_1 = require("./ResourceIdDatasetId"); const ResourceIdLayer_1 = require("./ResourceIdLayer"); const ResourceIdLayerCollection_1 = require("./ResourceIdLayerCollection"); +const ResourceIdMlModel_1 = require("./ResourceIdMlModel"); const ResourceIdProject_1 = require("./ResourceIdProject"); function ResourceIdFromJSON(json) { return ResourceIdFromJSONTyped(json, false); @@ -33,6 +34,8 @@ function ResourceIdFromJSONTyped(json, ignoreDiscriminator) { return Object.assign(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' }); + case 'MlModel': + return Object.assign(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' }); default: @@ -54,6 +57,8 @@ function ResourceIdToJSON(value) { return (0, ResourceIdLayer_1.ResourceIdLayerToJSON)(value); case 'LayerCollection': return (0, ResourceIdLayerCollection_1.ResourceIdLayerCollectionToJSON)(value); + case 'MlModel': + return (0, ResourceIdMlModel_1.ResourceIdMlModelToJSON)(value); case 'Project': return (0, ResourceIdProject_1.ResourceIdProjectToJSON)(value); default: diff --git a/typescript/dist/models/ResourceIdLayer.d.ts b/typescript/dist/models/ResourceIdLayer.d.ts index 7fc449c8..8c391c14 100644 --- a/typescript/dist/models/ResourceIdLayer.d.ts +++ b/typescript/dist/models/ResourceIdLayer.d.ts @@ -36,6 +36,7 @@ export declare const ResourceIdLayerTypeEnum: { readonly LayerCollection: "LayerCollection"; readonly Project: "Project"; readonly DatasetId: "DatasetId"; + readonly MlModel: "MlModel"; }; export type ResourceIdLayerTypeEnum = typeof ResourceIdLayerTypeEnum[keyof typeof ResourceIdLayerTypeEnum]; /** diff --git a/typescript/dist/models/ResourceIdLayer.js b/typescript/dist/models/ResourceIdLayer.js index 3eeaca2f..63379c59 100644 --- a/typescript/dist/models/ResourceIdLayer.js +++ b/typescript/dist/models/ResourceIdLayer.js @@ -21,7 +21,8 @@ exports.ResourceIdLayerTypeEnum = { Layer: 'Layer', LayerCollection: 'LayerCollection', Project: 'Project', - DatasetId: 'DatasetId' + DatasetId: 'DatasetId', + MlModel: 'MlModel' }; /** * Check if a given object implements the ResourceIdLayer interface. diff --git a/typescript/dist/models/ResourceIdMlModel.d.ts b/typescript/dist/models/ResourceIdMlModel.d.ts new file mode 100644 index 00000000..5545ffcd --- /dev/null +++ b/typescript/dist/models/ResourceIdMlModel.d.ts @@ -0,0 +1,44 @@ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 ResourceIdMlModel + */ +export interface ResourceIdMlModel { + /** + * + * @type {string} + * @memberof ResourceIdMlModel + */ + id: string; + /** + * + * @type {string} + * @memberof ResourceIdMlModel + */ + type: ResourceIdMlModelTypeEnum; +} +/** + * @export + */ +export declare const ResourceIdMlModelTypeEnum: { + readonly MlModel: "MlModel"; +}; +export type ResourceIdMlModelTypeEnum = typeof ResourceIdMlModelTypeEnum[keyof typeof ResourceIdMlModelTypeEnum]; +/** + * Check if a given object implements the ResourceIdMlModel interface. + */ +export declare function instanceOfResourceIdMlModel(value: object): boolean; +export declare function ResourceIdMlModelFromJSON(json: any): ResourceIdMlModel; +export declare function ResourceIdMlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdMlModel; +export declare function ResourceIdMlModelToJSON(value?: ResourceIdMlModel | null): any; diff --git a/typescript/dist/models/ResourceIdMlModel.js b/typescript/dist/models/ResourceIdMlModel.js new file mode 100644 index 00000000..d90cc77a --- /dev/null +++ b/typescript/dist/models/ResourceIdMlModel.js @@ -0,0 +1,59 @@ +"use strict"; +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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.ResourceIdMlModelToJSON = exports.ResourceIdMlModelFromJSONTyped = exports.ResourceIdMlModelFromJSON = exports.instanceOfResourceIdMlModel = exports.ResourceIdMlModelTypeEnum = void 0; +/** + * @export + */ +exports.ResourceIdMlModelTypeEnum = { + MlModel: 'MlModel' +}; +/** + * 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; +} +exports.instanceOfResourceIdMlModel = instanceOfResourceIdMlModel; +function ResourceIdMlModelFromJSON(json) { + return ResourceIdMlModelFromJSONTyped(json, false); +} +exports.ResourceIdMlModelFromJSON = ResourceIdMlModelFromJSON; +function ResourceIdMlModelFromJSONTyped(json, ignoreDiscriminator) { + if ((json === undefined) || (json === null)) { + return json; + } + return { + 'id': json['id'], + 'type': json['type'], + }; +} +exports.ResourceIdMlModelFromJSONTyped = ResourceIdMlModelFromJSONTyped; +function ResourceIdMlModelToJSON(value) { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + 'id': value.id, + 'type': value.type, + }; +} +exports.ResourceIdMlModelToJSON = ResourceIdMlModelToJSON; diff --git a/typescript/dist/models/index.d.ts b/typescript/dist/models/index.d.ts index 8d6afd49..a443896a 100644 --- a/typescript/dist/models/index.d.ts +++ b/typescript/dist/models/index.d.ts @@ -75,6 +75,8 @@ export * from './LogarithmicGradient'; export * from './Measurement'; export * from './MetaDataDefinition'; export * from './MetaDataSuggestion'; +export * from './MlModel'; +export * from './MlModelMetadata'; export * from './MockDatasetDataSourceLoadingInfo'; export * from './MockMetaData'; export * from './MultiLineString'; @@ -141,6 +143,7 @@ export * from './ResourceId'; export * from './ResourceIdDatasetId'; export * from './ResourceIdLayer'; export * from './ResourceIdLayerCollection'; +export * from './ResourceIdMlModel'; export * from './ResourceIdProject'; export * from './RgbaColorizer'; export * from './Role'; diff --git a/typescript/dist/models/index.js b/typescript/dist/models/index.js index 6b5d5ec1..a0b41d2b 100644 --- a/typescript/dist/models/index.js +++ b/typescript/dist/models/index.js @@ -93,6 +93,8 @@ __exportStar(require("./LogarithmicGradient"), exports); __exportStar(require("./Measurement"), exports); __exportStar(require("./MetaDataDefinition"), exports); __exportStar(require("./MetaDataSuggestion"), exports); +__exportStar(require("./MlModel"), exports); +__exportStar(require("./MlModelMetadata"), exports); __exportStar(require("./MockDatasetDataSourceLoadingInfo"), exports); __exportStar(require("./MockMetaData"), exports); __exportStar(require("./MultiLineString"), exports); @@ -159,6 +161,7 @@ __exportStar(require("./ResourceId"), exports); __exportStar(require("./ResourceIdDatasetId"), exports); __exportStar(require("./ResourceIdLayer"), exports); __exportStar(require("./ResourceIdLayerCollection"), exports); +__exportStar(require("./ResourceIdMlModel"), exports); __exportStar(require("./ResourceIdProject"), exports); __exportStar(require("./RgbaColorizer"), exports); __exportStar(require("./Role"), exports); diff --git a/typescript/dist/runtime.js b/typescript/dist/runtime.js index fed0c8a2..eb43434a 100644 --- a/typescript/dist/runtime.js +++ b/typescript/dist/runtime.js @@ -73,7 +73,7 @@ class Configuration { exports.Configuration = Configuration; exports.DefaultConfig = new Configuration({ headers: { - 'User-Agent': 'geoengine/openapi-client/typescript/0.0.11' + 'User-Agent': 'geoengine/openapi-client/typescript/0.0.12' } }); /** diff --git a/typescript/package.json b/typescript/package.json index ca068417..811db736 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@geoengine/openapi-client", - "version": "0.0.11", + "version": "0.0.12", "description": "OpenAPI client for @geoengine/openapi-client", "author": "OpenAPI-Generator", "repository": { diff --git a/typescript/src/apis/MLApi.ts b/typescript/src/apis/MLApi.ts new file mode 100644 index 00000000..c4043581 --- /dev/null +++ b/typescript/src/apis/MLApi.ts @@ -0,0 +1,150 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 * as runtime from '../runtime'; +import type { + MlModel, +} from '../models/index'; +import { + MlModelFromJSON, + MlModelToJSON, +} from '../models/index'; + +export interface AddMlModelRequest { + mlModel: MlModel; +} + +export interface GetMlModelRequest { + modelName: string; +} + +/** + * + */ +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.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("session_token", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/ml/models`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: MlModelToJSON(requestParameters.mlModel), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Create a new ml model. + */ + async addMlModel(requestParameters: AddMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.addMlModelRaw(requestParameters, initOverrides); + } + + /** + * 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.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("session_token", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/ml/models/{model_name}`.replace(`{${"model_name"}}`, encodeURIComponent(String(requestParameters.modelName))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => MlModelFromJSON(jsonValue)); + } + + /** + * Get ml model by name. + */ + async getMlModel(requestParameters: GetMlModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getMlModelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List ml models. + */ + async listMlModelsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("session_token", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const response = await this.request({ + path: `/ml/models`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(MlModelFromJSON)); + } + + /** + * List ml models. + */ + async listMlModels(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.listMlModelsRaw(initOverrides); + return await response.value(); + } + +} diff --git a/typescript/src/apis/index.ts b/typescript/src/apis/index.ts index 5d34e466..6cf969fc 100644 --- a/typescript/src/apis/index.ts +++ b/typescript/src/apis/index.ts @@ -3,6 +3,7 @@ export * from './DatasetsApi'; export * from './GeneralApi'; export * from './LayersApi'; +export * from './MLApi'; export * from './OGCWCSApi'; export * from './OGCWFSApi'; export * from './OGCWMSApi'; diff --git a/typescript/src/models/MlModel.ts b/typescript/src/models/MlModel.ts new file mode 100644 index 00000000..be9dd7b3 --- /dev/null +++ b/typescript/src/models/MlModel.ts @@ -0,0 +1,109 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 { exists, mapValues } from '../runtime'; +import type { MlModelMetadata } from './MlModelMetadata'; +import { + MlModelMetadataFromJSON, + MlModelMetadataFromJSONTyped, + MlModelMetadataToJSON, +} from './MlModelMetadata'; + +/** + * + * @export + * @interface MlModel + */ +export interface MlModel { + /** + * + * @type {string} + * @memberof MlModel + */ + description: string; + /** + * + * @type {string} + * @memberof MlModel + */ + displayName: string; + /** + * + * @type {MlModelMetadata} + * @memberof MlModel + */ + metadata: MlModelMetadata; + /** + * + * @type {string} + * @memberof MlModel + */ + name: string; + /** + * + * @type {string} + * @memberof MlModel + */ + upload: string; +} + +/** + * 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 MlModelFromJSON(json: any): MlModel { + return MlModelFromJSONTyped(json, false); +} + +export function MlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModel { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'description': json['description'], + 'displayName': json['displayName'], + 'metadata': MlModelMetadataFromJSON(json['metadata']), + 'name': json['name'], + 'upload': json['upload'], + }; +} + +export function MlModelToJSON(value?: MlModel | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + '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 new file mode 100644 index 00000000..32ecac00 --- /dev/null +++ b/typescript/src/models/MlModelMetadata.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 { exists, mapValues } from '../runtime'; +import type { RasterDataType } from './RasterDataType'; +import { + RasterDataTypeFromJSON, + RasterDataTypeFromJSONTyped, + RasterDataTypeToJSON, +} from './RasterDataType'; + +/** + * + * @export + * @interface MlModelMetadata + */ +export interface MlModelMetadata { + /** + * + * @type {string} + * @memberof MlModelMetadata + */ + fileName: string; + /** + * + * @type {RasterDataType} + * @memberof MlModelMetadata + */ + inputType: RasterDataType; + /** + * + * @type {number} + * @memberof MlModelMetadata + */ + numInputBands: number; + /** + * + * @type {RasterDataType} + * @memberof 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 MlModelMetadataFromJSON(json: any): MlModelMetadata { + return MlModelMetadataFromJSONTyped(json, false); +} + +export function MlModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): MlModelMetadata { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'fileName': json['fileName'], + 'inputType': RasterDataTypeFromJSON(json['inputType']), + 'numInputBands': json['numInputBands'], + 'outputType': RasterDataTypeFromJSON(json['outputType']), + }; +} + +export function MlModelMetadataToJSON(value?: MlModelMetadata | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'fileName': value.fileName, + 'inputType': RasterDataTypeToJSON(value.inputType), + 'numInputBands': value.numInputBands, + 'outputType': RasterDataTypeToJSON(value.outputType), + }; +} + diff --git a/typescript/src/models/ResourceId.ts b/typescript/src/models/ResourceId.ts index f404f3c9..44ef18a3 100644 --- a/typescript/src/models/ResourceId.ts +++ b/typescript/src/models/ResourceId.ts @@ -33,6 +33,13 @@ import { ResourceIdLayerCollectionFromJSONTyped, ResourceIdLayerCollectionToJSON, } from './ResourceIdLayerCollection'; +import { + ResourceIdMlModel, + instanceOfResourceIdMlModel, + ResourceIdMlModelFromJSON, + ResourceIdMlModelFromJSONTyped, + ResourceIdMlModelToJSON, +} from './ResourceIdMlModel'; import { ResourceIdProject, instanceOfResourceIdProject, @@ -46,7 +53,7 @@ import { * * @export */ -export type ResourceId = { type: 'DatasetId' } & ResourceIdDatasetId | { type: 'Layer' } & ResourceIdLayer | { type: 'LayerCollection' } & ResourceIdLayerCollection | { type: 'Project' } & ResourceIdProject; +export type ResourceId = { type: 'DatasetId' } & ResourceIdDatasetId | { type: 'Layer' } & ResourceIdLayer | { type: 'LayerCollection' } & ResourceIdLayerCollection | { type: 'MlModel' } & ResourceIdMlModel | { type: 'Project' } & ResourceIdProject; export function ResourceIdFromJSON(json: any): ResourceId { return ResourceIdFromJSONTyped(json, false); @@ -63,6 +70,8 @@ export function ResourceIdFromJSONTyped(json: any, ignoreDiscriminator: boolean) return {...ResourceIdLayerFromJSONTyped(json, true), type: 'Layer'}; case 'LayerCollection': return {...ResourceIdLayerCollectionFromJSONTyped(json, true), type: 'LayerCollection'}; + case 'MlModel': + return {...ResourceIdMlModelFromJSONTyped(json, true), type: 'MlModel'}; case 'Project': return {...ResourceIdProjectFromJSONTyped(json, true), type: 'Project'}; default: @@ -84,6 +93,8 @@ export function ResourceIdToJSON(value?: ResourceId | null): any { return ResourceIdLayerToJSON(value); case 'LayerCollection': return ResourceIdLayerCollectionToJSON(value); + case 'MlModel': + return ResourceIdMlModelToJSON(value); case 'Project': return ResourceIdProjectToJSON(value); default: diff --git a/typescript/src/models/ResourceIdLayer.ts b/typescript/src/models/ResourceIdLayer.ts index 3b7c067d..d93cd968 100644 --- a/typescript/src/models/ResourceIdLayer.ts +++ b/typescript/src/models/ResourceIdLayer.ts @@ -41,7 +41,8 @@ export const ResourceIdLayerTypeEnum = { Layer: 'Layer', LayerCollection: 'LayerCollection', Project: 'Project', - DatasetId: 'DatasetId' + DatasetId: 'DatasetId', + MlModel: 'MlModel' } as const; export type ResourceIdLayerTypeEnum = typeof ResourceIdLayerTypeEnum[keyof typeof ResourceIdLayerTypeEnum]; diff --git a/typescript/src/models/ResourceIdMlModel.ts b/typescript/src/models/ResourceIdMlModel.ts new file mode 100644 index 00000000..3f0f8070 --- /dev/null +++ b/typescript/src/models/ResourceIdMlModel.ts @@ -0,0 +1,85 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Geo Engine Pro API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.8.0 + * Contact: 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 { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ResourceIdMlModel + */ +export interface ResourceIdMlModel { + /** + * + * @type {string} + * @memberof ResourceIdMlModel + */ + id: string; + /** + * + * @type {string} + * @memberof ResourceIdMlModel + */ + type: ResourceIdMlModelTypeEnum; +} + + +/** + * @export + */ +export const ResourceIdMlModelTypeEnum = { + MlModel: 'MlModel' +} as const; +export type ResourceIdMlModelTypeEnum = typeof ResourceIdMlModelTypeEnum[keyof typeof ResourceIdMlModelTypeEnum]; + + +/** + * 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 ResourceIdMlModelFromJSON(json: any): ResourceIdMlModel { + return ResourceIdMlModelFromJSONTyped(json, false); +} + +export function ResourceIdMlModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResourceIdMlModel { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': json['id'], + 'type': json['type'], + }; +} + +export function ResourceIdMlModelToJSON(value?: ResourceIdMlModel | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'type': value.type, + }; +} + diff --git a/typescript/src/models/index.ts b/typescript/src/models/index.ts index 77f147d6..a520c14a 100644 --- a/typescript/src/models/index.ts +++ b/typescript/src/models/index.ts @@ -77,6 +77,8 @@ export * from './LogarithmicGradient'; export * from './Measurement'; export * from './MetaDataDefinition'; export * from './MetaDataSuggestion'; +export * from './MlModel'; +export * from './MlModelMetadata'; export * from './MockDatasetDataSourceLoadingInfo'; export * from './MockMetaData'; export * from './MultiLineString'; @@ -143,6 +145,7 @@ export * from './ResourceId'; export * from './ResourceIdDatasetId'; export * from './ResourceIdLayer'; export * from './ResourceIdLayerCollection'; +export * from './ResourceIdMlModel'; export * from './ResourceIdProject'; export * from './RgbaColorizer'; export * from './Role'; diff --git a/typescript/src/runtime.ts b/typescript/src/runtime.ts index 2ba6826c..1ee9fefa 100644 --- a/typescript/src/runtime.ts +++ b/typescript/src/runtime.ts @@ -86,7 +86,7 @@ export class Configuration { export const DefaultConfig = new Configuration({ headers: { - 'User-Agent': 'geoengine/openapi-client/typescript/0.0.11' + 'User-Agent': 'geoengine/openapi-client/typescript/0.0.12' } });