From 14a7c328a5907fa812b91c6cfbd4b953189bdd65 Mon Sep 17 00:00:00 2001 From: Michael Mattig Date: Thu, 8 Feb 2024 15:55:52 +0100 Subject: [PATCH 1/7] update breakpoint schema --- .generation/input/openapi.json | 4 ++++ python/geoengine_openapi_client/models/breakpoint.py | 8 ++++---- python/test/test_breakpoint.py | 4 ++++ typescript/dist/esm/models/Breakpoint.d.ts | 4 ++-- typescript/dist/esm/models/Breakpoint.js | 7 ++++--- typescript/dist/models/Breakpoint.d.ts | 4 ++-- typescript/dist/models/Breakpoint.js | 7 ++++--- typescript/src/models/Breakpoint.ts | 10 ++++++---- 8 files changed, 30 insertions(+), 18 deletions(-) diff --git a/.generation/input/openapi.json b/.generation/input/openapi.json index 80884611..bbbf0bb3 100644 --- a/.generation/input/openapi.json +++ b/.generation/input/openapi.json @@ -4971,6 +4971,10 @@ }, "Breakpoint": { "type": "object", + "required": [ + "value", + "color" + ], "properties": { "color": { "$ref": "#/components/schemas/RgbaColor" diff --git a/python/geoengine_openapi_client/models/breakpoint.py b/python/geoengine_openapi_client/models/breakpoint.py index 4f29c952..889ff30f 100644 --- a/python/geoengine_openapi_client/models/breakpoint.py +++ b/python/geoengine_openapi_client/models/breakpoint.py @@ -19,15 +19,15 @@ import json -from typing import List, Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt, conlist +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist class Breakpoint(BaseModel): """ Breakpoint """ - color: Optional[conlist(StrictInt, max_items=4, min_items=4)] = None - value: Optional[Union[StrictFloat, StrictInt]] = None + color: conlist(StrictInt, max_items=4, min_items=4) = Field(...) + value: Union[StrictFloat, StrictInt] = Field(...) __properties = ["color", "value"] class Config: diff --git a/python/test/test_breakpoint.py b/python/test/test_breakpoint.py index 32cdc316..17d06de5 100644 --- a/python/test/test_breakpoint.py +++ b/python/test/test_breakpoint.py @@ -44,6 +44,10 @@ def make_instance(self, include_optional) -> Breakpoint: ) else: return Breakpoint( + color = [ + 56 + ], + value = 1.337, ) """ diff --git a/typescript/dist/esm/models/Breakpoint.d.ts b/typescript/dist/esm/models/Breakpoint.d.ts index 16d727cf..9fc4fad1 100644 --- a/typescript/dist/esm/models/Breakpoint.d.ts +++ b/typescript/dist/esm/models/Breakpoint.d.ts @@ -20,13 +20,13 @@ export interface Breakpoint { * @type {Array} * @memberof Breakpoint */ - color?: Array; + color: Array; /** * * @type {number} * @memberof Breakpoint */ - value?: number; + value: number; } /** * Check if a given object implements the Breakpoint interface. diff --git a/typescript/dist/esm/models/Breakpoint.js b/typescript/dist/esm/models/Breakpoint.js index db541dc5..c069ef4a 100644 --- a/typescript/dist/esm/models/Breakpoint.js +++ b/typescript/dist/esm/models/Breakpoint.js @@ -11,12 +11,13 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { exists } from '../runtime'; /** * Check if a given object implements the Breakpoint interface. */ export function instanceOfBreakpoint(value) { let isInstance = true; + isInstance = isInstance && "color" in value; + isInstance = isInstance && "value" in value; return isInstance; } export function BreakpointFromJSON(json) { @@ -27,8 +28,8 @@ export function BreakpointFromJSONTyped(json, ignoreDiscriminator) { return json; } return { - 'color': !exists(json, 'color') ? undefined : json['color'], - 'value': !exists(json, 'value') ? undefined : json['value'], + 'color': json['color'], + 'value': json['value'], }; } export function BreakpointToJSON(value) { diff --git a/typescript/dist/models/Breakpoint.d.ts b/typescript/dist/models/Breakpoint.d.ts index 16d727cf..9fc4fad1 100644 --- a/typescript/dist/models/Breakpoint.d.ts +++ b/typescript/dist/models/Breakpoint.d.ts @@ -20,13 +20,13 @@ export interface Breakpoint { * @type {Array} * @memberof Breakpoint */ - color?: Array; + color: Array; /** * * @type {number} * @memberof Breakpoint */ - value?: number; + value: number; } /** * Check if a given object implements the Breakpoint interface. diff --git a/typescript/dist/models/Breakpoint.js b/typescript/dist/models/Breakpoint.js index 3ab37f1c..ec98e4cf 100644 --- a/typescript/dist/models/Breakpoint.js +++ b/typescript/dist/models/Breakpoint.js @@ -14,12 +14,13 @@ */ Object.defineProperty(exports, "__esModule", { value: true }); exports.BreakpointToJSON = exports.BreakpointFromJSONTyped = exports.BreakpointFromJSON = exports.instanceOfBreakpoint = void 0; -const runtime_1 = require("../runtime"); /** * Check if a given object implements the Breakpoint interface. */ function instanceOfBreakpoint(value) { let isInstance = true; + isInstance = isInstance && "color" in value; + isInstance = isInstance && "value" in value; return isInstance; } exports.instanceOfBreakpoint = instanceOfBreakpoint; @@ -32,8 +33,8 @@ function BreakpointFromJSONTyped(json, ignoreDiscriminator) { return json; } return { - 'color': !(0, runtime_1.exists)(json, 'color') ? undefined : json['color'], - 'value': !(0, runtime_1.exists)(json, 'value') ? undefined : json['value'], + 'color': json['color'], + 'value': json['value'], }; } exports.BreakpointFromJSONTyped = BreakpointFromJSONTyped; diff --git a/typescript/src/models/Breakpoint.ts b/typescript/src/models/Breakpoint.ts index 87fe7a49..c452b91f 100644 --- a/typescript/src/models/Breakpoint.ts +++ b/typescript/src/models/Breakpoint.ts @@ -24,13 +24,13 @@ export interface Breakpoint { * @type {Array} * @memberof Breakpoint */ - color?: Array; + color: Array; /** * * @type {number} * @memberof Breakpoint */ - value?: number; + value: number; } /** @@ -38,6 +38,8 @@ export interface Breakpoint { */ export function instanceOfBreakpoint(value: object): boolean { let isInstance = true; + isInstance = isInstance && "color" in value; + isInstance = isInstance && "value" in value; return isInstance; } @@ -52,8 +54,8 @@ export function BreakpointFromJSONTyped(json: any, ignoreDiscriminator: boolean) } return { - 'color': !exists(json, 'color') ? undefined : json['color'], - 'value': !exists(json, 'value') ? undefined : json['value'], + 'color': json['color'], + 'value': json['value'], }; } From aa7818b8e29f3a8dc82bc1aa5d50cd6ceacb7c89 Mon Sep 17 00:00:00 2001 From: Michael Mattig Date: Mon, 12 Feb 2024 16:07:12 +0100 Subject: [PATCH 2/7] fix upload file layers --- .generation/input/openapi.json | 2 +- python/geoengine_openapi_client/api/uploads_api.py | 9 +++++---- typescript/dist/apis/UploadsApi.d.ts | 6 +++--- typescript/dist/apis/UploadsApi.js | 2 +- typescript/dist/esm/apis/UploadsApi.d.ts | 6 +++--- typescript/dist/esm/apis/UploadsApi.js | 4 ++-- typescript/src/apis/UploadsApi.ts | 9 ++++++--- 7 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.generation/input/openapi.json b/.generation/input/openapi.json index bbbf0bb3..cf88fcd4 100644 --- a/.generation/input/openapi.json +++ b/.generation/input/openapi.json @@ -3229,7 +3229,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UploadFilesResponse" + "$ref": "#/components/schemas/UploadFileLayersResponse" }, "example": { "layers": [ diff --git a/python/geoengine_openapi_client/api/uploads_api.py b/python/geoengine_openapi_client/api/uploads_api.py index 90b3944e..8a192219 100644 --- a/python/geoengine_openapi_client/api/uploads_api.py +++ b/python/geoengine_openapi_client/api/uploads_api.py @@ -25,6 +25,7 @@ from typing import Union from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response +from geoengine_openapi_client.models.upload_file_layers_response import UploadFileLayersResponse from geoengine_openapi_client.models.upload_files_response import UploadFilesResponse from geoengine_openapi_client.api_client import ApiClient @@ -48,7 +49,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client @validate_arguments - def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> UploadFilesResponse: # noqa: E501 + def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> UploadFileLayersResponse: # noqa: E501 """List the layers of on uploaded file. # noqa: E501 List the layers of on uploaded file. # noqa: E501 @@ -71,7 +72,7 @@ def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: UploadFilesResponse + :rtype: UploadFileLayersResponse """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: @@ -116,7 +117,7 @@ def list_upload_file_layers_handler_with_http_info(self, upload_id : Annotated[S :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(UploadFilesResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(UploadFileLayersResponse, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() @@ -175,7 +176,7 @@ def list_upload_file_layers_handler_with_http_info(self, upload_id : Annotated[S _auth_settings = ['session_token'] # noqa: E501 _response_types_map = { - '200': "UploadFilesResponse", + '200': "UploadFileLayersResponse", } return self.api_client.call_api( diff --git a/typescript/dist/apis/UploadsApi.d.ts b/typescript/dist/apis/UploadsApi.d.ts index 704ac08f..bc1a471b 100644 --- a/typescript/dist/apis/UploadsApi.d.ts +++ b/typescript/dist/apis/UploadsApi.d.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ import * as runtime from '../runtime'; -import type { AddCollection200Response, UploadFilesResponse } from '../models/index'; +import type { AddCollection200Response, UploadFileLayersResponse, UploadFilesResponse } from '../models/index'; export interface ListUploadFileLayersHandlerRequest { uploadId: string; fileName: string; @@ -29,12 +29,12 @@ export declare class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * List the files of on upload. * List the files of on upload. diff --git a/typescript/dist/apis/UploadsApi.js b/typescript/dist/apis/UploadsApi.js index 0162a51f..2db0a342 100644 --- a/typescript/dist/apis/UploadsApi.js +++ b/typescript/dist/apis/UploadsApi.js @@ -56,7 +56,7 @@ class UploadsApi extends runtime.BaseAPI { headers: headerParameters, query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadFilesResponseFromJSON)(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadFileLayersResponseFromJSON)(jsonValue)); }); } /** diff --git a/typescript/dist/esm/apis/UploadsApi.d.ts b/typescript/dist/esm/apis/UploadsApi.d.ts index 704ac08f..bc1a471b 100644 --- a/typescript/dist/esm/apis/UploadsApi.d.ts +++ b/typescript/dist/esm/apis/UploadsApi.d.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ import * as runtime from '../runtime'; -import type { AddCollection200Response, UploadFilesResponse } from '../models/index'; +import type { AddCollection200Response, UploadFileLayersResponse, UploadFilesResponse } from '../models/index'; export interface ListUploadFileLayersHandlerRequest { uploadId: string; fileName: string; @@ -29,12 +29,12 @@ export declare class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * List the files of on upload. * List the files of on upload. diff --git a/typescript/dist/esm/apis/UploadsApi.js b/typescript/dist/esm/apis/UploadsApi.js index 33898f5d..9f279327 100644 --- a/typescript/dist/esm/apis/UploadsApi.js +++ b/typescript/dist/esm/apis/UploadsApi.js @@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; import * as runtime from '../runtime'; -import { AddCollection200ResponseFromJSON, UploadFilesResponseFromJSON, } from '../models/index'; +import { AddCollection200ResponseFromJSON, UploadFileLayersResponseFromJSON, UploadFilesResponseFromJSON, } from '../models/index'; /** * */ @@ -53,7 +53,7 @@ export class UploadsApi extends runtime.BaseAPI { headers: headerParameters, query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => UploadFilesResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => UploadFileLayersResponseFromJSON(jsonValue)); }); } /** diff --git a/typescript/src/apis/UploadsApi.ts b/typescript/src/apis/UploadsApi.ts index 81533361..39502659 100644 --- a/typescript/src/apis/UploadsApi.ts +++ b/typescript/src/apis/UploadsApi.ts @@ -16,11 +16,14 @@ import * as runtime from '../runtime'; import type { AddCollection200Response, + UploadFileLayersResponse, UploadFilesResponse, } from '../models/index'; import { AddCollection200ResponseFromJSON, AddCollection200ResponseToJSON, + UploadFileLayersResponseFromJSON, + UploadFileLayersResponseToJSON, UploadFilesResponseFromJSON, UploadFilesResponseToJSON, } from '../models/index'; @@ -47,7 +50,7 @@ export class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - async listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) { throw new runtime.RequiredError('uploadId','Required parameter requestParameters.uploadId was null or undefined when calling listUploadFileLayersHandler.'); } @@ -75,14 +78,14 @@ export class UploadsApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => UploadFilesResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => UploadFileLayersResponseFromJSON(jsonValue)); } /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - async listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + async listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.listUploadFileLayersHandlerRaw(requestParameters, initOverrides); return await response.value(); } From 87a493cbf2679b8ee9a2f8634995a4af691fca18 Mon Sep 17 00:00:00 2001 From: Michael Mattig Date: Mon, 12 Feb 2024 16:07:12 +0100 Subject: [PATCH 3/7] fix upload file layers --- .generation/input/openapi.json | 2 +- python/geoengine_openapi_client/api/uploads_api.py | 9 +++++---- typescript/dist/apis/UploadsApi.d.ts | 6 +++--- typescript/dist/apis/UploadsApi.js | 2 +- typescript/dist/esm/apis/UploadsApi.d.ts | 6 +++--- typescript/dist/esm/apis/UploadsApi.js | 4 ++-- typescript/src/apis/DatasetsApi.ts | 1 - typescript/src/apis/UploadsApi.ts | 9 ++++++--- 8 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.generation/input/openapi.json b/.generation/input/openapi.json index bbbf0bb3..cf88fcd4 100644 --- a/.generation/input/openapi.json +++ b/.generation/input/openapi.json @@ -3229,7 +3229,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UploadFilesResponse" + "$ref": "#/components/schemas/UploadFileLayersResponse" }, "example": { "layers": [ diff --git a/python/geoengine_openapi_client/api/uploads_api.py b/python/geoengine_openapi_client/api/uploads_api.py index 90b3944e..8a192219 100644 --- a/python/geoengine_openapi_client/api/uploads_api.py +++ b/python/geoengine_openapi_client/api/uploads_api.py @@ -25,6 +25,7 @@ from typing import Union from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response +from geoengine_openapi_client.models.upload_file_layers_response import UploadFileLayersResponse from geoengine_openapi_client.models.upload_files_response import UploadFilesResponse from geoengine_openapi_client.api_client import ApiClient @@ -48,7 +49,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client @validate_arguments - def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> UploadFilesResponse: # noqa: E501 + def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> UploadFileLayersResponse: # noqa: E501 """List the layers of on uploaded file. # noqa: E501 List the layers of on uploaded file. # noqa: E501 @@ -71,7 +72,7 @@ def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: UploadFilesResponse + :rtype: UploadFileLayersResponse """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: @@ -116,7 +117,7 @@ def list_upload_file_layers_handler_with_http_info(self, upload_id : Annotated[S :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(UploadFilesResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(UploadFileLayersResponse, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() @@ -175,7 +176,7 @@ def list_upload_file_layers_handler_with_http_info(self, upload_id : Annotated[S _auth_settings = ['session_token'] # noqa: E501 _response_types_map = { - '200': "UploadFilesResponse", + '200': "UploadFileLayersResponse", } return self.api_client.call_api( diff --git a/typescript/dist/apis/UploadsApi.d.ts b/typescript/dist/apis/UploadsApi.d.ts index 704ac08f..bc1a471b 100644 --- a/typescript/dist/apis/UploadsApi.d.ts +++ b/typescript/dist/apis/UploadsApi.d.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ import * as runtime from '../runtime'; -import type { AddCollection200Response, UploadFilesResponse } from '../models/index'; +import type { AddCollection200Response, UploadFileLayersResponse, UploadFilesResponse } from '../models/index'; export interface ListUploadFileLayersHandlerRequest { uploadId: string; fileName: string; @@ -29,12 +29,12 @@ export declare class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * List the files of on upload. * List the files of on upload. diff --git a/typescript/dist/apis/UploadsApi.js b/typescript/dist/apis/UploadsApi.js index 0162a51f..2db0a342 100644 --- a/typescript/dist/apis/UploadsApi.js +++ b/typescript/dist/apis/UploadsApi.js @@ -56,7 +56,7 @@ class UploadsApi extends runtime.BaseAPI { headers: headerParameters, query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadFilesResponseFromJSON)(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadFileLayersResponseFromJSON)(jsonValue)); }); } /** diff --git a/typescript/dist/esm/apis/UploadsApi.d.ts b/typescript/dist/esm/apis/UploadsApi.d.ts index 704ac08f..bc1a471b 100644 --- a/typescript/dist/esm/apis/UploadsApi.d.ts +++ b/typescript/dist/esm/apis/UploadsApi.d.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ import * as runtime from '../runtime'; -import type { AddCollection200Response, UploadFilesResponse } from '../models/index'; +import type { AddCollection200Response, UploadFileLayersResponse, UploadFilesResponse } from '../models/index'; export interface ListUploadFileLayersHandlerRequest { uploadId: string; fileName: string; @@ -29,12 +29,12 @@ export declare class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * List the files of on upload. * List the files of on upload. diff --git a/typescript/dist/esm/apis/UploadsApi.js b/typescript/dist/esm/apis/UploadsApi.js index 33898f5d..9f279327 100644 --- a/typescript/dist/esm/apis/UploadsApi.js +++ b/typescript/dist/esm/apis/UploadsApi.js @@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; import * as runtime from '../runtime'; -import { AddCollection200ResponseFromJSON, UploadFilesResponseFromJSON, } from '../models/index'; +import { AddCollection200ResponseFromJSON, UploadFileLayersResponseFromJSON, UploadFilesResponseFromJSON, } from '../models/index'; /** * */ @@ -53,7 +53,7 @@ export class UploadsApi extends runtime.BaseAPI { headers: headerParameters, query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => UploadFilesResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => UploadFileLayersResponseFromJSON(jsonValue)); }); } /** diff --git a/typescript/src/apis/DatasetsApi.ts b/typescript/src/apis/DatasetsApi.ts index 1c5bed68..94233d07 100644 --- a/typescript/src/apis/DatasetsApi.ts +++ b/typescript/src/apis/DatasetsApi.ts @@ -90,7 +90,6 @@ export class DatasetsApi extends runtime.BaseAPI { /** * Creates a new dataset using previously uploaded files. The format of the files will be automatically detected when possible. - * Creates a new dataset using previously uploaded files. */ async autoCreateDatasetHandlerRaw(requestParameters: AutoCreateDatasetHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.autoCreateDataset === null || requestParameters.autoCreateDataset === undefined) { diff --git a/typescript/src/apis/UploadsApi.ts b/typescript/src/apis/UploadsApi.ts index 81533361..39502659 100644 --- a/typescript/src/apis/UploadsApi.ts +++ b/typescript/src/apis/UploadsApi.ts @@ -16,11 +16,14 @@ import * as runtime from '../runtime'; import type { AddCollection200Response, + UploadFileLayersResponse, UploadFilesResponse, } from '../models/index'; import { AddCollection200ResponseFromJSON, AddCollection200ResponseToJSON, + UploadFileLayersResponseFromJSON, + UploadFileLayersResponseToJSON, UploadFilesResponseFromJSON, UploadFilesResponseToJSON, } from '../models/index'; @@ -47,7 +50,7 @@ export class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - async listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) { throw new runtime.RequiredError('uploadId','Required parameter requestParameters.uploadId was null or undefined when calling listUploadFileLayersHandler.'); } @@ -75,14 +78,14 @@ export class UploadsApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => UploadFilesResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => UploadFileLayersResponseFromJSON(jsonValue)); } /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - async listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + async listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.listUploadFileLayersHandlerRaw(requestParameters, initOverrides); return await response.value(); } From eaa300700ad64706b4c2fbbe05352aac368640a6 Mon Sep 17 00:00:00 2001 From: Michael Mattig Date: Fri, 16 Feb 2024 15:29:26 +0100 Subject: [PATCH 4/7] update openapi-client --- .generation/input/openapi.json | 57 ++++++- .generation/util/ui-dev-update.sh | 36 ++++ python/README.md | 1 + .../api/datasets_api.py | 154 ++++++++++++++++++ .../api/uploads_api.py | 9 +- python/test/test_datasets_api.py | 7 + typescript/dist/apis/DatasetsApi.d.ts | 16 +- typescript/dist/apis/DatasetsApi.js | 41 +++++ typescript/dist/apis/UploadsApi.d.ts | 6 +- typescript/dist/apis/UploadsApi.js | 2 +- typescript/dist/esm/apis/DatasetsApi.d.ts | 16 +- typescript/dist/esm/apis/DatasetsApi.js | 43 ++++- typescript/dist/esm/apis/UploadsApi.d.ts | 6 +- typescript/dist/esm/apis/UploadsApi.js | 4 +- typescript/src/apis/DatasetsApi.ts | 55 +++++++ typescript/src/apis/UploadsApi.ts | 9 +- 16 files changed, 438 insertions(+), 24 deletions(-) create mode 100644 .generation/util/ui-dev-update.sh diff --git a/.generation/input/openapi.json b/.generation/input/openapi.json index cf88fcd4..83ff13c9 100644 --- a/.generation/input/openapi.json +++ b/.generation/input/openapi.json @@ -729,6 +729,61 @@ ] } }, + "/dataset/{dataset}/symbology": { + "post": { + "tags": [ + "Datasets" + ], + "summary": "Updates the dataset's symbology", + "description": "Updates the dataset's symbology", + "operationId": "update_dataset_symbology_handler", + "parameters": [ + { + "name": "dataset", + "in": "path", + "description": "Dataset Name", + "required": true, + "schema": { + "$ref": "#/components/schemas/DatasetName" + } + } + ], + "requestBody": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Symbology" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedUserResponse" + } + }, + "security": [ + { + "session_token": [] + } + ] + } + }, "/datasetFromWorkflow/{id}": { "post": { "tags": [ @@ -3229,7 +3284,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UploadFileLayersResponse" + "$ref": "#/components/schemas/UploadFilesResponse" }, "example": { "layers": [ diff --git a/.generation/util/ui-dev-update.sh b/.generation/util/ui-dev-update.sh new file mode 100644 index 00000000..a2054096 --- /dev/null +++ b/.generation/util/ui-dev-update.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# FOR DEVELOPMENT USE ONLY +# +# Usage (from the repo root): ./util/ui-dev-update.sh commit-message +# +# this script uses the OpenAPI json from a Geo Engine instance running on port 3030 +# it generates the openapi-client and pushes it to the current branch +# then it updates the geoengine-ui's openapi-client dependency to the development branch +# note: the geoengine-ui git repo must be in the same directory as the openapi-client repo + +set -e + +wget http://localhost:3030/api/api-docs/openapi.json -O - | python3 -m json.tool --indent 2 > .generation/input/openapi.json +.generation/generate.py --no-spec-fetch --no-container-build python +.generation/generate.py --no-spec-fetch --no-container-build typescript + +git add . + +# Get all arguments as a single string +args_as_string="$*" + +# Set the commit message to the input arguments or a default message +message=${args_as_string:-"update openapi-client"} + +git commit -m "$message" +git push + +current_branch=$(git rev-parse --abbrev-ref HEAD) + +cd ../geoengine-ui + +npm uninstall @geoengine/openapi-client +npm install @geoengine/openapi-client@https://gitpkg.now.sh/geo-engine/openapi-client/typescript?${current_branch} + +cd - diff --git a/python/README.md b/python/README.md index 2f6c4423..ee11fe01 100644 --- a/python/README.md +++ b/python/README.md @@ -102,6 +102,7 @@ Class | Method | HTTP request | Description *DatasetsApi* | [**list_datasets_handler**](docs/DatasetsApi.md#list_datasets_handler) | **GET** /datasets | Lists available datasets. *DatasetsApi* | [**list_volumes_handler**](docs/DatasetsApi.md#list_volumes_handler) | **GET** /dataset/volumes | Lists available volumes. *DatasetsApi* | [**suggest_meta_data_handler**](docs/DatasetsApi.md#suggest_meta_data_handler) | **GET** /dataset/suggest | Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. +*DatasetsApi* | [**update_dataset_symbology_handler**](docs/DatasetsApi.md#update_dataset_symbology_handler) | **POST** /dataset/{dataset}/symbology | Updates the dataset's symbology *GeneralApi* | [**available_handler**](docs/GeneralApi.md#available_handler) | **GET** /available | Server availablity check. *GeneralApi* | [**server_info_handler**](docs/GeneralApi.md#server_info_handler) | **GET** /info | Shows information about the server software version. *LayersApi* | [**add_collection**](docs/LayersApi.md#add_collection) | **POST** /layerDb/collections/{collection}/collections | Add a new collection to an existing collection diff --git a/python/geoengine_openapi_client/api/datasets_api.py b/python/geoengine_openapi_client/api/datasets_api.py index 44f056b6..caef4c83 100644 --- a/python/geoengine_openapi_client/api/datasets_api.py +++ b/python/geoengine_openapi_client/api/datasets_api.py @@ -32,6 +32,7 @@ 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.order_by import OrderBy +from geoengine_openapi_client.models.symbology import Symbology from geoengine_openapi_client.models.volume import Volume from geoengine_openapi_client.api_client import ApiClient @@ -1242,3 +1243,156 @@ def suggest_meta_data_handler_with_http_info(self, upload : StrictStr, main_file _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) + + @validate_arguments + def update_dataset_symbology_handler(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], symbology : Symbology, **kwargs) -> None: # noqa: E501 + """Updates the dataset's symbology # noqa: E501 + + Updates the dataset's symbology # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_dataset_symbology_handler(dataset, symbology, async_req=True) + >>> result = thread.get() + + :param dataset: Dataset Name (required) + :type dataset: str + :param symbology: (required) + :type symbology: Symbology + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + message = "Error! Please call the update_dataset_symbology_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return self.update_dataset_symbology_handler_with_http_info(dataset, symbology, **kwargs) # noqa: E501 + + @validate_arguments + def update_dataset_symbology_handler_with_http_info(self, dataset : Annotated[StrictStr, Field(..., description="Dataset Name")], symbology : Symbology, **kwargs) -> ApiResponse: # noqa: E501 + """Updates the dataset's symbology # noqa: E501 + + Updates the dataset's symbology # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_dataset_symbology_handler_with_http_info(dataset, symbology, async_req=True) + >>> result = thread.get() + + :param dataset: Dataset Name (required) + :type dataset: str + :param symbology: (required) + :type symbology: Symbology + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_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 = [ + 'dataset', + 'symbology' + ] + _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 update_dataset_symbology_handler" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + if _params['dataset']: + _path_params['dataset'] = _params['dataset'] + + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['symbology'] is not None: + _body_params = _params['symbology'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # 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( + '/dataset/{dataset}/symbology', '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')) diff --git a/python/geoengine_openapi_client/api/uploads_api.py b/python/geoengine_openapi_client/api/uploads_api.py index 8a192219..90b3944e 100644 --- a/python/geoengine_openapi_client/api/uploads_api.py +++ b/python/geoengine_openapi_client/api/uploads_api.py @@ -25,7 +25,6 @@ from typing import Union from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response -from geoengine_openapi_client.models.upload_file_layers_response import UploadFileLayersResponse from geoengine_openapi_client.models.upload_files_response import UploadFilesResponse from geoengine_openapi_client.api_client import ApiClient @@ -49,7 +48,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client @validate_arguments - def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> UploadFileLayersResponse: # noqa: E501 + def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> UploadFilesResponse: # noqa: E501 """List the layers of on uploaded file. # noqa: E501 List the layers of on uploaded file. # noqa: E501 @@ -72,7 +71,7 @@ def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: UploadFileLayersResponse + :rtype: UploadFilesResponse """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: @@ -117,7 +116,7 @@ def list_upload_file_layers_handler_with_http_info(self, upload_id : Annotated[S :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(UploadFileLayersResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(UploadFilesResponse, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() @@ -176,7 +175,7 @@ def list_upload_file_layers_handler_with_http_info(self, upload_id : Annotated[S _auth_settings = ['session_token'] # noqa: E501 _response_types_map = { - '200': "UploadFileLayersResponse", + '200': "UploadFilesResponse", } return self.api_client.call_api( diff --git a/python/test/test_datasets_api.py b/python/test/test_datasets_api.py index ffd8f218..60a6c9f2 100644 --- a/python/test/test_datasets_api.py +++ b/python/test/test_datasets_api.py @@ -83,6 +83,13 @@ def test_suggest_meta_data_handler(self) -> None: """ pass + def test_update_dataset_symbology_handler(self) -> None: + """Test case for update_dataset_symbology_handler + + Updates the dataset's symbology # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/typescript/dist/apis/DatasetsApi.d.ts b/typescript/dist/apis/DatasetsApi.d.ts index c7a217e1..8c664433 100644 --- a/typescript/dist/apis/DatasetsApi.d.ts +++ b/typescript/dist/apis/DatasetsApi.d.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ import * as runtime from '../runtime'; -import type { AutoCreateDataset, CreateDataset, CreateDatasetHandler200Response, Dataset, DatasetListing, MetaDataDefinition, MetaDataSuggestion, OrderBy, Volume } from '../models/index'; +import type { AutoCreateDataset, CreateDataset, CreateDatasetHandler200Response, Dataset, DatasetListing, MetaDataDefinition, MetaDataSuggestion, OrderBy, Symbology, Volume } from '../models/index'; export interface AutoCreateDatasetHandlerRequest { autoCreateDataset: AutoCreateDataset; } @@ -38,6 +38,10 @@ export interface SuggestMetaDataHandlerRequest { mainFile?: string | null; layerName?: string | null; } +export interface UpdateDatasetSymbologyHandlerRequest { + dataset: string; + symbology: Symbology; +} /** * */ @@ -122,4 +126,14 @@ export declare class DatasetsApi extends runtime.BaseAPI { * Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. */ suggestMetaDataHandler(requestParameters: SuggestMetaDataHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** + * Updates the dataset\'s symbology + * Updates the dataset\'s symbology + */ + updateDatasetSymbologyHandlerRaw(requestParameters: UpdateDatasetSymbologyHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + /** + * Updates the dataset\'s symbology + * Updates the dataset\'s symbology + */ + updateDatasetSymbologyHandler(requestParameters: UpdateDatasetSymbologyHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } diff --git a/typescript/dist/apis/DatasetsApi.js b/typescript/dist/apis/DatasetsApi.js index e120d8ee..78d70249 100644 --- a/typescript/dist/apis/DatasetsApi.js +++ b/typescript/dist/apis/DatasetsApi.js @@ -355,5 +355,46 @@ class DatasetsApi extends runtime.BaseAPI { return yield response.value(); }); } + /** + * Updates the dataset\'s symbology + * Updates the dataset\'s symbology + */ + updateDatasetSymbologyHandlerRaw(requestParameters, initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + if (requestParameters.dataset === null || requestParameters.dataset === undefined) { + throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling updateDatasetSymbologyHandler.'); + } + if (requestParameters.symbology === null || requestParameters.symbology === undefined) { + throw new runtime.RequiredError('symbology', 'Required parameter requestParameters.symbology was null or undefined when calling updateDatasetSymbologyHandler.'); + } + 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: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: (0, index_1.SymbologyToJSON)(requestParameters.symbology), + }, initOverrides); + return new runtime.VoidApiResponse(response); + }); + } + /** + * Updates the dataset\'s symbology + * Updates the dataset\'s symbology + */ + updateDatasetSymbologyHandler(requestParameters, initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + yield this.updateDatasetSymbologyHandlerRaw(requestParameters, initOverrides); + }); + } } exports.DatasetsApi = DatasetsApi; diff --git a/typescript/dist/apis/UploadsApi.d.ts b/typescript/dist/apis/UploadsApi.d.ts index bc1a471b..704ac08f 100644 --- a/typescript/dist/apis/UploadsApi.d.ts +++ b/typescript/dist/apis/UploadsApi.d.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ import * as runtime from '../runtime'; -import type { AddCollection200Response, UploadFileLayersResponse, UploadFilesResponse } from '../models/index'; +import type { AddCollection200Response, UploadFilesResponse } from '../models/index'; export interface ListUploadFileLayersHandlerRequest { uploadId: string; fileName: string; @@ -29,12 +29,12 @@ export declare class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * List the files of on upload. * List the files of on upload. diff --git a/typescript/dist/apis/UploadsApi.js b/typescript/dist/apis/UploadsApi.js index 2db0a342..0162a51f 100644 --- a/typescript/dist/apis/UploadsApi.js +++ b/typescript/dist/apis/UploadsApi.js @@ -56,7 +56,7 @@ class UploadsApi extends runtime.BaseAPI { headers: headerParameters, query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadFileLayersResponseFromJSON)(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadFilesResponseFromJSON)(jsonValue)); }); } /** diff --git a/typescript/dist/esm/apis/DatasetsApi.d.ts b/typescript/dist/esm/apis/DatasetsApi.d.ts index c7a217e1..8c664433 100644 --- a/typescript/dist/esm/apis/DatasetsApi.d.ts +++ b/typescript/dist/esm/apis/DatasetsApi.d.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ import * as runtime from '../runtime'; -import type { AutoCreateDataset, CreateDataset, CreateDatasetHandler200Response, Dataset, DatasetListing, MetaDataDefinition, MetaDataSuggestion, OrderBy, Volume } from '../models/index'; +import type { AutoCreateDataset, CreateDataset, CreateDatasetHandler200Response, Dataset, DatasetListing, MetaDataDefinition, MetaDataSuggestion, OrderBy, Symbology, Volume } from '../models/index'; export interface AutoCreateDatasetHandlerRequest { autoCreateDataset: AutoCreateDataset; } @@ -38,6 +38,10 @@ export interface SuggestMetaDataHandlerRequest { mainFile?: string | null; layerName?: string | null; } +export interface UpdateDatasetSymbologyHandlerRequest { + dataset: string; + symbology: Symbology; +} /** * */ @@ -122,4 +126,14 @@ export declare class DatasetsApi extends runtime.BaseAPI { * Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. */ suggestMetaDataHandler(requestParameters: SuggestMetaDataHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** + * Updates the dataset\'s symbology + * Updates the dataset\'s symbology + */ + updateDatasetSymbologyHandlerRaw(requestParameters: UpdateDatasetSymbologyHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + /** + * Updates the dataset\'s symbology + * Updates the dataset\'s symbology + */ + updateDatasetSymbologyHandler(requestParameters: UpdateDatasetSymbologyHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } diff --git a/typescript/dist/esm/apis/DatasetsApi.js b/typescript/dist/esm/apis/DatasetsApi.js index 4109816b..ec3750a6 100644 --- a/typescript/dist/esm/apis/DatasetsApi.js +++ b/typescript/dist/esm/apis/DatasetsApi.js @@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; import * as runtime from '../runtime'; -import { AutoCreateDatasetToJSON, CreateDatasetToJSON, CreateDatasetHandler200ResponseFromJSON, DatasetFromJSON, DatasetListingFromJSON, MetaDataDefinitionFromJSON, MetaDataSuggestionFromJSON, VolumeFromJSON, } from '../models/index'; +import { AutoCreateDatasetToJSON, CreateDatasetToJSON, CreateDatasetHandler200ResponseFromJSON, DatasetFromJSON, DatasetListingFromJSON, MetaDataDefinitionFromJSON, MetaDataSuggestionFromJSON, SymbologyToJSON, VolumeFromJSON, } from '../models/index'; /** * */ @@ -352,4 +352,45 @@ export class DatasetsApi extends runtime.BaseAPI { return yield response.value(); }); } + /** + * Updates the dataset\'s symbology + * Updates the dataset\'s symbology + */ + updateDatasetSymbologyHandlerRaw(requestParameters, initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + if (requestParameters.dataset === null || requestParameters.dataset === undefined) { + throw new runtime.RequiredError('dataset', 'Required parameter requestParameters.dataset was null or undefined when calling updateDatasetSymbologyHandler.'); + } + if (requestParameters.symbology === null || requestParameters.symbology === undefined) { + throw new runtime.RequiredError('symbology', 'Required parameter requestParameters.symbology was null or undefined when calling updateDatasetSymbologyHandler.'); + } + 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: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SymbologyToJSON(requestParameters.symbology), + }, initOverrides); + return new runtime.VoidApiResponse(response); + }); + } + /** + * Updates the dataset\'s symbology + * Updates the dataset\'s symbology + */ + updateDatasetSymbologyHandler(requestParameters, initOverrides) { + return __awaiter(this, void 0, void 0, function* () { + yield this.updateDatasetSymbologyHandlerRaw(requestParameters, initOverrides); + }); + } } diff --git a/typescript/dist/esm/apis/UploadsApi.d.ts b/typescript/dist/esm/apis/UploadsApi.d.ts index bc1a471b..704ac08f 100644 --- a/typescript/dist/esm/apis/UploadsApi.d.ts +++ b/typescript/dist/esm/apis/UploadsApi.d.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ import * as runtime from '../runtime'; -import type { AddCollection200Response, UploadFileLayersResponse, UploadFilesResponse } from '../models/index'; +import type { AddCollection200Response, UploadFilesResponse } from '../models/index'; export interface ListUploadFileLayersHandlerRequest { uploadId: string; fileName: string; @@ -29,12 +29,12 @@ export declare class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * List the files of on upload. * List the files of on upload. diff --git a/typescript/dist/esm/apis/UploadsApi.js b/typescript/dist/esm/apis/UploadsApi.js index 9f279327..33898f5d 100644 --- a/typescript/dist/esm/apis/UploadsApi.js +++ b/typescript/dist/esm/apis/UploadsApi.js @@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; import * as runtime from '../runtime'; -import { AddCollection200ResponseFromJSON, UploadFileLayersResponseFromJSON, UploadFilesResponseFromJSON, } from '../models/index'; +import { AddCollection200ResponseFromJSON, UploadFilesResponseFromJSON, } from '../models/index'; /** * */ @@ -53,7 +53,7 @@ export class UploadsApi extends runtime.BaseAPI { headers: headerParameters, query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => UploadFileLayersResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => UploadFilesResponseFromJSON(jsonValue)); }); } /** diff --git a/typescript/src/apis/DatasetsApi.ts b/typescript/src/apis/DatasetsApi.ts index 94233d07..d2b84833 100644 --- a/typescript/src/apis/DatasetsApi.ts +++ b/typescript/src/apis/DatasetsApi.ts @@ -24,6 +24,7 @@ import type { MetaDataDefinition, MetaDataSuggestion, OrderBy, + Symbology, Volume, } from '../models/index'; import { @@ -45,6 +46,8 @@ import { MetaDataSuggestionToJSON, OrderByFromJSON, OrderByToJSON, + SymbologyFromJSON, + SymbologyToJSON, VolumeFromJSON, VolumeToJSON, } from '../models/index'; @@ -83,6 +86,11 @@ export interface SuggestMetaDataHandlerRequest { layerName?: string | null; } +export interface UpdateDatasetSymbologyHandlerRequest { + dataset: string; + symbology: Symbology; +} + /** * */ @@ -90,6 +98,7 @@ export class DatasetsApi extends runtime.BaseAPI { /** * Creates a new dataset using previously uploaded files. The format of the files will be automatically detected when possible. + * Creates a new dataset using previously uploaded files. */ async autoCreateDatasetHandlerRaw(requestParameters: AutoCreateDatasetHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.autoCreateDataset === null || requestParameters.autoCreateDataset === undefined) { @@ -448,4 +457,50 @@ export class DatasetsApi extends runtime.BaseAPI { return await response.value(); } + /** + * Updates the dataset\'s symbology + * Updates the dataset\'s symbology + */ + async updateDatasetSymbologyHandlerRaw(requestParameters: UpdateDatasetSymbologyHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.dataset === null || requestParameters.dataset === undefined) { + throw new runtime.RequiredError('dataset','Required parameter requestParameters.dataset was null or undefined when calling updateDatasetSymbologyHandler.'); + } + + if (requestParameters.symbology === null || requestParameters.symbology === undefined) { + throw new runtime.RequiredError('symbology','Required parameter requestParameters.symbology was null or undefined when calling updateDatasetSymbologyHandler.'); + } + + 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: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SymbologyToJSON(requestParameters.symbology), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Updates the dataset\'s symbology + * Updates the dataset\'s symbology + */ + async updateDatasetSymbologyHandler(requestParameters: UpdateDatasetSymbologyHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.updateDatasetSymbologyHandlerRaw(requestParameters, initOverrides); + } + } diff --git a/typescript/src/apis/UploadsApi.ts b/typescript/src/apis/UploadsApi.ts index 39502659..81533361 100644 --- a/typescript/src/apis/UploadsApi.ts +++ b/typescript/src/apis/UploadsApi.ts @@ -16,14 +16,11 @@ import * as runtime from '../runtime'; import type { AddCollection200Response, - UploadFileLayersResponse, UploadFilesResponse, } from '../models/index'; import { AddCollection200ResponseFromJSON, AddCollection200ResponseToJSON, - UploadFileLayersResponseFromJSON, - UploadFileLayersResponseToJSON, UploadFilesResponseFromJSON, UploadFilesResponseToJSON, } from '../models/index'; @@ -50,7 +47,7 @@ export class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - async listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) { throw new runtime.RequiredError('uploadId','Required parameter requestParameters.uploadId was null or undefined when calling listUploadFileLayersHandler.'); } @@ -78,14 +75,14 @@ export class UploadsApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => UploadFileLayersResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => UploadFilesResponseFromJSON(jsonValue)); } /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - async listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + async listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.listUploadFileLayersHandlerRaw(requestParameters, initOverrides); return await response.value(); } From 12f50784a4ff62ca43d25f37578aca45d1e7bbc1 Mon Sep 17 00:00:00 2001 From: Michael Mattig Date: Fri, 16 Feb 2024 16:00:02 +0100 Subject: [PATCH 5/7] update openapi-client --- .generation/input/openapi.json | 30 ++++----- .../api/ogcwfs_api.py | 38 +++++------ .../api/ogcwms_api.py | 64 +++++++++---------- .../api/uploads_api.py | 9 +-- typescript/dist/apis/OGCWFSApi.d.ts | 2 +- typescript/dist/apis/OGCWFSApi.js | 14 ++-- typescript/dist/apis/OGCWMSApi.d.ts | 4 +- typescript/dist/apis/OGCWMSApi.js | 34 +++------- typescript/dist/apis/UploadsApi.d.ts | 6 +- typescript/dist/apis/UploadsApi.js | 2 +- typescript/dist/esm/apis/OGCWFSApi.d.ts | 2 +- typescript/dist/esm/apis/OGCWFSApi.js | 14 ++-- typescript/dist/esm/apis/OGCWMSApi.d.ts | 4 +- typescript/dist/esm/apis/OGCWMSApi.js | 34 +++------- typescript/dist/esm/apis/UploadsApi.d.ts | 6 +- typescript/dist/esm/apis/UploadsApi.js | 4 +- typescript/src/apis/OGCWFSApi.ts | 20 ++---- typescript/src/apis/OGCWMSApi.ts | 46 ++++--------- typescript/src/apis/UploadsApi.ts | 9 ++- {.generation/util => util}/ui-dev-update.sh | 21 ++++-- 20 files changed, 147 insertions(+), 216 deletions(-) rename {.generation/util => util}/ui-dev-update.sh (65%) mode change 100644 => 100755 diff --git a/.generation/input/openapi.json b/.generation/input/openapi.json index 83ff13c9..8dd2421f 100644 --- a/.generation/input/openapi.json +++ b/.generation/input/openapi.json @@ -3284,7 +3284,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UploadFilesResponse" + "$ref": "#/components/schemas/UploadFileLayersResponse" }, "example": { "layers": [ @@ -3766,8 +3766,8 @@ }, { "name": "version", - "in": "query", - "required": false, + "in": "path", + "required": true, "schema": { "allOf": [ { @@ -3779,7 +3779,7 @@ }, { "name": "service", - "in": "query", + "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/WfsService" @@ -3787,7 +3787,7 @@ }, { "name": "request", - "in": "query", + "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/GetCapabilitiesRequest" @@ -4102,8 +4102,8 @@ }, { "name": "version", - "in": "query", - "required": false, + "in": "path", + "required": true, "schema": { "allOf": [ { @@ -4115,7 +4115,7 @@ }, { "name": "service", - "in": "query", + "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/WmsService" @@ -4123,7 +4123,7 @@ }, { "name": "request", - "in": "query", + "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/GetCapabilitiesRequest" @@ -4131,8 +4131,8 @@ }, { "name": "format", - "in": "query", - "required": false, + "in": "path", + "required": true, "schema": { "allOf": [ { @@ -4182,7 +4182,7 @@ }, { "name": "version", - "in": "query", + "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/WmsVersion" @@ -4190,7 +4190,7 @@ }, { "name": "service", - "in": "query", + "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/WmsService" @@ -4198,7 +4198,7 @@ }, { "name": "request", - "in": "query", + "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/GetLegendGraphicRequest" @@ -4206,7 +4206,7 @@ }, { "name": "layer", - "in": "query", + "in": "path", "required": true, "schema": { "type": "string" diff --git a/python/geoengine_openapi_client/api/ogcwfs_api.py b/python/geoengine_openapi_client/api/ogcwfs_api.py index 2e0fa5be..8f533f51 100644 --- a/python/geoengine_openapi_client/api/ogcwfs_api.py +++ b/python/geoengine_openapi_client/api/ogcwfs_api.py @@ -50,24 +50,24 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client @validate_arguments - def wfs_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], service : WfsService, request : GetCapabilitiesRequest, version : Optional[Any] = None, **kwargs) -> str: # noqa: E501 + def wfs_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : Optional[Any], service : WfsService, request : GetCapabilitiesRequest, **kwargs) -> str: # noqa: E501 """Get WFS Capabilities # noqa: E501 Get WFS Capabilities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.wfs_capabilities_handler(workflow, service, request, version, async_req=True) + >>> thread = api.wfs_capabilities_handler(workflow, version, service, request, async_req=True) >>> result = thread.get() :param workflow: Workflow id (required) :type workflow: str + :param version: (required) + :type version: WfsVersion :param service: (required) :type service: WfsService :param request: (required) :type request: GetCapabilitiesRequest - :param version: - :type version: WfsVersion :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. @@ -83,27 +83,27 @@ def wfs_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., de if '_preload_content' in kwargs: message = "Error! Please call the wfs_capabilities_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.wfs_capabilities_handler_with_http_info(workflow, service, request, version, **kwargs) # noqa: E501 + return self.wfs_capabilities_handler_with_http_info(workflow, version, service, request, **kwargs) # noqa: E501 @validate_arguments - def wfs_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], service : WfsService, request : GetCapabilitiesRequest, version : Optional[Any] = None, **kwargs) -> ApiResponse: # noqa: E501 + def wfs_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : Optional[Any], service : WfsService, request : GetCapabilitiesRequest, **kwargs) -> ApiResponse: # noqa: E501 """Get WFS Capabilities # noqa: E501 Get WFS Capabilities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.wfs_capabilities_handler_with_http_info(workflow, service, request, version, async_req=True) + >>> thread = api.wfs_capabilities_handler_with_http_info(workflow, version, service, request, async_req=True) >>> result = thread.get() :param workflow: Workflow id (required) :type workflow: str + :param version: (required) + :type version: WfsVersion :param service: (required) :type service: WfsService :param request: (required) :type request: GetCapabilitiesRequest - :param version: - :type version: WfsVersion :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will @@ -133,9 +133,9 @@ def wfs_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr _all_params = [ 'workflow', + 'version', 'service', - 'request', - 'version' + 'request' ] _all_params.extend( [ @@ -166,18 +166,18 @@ def wfs_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr if _params['workflow']: _path_params['workflow'] = _params['workflow'] + if _params['version']: + _path_params['version'] = _params['version'] - # process the query parameters - _query_params = [] - if _params.get('version') is not None: # noqa: E501 - _query_params.append(('version', _params['version'].value)) + if _params['service']: + _path_params['service'] = _params['service'] - if _params.get('service') is not None: # noqa: E501 - _query_params.append(('service', _params['service'].value)) + if _params['request']: + _path_params['request'] = _params['request'] - if _params.get('request') is not None: # noqa: E501 - _query_params.append(('request', _params['request'].value)) + # process the query parameters + _query_params = [] # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters diff --git a/python/geoengine_openapi_client/api/ogcwms_api.py b/python/geoengine_openapi_client/api/ogcwms_api.py index 3f004f19..7b5d89bc 100644 --- a/python/geoengine_openapi_client/api/ogcwms_api.py +++ b/python/geoengine_openapi_client/api/ogcwms_api.py @@ -52,25 +52,25 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client @validate_arguments - def wms_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], service : WmsService, request : GetCapabilitiesRequest, version : Optional[Any] = None, format : Optional[Any] = None, **kwargs) -> str: # noqa: E501 + def wms_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : Optional[Any], service : WmsService, request : GetCapabilitiesRequest, format : Optional[Any], **kwargs) -> str: # noqa: E501 """Get WMS Capabilities # noqa: E501 Get WMS Capabilities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.wms_capabilities_handler(workflow, service, request, version, format, async_req=True) + >>> thread = api.wms_capabilities_handler(workflow, version, service, request, format, async_req=True) >>> result = thread.get() :param workflow: Workflow id (required) :type workflow: str + :param version: (required) + :type version: WmsVersion :param service: (required) :type service: WmsService :param request: (required) :type request: GetCapabilitiesRequest - :param version: - :type version: WmsVersion - :param format: + :param format: (required) :type format: GetCapabilitiesFormat :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -87,28 +87,28 @@ def wms_capabilities_handler(self, workflow : Annotated[StrictStr, Field(..., de if '_preload_content' in kwargs: message = "Error! Please call the wms_capabilities_handler_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) - return self.wms_capabilities_handler_with_http_info(workflow, service, request, version, format, **kwargs) # noqa: E501 + return self.wms_capabilities_handler_with_http_info(workflow, version, service, request, format, **kwargs) # noqa: E501 @validate_arguments - def wms_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], service : WmsService, request : GetCapabilitiesRequest, version : Optional[Any] = None, format : Optional[Any] = None, **kwargs) -> ApiResponse: # noqa: E501 + def wms_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr, Field(..., description="Workflow id")], version : Optional[Any], service : WmsService, request : GetCapabilitiesRequest, format : Optional[Any], **kwargs) -> ApiResponse: # noqa: E501 """Get WMS Capabilities # noqa: E501 Get WMS Capabilities # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.wms_capabilities_handler_with_http_info(workflow, service, request, version, format, async_req=True) + >>> thread = api.wms_capabilities_handler_with_http_info(workflow, version, service, request, format, async_req=True) >>> result = thread.get() :param workflow: Workflow id (required) :type workflow: str + :param version: (required) + :type version: WmsVersion :param service: (required) :type service: WmsService :param request: (required) :type request: GetCapabilitiesRequest - :param version: - :type version: WmsVersion - :param format: + :param format: (required) :type format: GetCapabilitiesFormat :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional @@ -139,9 +139,9 @@ def wms_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr _all_params = [ 'workflow', + 'version', 'service', 'request', - 'version', 'format' ] _all_params.extend( @@ -173,21 +173,21 @@ def wms_capabilities_handler_with_http_info(self, workflow : Annotated[StrictStr if _params['workflow']: _path_params['workflow'] = _params['workflow'] + if _params['version']: + _path_params['version'] = _params['version'] - # process the query parameters - _query_params = [] - if _params.get('version') is not None: # noqa: E501 - _query_params.append(('version', _params['version'].value)) + if _params['service']: + _path_params['service'] = _params['service'] - if _params.get('service') is not None: # noqa: E501 - _query_params.append(('service', _params['service'].value)) + if _params['request']: + _path_params['request'] = _params['request'] - if _params.get('request') is not None: # noqa: E501 - _query_params.append(('request', _params['request'].value)) + if _params['format']: + _path_params['format'] = _params['format'] - if _params.get('format') is not None: # noqa: E501 - _query_params.append(('format', _params['format'].value)) + # process the query parameters + _query_params = [] # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters @@ -345,21 +345,21 @@ def wms_legend_graphic_handler_with_http_info(self, workflow : Annotated[StrictS if _params['workflow']: _path_params['workflow'] = _params['workflow'] + if _params['version']: + _path_params['version'] = _params['version'] - # process the query parameters - _query_params = [] - if _params.get('version') is not None: # noqa: E501 - _query_params.append(('version', _params['version'].value)) + if _params['service']: + _path_params['service'] = _params['service'] - if _params.get('service') is not None: # noqa: E501 - _query_params.append(('service', _params['service'].value)) + if _params['request']: + _path_params['request'] = _params['request'] - if _params.get('request') is not None: # noqa: E501 - _query_params.append(('request', _params['request'].value)) + if _params['layer']: + _path_params['layer'] = _params['layer'] - if _params.get('layer') is not None: # noqa: E501 - _query_params.append(('layer', _params['layer'])) + # process the query parameters + _query_params = [] # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters diff --git a/python/geoengine_openapi_client/api/uploads_api.py b/python/geoengine_openapi_client/api/uploads_api.py index 90b3944e..8a192219 100644 --- a/python/geoengine_openapi_client/api/uploads_api.py +++ b/python/geoengine_openapi_client/api/uploads_api.py @@ -25,6 +25,7 @@ from typing import Union from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response +from geoengine_openapi_client.models.upload_file_layers_response import UploadFileLayersResponse from geoengine_openapi_client.models.upload_files_response import UploadFilesResponse from geoengine_openapi_client.api_client import ApiClient @@ -48,7 +49,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client @validate_arguments - def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> UploadFilesResponse: # noqa: E501 + def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field(..., description="Upload id")], file_name : Annotated[StrictStr, Field(..., description="File name")], **kwargs) -> UploadFileLayersResponse: # noqa: E501 """List the layers of on uploaded file. # noqa: E501 List the layers of on uploaded file. # noqa: E501 @@ -71,7 +72,7 @@ def list_upload_file_layers_handler(self, upload_id : Annotated[StrictStr, Field :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: UploadFilesResponse + :rtype: UploadFileLayersResponse """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: @@ -116,7 +117,7 @@ def list_upload_file_layers_handler_with_http_info(self, upload_id : Annotated[S :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(UploadFilesResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(UploadFileLayersResponse, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() @@ -175,7 +176,7 @@ def list_upload_file_layers_handler_with_http_info(self, upload_id : Annotated[S _auth_settings = ['session_token'] # noqa: E501 _response_types_map = { - '200': "UploadFilesResponse", + '200': "UploadFileLayersResponse", } return self.api_client.call_api( diff --git a/typescript/dist/apis/OGCWFSApi.d.ts b/typescript/dist/apis/OGCWFSApi.d.ts index 2c02a87e..981a7fa3 100644 --- a/typescript/dist/apis/OGCWFSApi.d.ts +++ b/typescript/dist/apis/OGCWFSApi.d.ts @@ -13,9 +13,9 @@ import * as runtime from '../runtime'; import type { GeoJson, GetCapabilitiesRequest, GetFeatureRequest, WfsService, WfsVersion } from '../models/index'; export interface WfsCapabilitiesHandlerRequest { workflow: string; + version: WfsVersion | null; service: WfsService; request: GetCapabilitiesRequest; - version?: WfsVersion | null; } export interface WfsFeatureHandlerRequest { workflow: string; diff --git a/typescript/dist/apis/OGCWFSApi.js b/typescript/dist/apis/OGCWFSApi.js index 9ff65058..f67b0cfd 100644 --- a/typescript/dist/apis/OGCWFSApi.js +++ b/typescript/dist/apis/OGCWFSApi.js @@ -38,6 +38,9 @@ class OGCWFSApi extends runtime.BaseAPI { if (requestParameters.workflow === null || requestParameters.workflow === undefined) { throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wfsCapabilitiesHandler.'); } + if (requestParameters.version === null || requestParameters.version === undefined) { + throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wfsCapabilitiesHandler.'); + } if (requestParameters.service === null || requestParameters.service === undefined) { throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wfsCapabilitiesHandler.'); } @@ -45,15 +48,6 @@ class OGCWFSApi extends runtime.BaseAPI { throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wfsCapabilitiesHandler.'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; - } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; - } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; - } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; @@ -63,7 +57,7 @@ class OGCWFSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/apis/OGCWMSApi.d.ts b/typescript/dist/apis/OGCWMSApi.d.ts index f38d5708..2d77f9c0 100644 --- a/typescript/dist/apis/OGCWMSApi.d.ts +++ b/typescript/dist/apis/OGCWMSApi.d.ts @@ -13,10 +13,10 @@ import * as runtime from '../runtime'; import type { GetCapabilitiesFormat, GetCapabilitiesRequest, GetLegendGraphicRequest, GetMapExceptionFormat, GetMapFormat, GetMapRequest, WmsService, WmsVersion } from '../models/index'; export interface WmsCapabilitiesHandlerRequest { workflow: string; + version: WmsVersion | null; service: WmsService; request: GetCapabilitiesRequest; - version?: WmsVersion | null; - format?: GetCapabilitiesFormat | null; + format: GetCapabilitiesFormat | null; } export interface WmsLegendGraphicHandlerRequest { workflow: string; diff --git a/typescript/dist/apis/OGCWMSApi.js b/typescript/dist/apis/OGCWMSApi.js index 4322777b..ead3f9e7 100644 --- a/typescript/dist/apis/OGCWMSApi.js +++ b/typescript/dist/apis/OGCWMSApi.js @@ -37,25 +37,19 @@ class OGCWMSApi extends runtime.BaseAPI { if (requestParameters.workflow === null || requestParameters.workflow === undefined) { throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wmsCapabilitiesHandler.'); } + if (requestParameters.version === null || requestParameters.version === undefined) { + throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wmsCapabilitiesHandler.'); + } if (requestParameters.service === null || requestParameters.service === undefined) { throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wmsCapabilitiesHandler.'); } if (requestParameters.request === null || requestParameters.request === undefined) { throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wmsCapabilitiesHandler.'); } - const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; - } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; - } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; - } - if (requestParameters.format !== undefined) { - queryParameters['format'] = requestParameters.format; + if (requestParameters.format === null || requestParameters.format === undefined) { + throw new runtime.RequiredError('format', 'Required parameter requestParameters.format was null or undefined when calling wmsCapabilitiesHandler.'); } + const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; @@ -65,7 +59,7 @@ class OGCWMSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"format"}}`, encodeURIComponent(String(requestParameters.format))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -110,18 +104,6 @@ class OGCWMSApi extends runtime.BaseAPI { throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling wmsLegendGraphicHandler.'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; - } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; - } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; - } - if (requestParameters.layer !== undefined) { - queryParameters['layer'] = requestParameters.layer; - } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; @@ -131,7 +113,7 @@ class OGCWMSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/apis/UploadsApi.d.ts b/typescript/dist/apis/UploadsApi.d.ts index 704ac08f..bc1a471b 100644 --- a/typescript/dist/apis/UploadsApi.d.ts +++ b/typescript/dist/apis/UploadsApi.d.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ import * as runtime from '../runtime'; -import type { AddCollection200Response, UploadFilesResponse } from '../models/index'; +import type { AddCollection200Response, UploadFileLayersResponse, UploadFilesResponse } from '../models/index'; export interface ListUploadFileLayersHandlerRequest { uploadId: string; fileName: string; @@ -29,12 +29,12 @@ export declare class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * List the files of on upload. * List the files of on upload. diff --git a/typescript/dist/apis/UploadsApi.js b/typescript/dist/apis/UploadsApi.js index 0162a51f..2db0a342 100644 --- a/typescript/dist/apis/UploadsApi.js +++ b/typescript/dist/apis/UploadsApi.js @@ -56,7 +56,7 @@ class UploadsApi extends runtime.BaseAPI { headers: headerParameters, query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadFilesResponseFromJSON)(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadFileLayersResponseFromJSON)(jsonValue)); }); } /** diff --git a/typescript/dist/esm/apis/OGCWFSApi.d.ts b/typescript/dist/esm/apis/OGCWFSApi.d.ts index 2c02a87e..981a7fa3 100644 --- a/typescript/dist/esm/apis/OGCWFSApi.d.ts +++ b/typescript/dist/esm/apis/OGCWFSApi.d.ts @@ -13,9 +13,9 @@ import * as runtime from '../runtime'; import type { GeoJson, GetCapabilitiesRequest, GetFeatureRequest, WfsService, WfsVersion } from '../models/index'; export interface WfsCapabilitiesHandlerRequest { workflow: string; + version: WfsVersion | null; service: WfsService; request: GetCapabilitiesRequest; - version?: WfsVersion | null; } export interface WfsFeatureHandlerRequest { workflow: string; diff --git a/typescript/dist/esm/apis/OGCWFSApi.js b/typescript/dist/esm/apis/OGCWFSApi.js index bb2cef67..7b76069e 100644 --- a/typescript/dist/esm/apis/OGCWFSApi.js +++ b/typescript/dist/esm/apis/OGCWFSApi.js @@ -35,6 +35,9 @@ export class OGCWFSApi extends runtime.BaseAPI { if (requestParameters.workflow === null || requestParameters.workflow === undefined) { throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wfsCapabilitiesHandler.'); } + if (requestParameters.version === null || requestParameters.version === undefined) { + throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wfsCapabilitiesHandler.'); + } if (requestParameters.service === null || requestParameters.service === undefined) { throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wfsCapabilitiesHandler.'); } @@ -42,15 +45,6 @@ export class OGCWFSApi extends runtime.BaseAPI { throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wfsCapabilitiesHandler.'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; - } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; - } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; - } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; @@ -60,7 +54,7 @@ export class OGCWFSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/esm/apis/OGCWMSApi.d.ts b/typescript/dist/esm/apis/OGCWMSApi.d.ts index f38d5708..2d77f9c0 100644 --- a/typescript/dist/esm/apis/OGCWMSApi.d.ts +++ b/typescript/dist/esm/apis/OGCWMSApi.d.ts @@ -13,10 +13,10 @@ import * as runtime from '../runtime'; import type { GetCapabilitiesFormat, GetCapabilitiesRequest, GetLegendGraphicRequest, GetMapExceptionFormat, GetMapFormat, GetMapRequest, WmsService, WmsVersion } from '../models/index'; export interface WmsCapabilitiesHandlerRequest { workflow: string; + version: WmsVersion | null; service: WmsService; request: GetCapabilitiesRequest; - version?: WmsVersion | null; - format?: GetCapabilitiesFormat | null; + format: GetCapabilitiesFormat | null; } export interface WmsLegendGraphicHandlerRequest { workflow: string; diff --git a/typescript/dist/esm/apis/OGCWMSApi.js b/typescript/dist/esm/apis/OGCWMSApi.js index cf02c8fb..2569876a 100644 --- a/typescript/dist/esm/apis/OGCWMSApi.js +++ b/typescript/dist/esm/apis/OGCWMSApi.js @@ -34,25 +34,19 @@ export class OGCWMSApi extends runtime.BaseAPI { if (requestParameters.workflow === null || requestParameters.workflow === undefined) { throw new runtime.RequiredError('workflow', 'Required parameter requestParameters.workflow was null or undefined when calling wmsCapabilitiesHandler.'); } + if (requestParameters.version === null || requestParameters.version === undefined) { + throw new runtime.RequiredError('version', 'Required parameter requestParameters.version was null or undefined when calling wmsCapabilitiesHandler.'); + } if (requestParameters.service === null || requestParameters.service === undefined) { throw new runtime.RequiredError('service', 'Required parameter requestParameters.service was null or undefined when calling wmsCapabilitiesHandler.'); } if (requestParameters.request === null || requestParameters.request === undefined) { throw new runtime.RequiredError('request', 'Required parameter requestParameters.request was null or undefined when calling wmsCapabilitiesHandler.'); } - const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; - } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; - } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; - } - if (requestParameters.format !== undefined) { - queryParameters['format'] = requestParameters.format; + if (requestParameters.format === null || requestParameters.format === undefined) { + throw new runtime.RequiredError('format', 'Required parameter requestParameters.format was null or undefined when calling wmsCapabilitiesHandler.'); } + const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; @@ -62,7 +56,7 @@ export class OGCWMSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"format"}}`, encodeURIComponent(String(requestParameters.format))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -107,18 +101,6 @@ export class OGCWMSApi extends runtime.BaseAPI { throw new runtime.RequiredError('layer', 'Required parameter requestParameters.layer was null or undefined when calling wmsLegendGraphicHandler.'); } const queryParameters = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; - } - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; - } - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; - } - if (requestParameters.layer !== undefined) { - queryParameters['layer'] = requestParameters.layer; - } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; @@ -128,7 +110,7 @@ export class OGCWMSApi extends runtime.BaseAPI { } } const response = yield this.request({ - path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/dist/esm/apis/UploadsApi.d.ts b/typescript/dist/esm/apis/UploadsApi.d.ts index 704ac08f..bc1a471b 100644 --- a/typescript/dist/esm/apis/UploadsApi.d.ts +++ b/typescript/dist/esm/apis/UploadsApi.d.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ import * as runtime from '../runtime'; -import type { AddCollection200Response, UploadFilesResponse } from '../models/index'; +import type { AddCollection200Response, UploadFileLayersResponse, UploadFilesResponse } from '../models/index'; export interface ListUploadFileLayersHandlerRequest { uploadId: string; fileName: string; @@ -29,12 +29,12 @@ export declare class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * List the files of on upload. * List the files of on upload. diff --git a/typescript/dist/esm/apis/UploadsApi.js b/typescript/dist/esm/apis/UploadsApi.js index 33898f5d..9f279327 100644 --- a/typescript/dist/esm/apis/UploadsApi.js +++ b/typescript/dist/esm/apis/UploadsApi.js @@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; import * as runtime from '../runtime'; -import { AddCollection200ResponseFromJSON, UploadFilesResponseFromJSON, } from '../models/index'; +import { AddCollection200ResponseFromJSON, UploadFileLayersResponseFromJSON, UploadFilesResponseFromJSON, } from '../models/index'; /** * */ @@ -53,7 +53,7 @@ export class UploadsApi extends runtime.BaseAPI { headers: headerParameters, query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => UploadFilesResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => UploadFileLayersResponseFromJSON(jsonValue)); }); } /** diff --git a/typescript/src/apis/OGCWFSApi.ts b/typescript/src/apis/OGCWFSApi.ts index c81bb5b9..e5aa23c4 100644 --- a/typescript/src/apis/OGCWFSApi.ts +++ b/typescript/src/apis/OGCWFSApi.ts @@ -36,9 +36,9 @@ import { export interface WfsCapabilitiesHandlerRequest { workflow: string; + version: WfsVersion | null; service: WfsService; request: GetCapabilitiesRequest; - version?: WfsVersion | null; } export interface WfsFeatureHandlerRequest { @@ -73,6 +73,10 @@ export class OGCWFSApi extends runtime.BaseAPI { throw new runtime.RequiredError('workflow','Required parameter requestParameters.workflow was null or undefined when calling wfsCapabilitiesHandler.'); } + if (requestParameters.version === null || requestParameters.version === undefined) { + throw new runtime.RequiredError('version','Required parameter requestParameters.version was null or undefined when calling wfsCapabilitiesHandler.'); + } + if (requestParameters.service === null || requestParameters.service === undefined) { throw new runtime.RequiredError('service','Required parameter requestParameters.service was null or undefined when calling wfsCapabilitiesHandler.'); } @@ -83,18 +87,6 @@ export class OGCWFSApi extends runtime.BaseAPI { const queryParameters: any = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; - } - - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; - } - - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; - } - const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { @@ -106,7 +98,7 @@ export class OGCWFSApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wfs/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/src/apis/OGCWMSApi.ts b/typescript/src/apis/OGCWMSApi.ts index d2a5c007..9d629f07 100644 --- a/typescript/src/apis/OGCWMSApi.ts +++ b/typescript/src/apis/OGCWMSApi.ts @@ -45,10 +45,10 @@ import { export interface WmsCapabilitiesHandlerRequest { workflow: string; + version: WmsVersion | null; service: WmsService; request: GetCapabilitiesRequest; - version?: WmsVersion | null; - format?: GetCapabilitiesFormat | null; + format: GetCapabilitiesFormat | null; } export interface WmsLegendGraphicHandlerRequest { @@ -94,6 +94,10 @@ export class OGCWMSApi extends runtime.BaseAPI { throw new runtime.RequiredError('workflow','Required parameter requestParameters.workflow was null or undefined when calling wmsCapabilitiesHandler.'); } + if (requestParameters.version === null || requestParameters.version === undefined) { + throw new runtime.RequiredError('version','Required parameter requestParameters.version was null or undefined when calling wmsCapabilitiesHandler.'); + } + if (requestParameters.service === null || requestParameters.service === undefined) { throw new runtime.RequiredError('service','Required parameter requestParameters.service was null or undefined when calling wmsCapabilitiesHandler.'); } @@ -102,23 +106,11 @@ export class OGCWMSApi extends runtime.BaseAPI { throw new runtime.RequiredError('request','Required parameter requestParameters.request was null or undefined when calling wmsCapabilitiesHandler.'); } - const queryParameters: any = {}; - - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; - } - - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; - } - - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; + if (requestParameters.format === null || requestParameters.format === undefined) { + throw new runtime.RequiredError('format','Required parameter requestParameters.format was null or undefined when calling wmsCapabilitiesHandler.'); } - if (requestParameters.format !== undefined) { - queryParameters['format'] = requestParameters.format; - } + const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -131,7 +123,7 @@ export class OGCWMSApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wms/{workflow}?request=GetCapabilities`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"format"}}`, encodeURIComponent(String(requestParameters.format))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -180,22 +172,6 @@ export class OGCWMSApi extends runtime.BaseAPI { const queryParameters: any = {}; - if (requestParameters.version !== undefined) { - queryParameters['version'] = requestParameters.version; - } - - if (requestParameters.service !== undefined) { - queryParameters['service'] = requestParameters.service; - } - - if (requestParameters.request !== undefined) { - queryParameters['request'] = requestParameters.request; - } - - if (requestParameters.layer !== undefined) { - queryParameters['layer'] = requestParameters.layer; - } - const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { @@ -207,7 +183,7 @@ export class OGCWMSApi extends runtime.BaseAPI { } } const response = await this.request({ - path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))), + path: `/wms/{workflow}?request=GetLegendGraphic`.replace(`{${"workflow"}}`, encodeURIComponent(String(requestParameters.workflow))).replace(`{${"version"}}`, encodeURIComponent(String(requestParameters.version))).replace(`{${"service"}}`, encodeURIComponent(String(requestParameters.service))).replace(`{${"request"}}`, encodeURIComponent(String(requestParameters.request))).replace(`{${"layer"}}`, encodeURIComponent(String(requestParameters.layer))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/typescript/src/apis/UploadsApi.ts b/typescript/src/apis/UploadsApi.ts index 81533361..39502659 100644 --- a/typescript/src/apis/UploadsApi.ts +++ b/typescript/src/apis/UploadsApi.ts @@ -16,11 +16,14 @@ import * as runtime from '../runtime'; import type { AddCollection200Response, + UploadFileLayersResponse, UploadFilesResponse, } from '../models/index'; import { AddCollection200ResponseFromJSON, AddCollection200ResponseToJSON, + UploadFileLayersResponseFromJSON, + UploadFileLayersResponseToJSON, UploadFilesResponseFromJSON, UploadFilesResponseToJSON, } from '../models/index'; @@ -47,7 +50,7 @@ export class UploadsApi extends runtime.BaseAPI { * List the layers of on uploaded file. * List the layers of on uploaded file. */ - async listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async listUploadFileLayersHandlerRaw(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.uploadId === null || requestParameters.uploadId === undefined) { throw new runtime.RequiredError('uploadId','Required parameter requestParameters.uploadId was null or undefined when calling listUploadFileLayersHandler.'); } @@ -75,14 +78,14 @@ export class UploadsApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => UploadFilesResponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => UploadFileLayersResponseFromJSON(jsonValue)); } /** * List the layers of on uploaded file. * List the layers of on uploaded file. */ - async listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + async listUploadFileLayersHandler(requestParameters: ListUploadFileLayersHandlerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.listUploadFileLayersHandlerRaw(requestParameters, initOverrides); return await response.value(); } diff --git a/.generation/util/ui-dev-update.sh b/util/ui-dev-update.sh old mode 100644 new mode 100755 similarity index 65% rename from .generation/util/ui-dev-update.sh rename to util/ui-dev-update.sh index a2054096..1c015add --- a/.generation/util/ui-dev-update.sh +++ b/util/ui-dev-update.sh @@ -2,10 +2,10 @@ # FOR DEVELOPMENT USE ONLY # -# Usage (from the repo root): ./util/ui-dev-update.sh commit-message +# Usage (from the repo root): ./util/ui-dev-update.sh [-a] [commit-message] # # this script uses the OpenAPI json from a Geo Engine instance running on port 3030 -# it generates the openapi-client and pushes it to the current branch +# it generates the openapi-client and pushes it to the current branch (-a to amend the last commit) # then it updates the geoengine-ui's openapi-client dependency to the development branch # note: the geoengine-ui git repo must be in the same directory as the openapi-client repo @@ -17,13 +17,20 @@ wget http://localhost:3030/api/api-docs/openapi.json -O - | python3 -m json.tool git add . -# Get all arguments as a single string -args_as_string="$*" +# Check if -a is passed as an argument +if [[ "$*" == *"-a"* ]]; then + # Use git commit --amend + git commit --amend --no-edit +else + # Get all arguments as a single string + args_as_string="$*" -# Set the commit message to the input arguments or a default message -message=${args_as_string:-"update openapi-client"} + # Set the commit message to the input arguments or a default message + message=${args_as_string:-"update openapi-client"} + + git commit -m "$message" +fi -git commit -m "$message" git push current_branch=$(git rev-parse --abbrev-ref HEAD) From 1f1dd44ba475d398f8ee5c7ab3b704d7397d8436 Mon Sep 17 00:00:00 2001 From: Michael Mattig Date: Tue, 20 Feb 2024 11:27:11 +0100 Subject: [PATCH 6/7] update openapi-client --- .generation/input/openapi.json | 2 +- python/README.md | 2 +- python/geoengine_openapi_client/api/datasets_api.py | 2 +- typescript/dist/apis/DatasetsApi.js | 2 +- typescript/dist/esm/apis/DatasetsApi.js | 2 +- typescript/src/apis/DatasetsApi.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.generation/input/openapi.json b/.generation/input/openapi.json index 8dd2421f..37cbad32 100644 --- a/.generation/input/openapi.json +++ b/.generation/input/openapi.json @@ -730,7 +730,7 @@ } }, "/dataset/{dataset}/symbology": { - "post": { + "put": { "tags": [ "Datasets" ], diff --git a/python/README.md b/python/README.md index ee11fe01..53626ebf 100644 --- a/python/README.md +++ b/python/README.md @@ -102,7 +102,7 @@ Class | Method | HTTP request | Description *DatasetsApi* | [**list_datasets_handler**](docs/DatasetsApi.md#list_datasets_handler) | **GET** /datasets | Lists available datasets. *DatasetsApi* | [**list_volumes_handler**](docs/DatasetsApi.md#list_volumes_handler) | **GET** /dataset/volumes | Lists available volumes. *DatasetsApi* | [**suggest_meta_data_handler**](docs/DatasetsApi.md#suggest_meta_data_handler) | **GET** /dataset/suggest | Inspects an upload and suggests metadata that can be used when creating a new dataset based on it. -*DatasetsApi* | [**update_dataset_symbology_handler**](docs/DatasetsApi.md#update_dataset_symbology_handler) | **POST** /dataset/{dataset}/symbology | Updates the dataset's symbology +*DatasetsApi* | [**update_dataset_symbology_handler**](docs/DatasetsApi.md#update_dataset_symbology_handler) | **PUT** /dataset/{dataset}/symbology | Updates the dataset's symbology *GeneralApi* | [**available_handler**](docs/GeneralApi.md#available_handler) | **GET** /available | Server availablity check. *GeneralApi* | [**server_info_handler**](docs/GeneralApi.md#server_info_handler) | **GET** /info | Shows information about the server software version. *LayersApi* | [**add_collection**](docs/LayersApi.md#add_collection) | **POST** /layerDb/collections/{collection}/collections | Add a new collection to an existing collection diff --git a/python/geoengine_openapi_client/api/datasets_api.py b/python/geoengine_openapi_client/api/datasets_api.py index caef4c83..fd74b35c 100644 --- a/python/geoengine_openapi_client/api/datasets_api.py +++ b/python/geoengine_openapi_client/api/datasets_api.py @@ -1381,7 +1381,7 @@ def update_dataset_symbology_handler_with_http_info(self, dataset : Annotated[St _response_types_map = {} return self.api_client.call_api( - '/dataset/{dataset}/symbology', 'POST', + '/dataset/{dataset}/symbology', 'PUT', _path_params, _query_params, _header_params, diff --git a/typescript/dist/apis/DatasetsApi.js b/typescript/dist/apis/DatasetsApi.js index 78d70249..80099607 100644 --- a/typescript/dist/apis/DatasetsApi.js +++ b/typescript/dist/apis/DatasetsApi.js @@ -379,7 +379,7 @@ class DatasetsApi extends runtime.BaseAPI { } const response = yield this.request({ path: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), - method: 'POST', + method: 'PUT', headers: headerParameters, query: queryParameters, body: (0, index_1.SymbologyToJSON)(requestParameters.symbology), diff --git a/typescript/dist/esm/apis/DatasetsApi.js b/typescript/dist/esm/apis/DatasetsApi.js index ec3750a6..99193cfb 100644 --- a/typescript/dist/esm/apis/DatasetsApi.js +++ b/typescript/dist/esm/apis/DatasetsApi.js @@ -376,7 +376,7 @@ export class DatasetsApi extends runtime.BaseAPI { } const response = yield this.request({ path: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), - method: 'POST', + method: 'PUT', headers: headerParameters, query: queryParameters, body: SymbologyToJSON(requestParameters.symbology), diff --git a/typescript/src/apis/DatasetsApi.ts b/typescript/src/apis/DatasetsApi.ts index d2b84833..ea63e7ef 100644 --- a/typescript/src/apis/DatasetsApi.ts +++ b/typescript/src/apis/DatasetsApi.ts @@ -486,7 +486,7 @@ export class DatasetsApi extends runtime.BaseAPI { } const response = await this.request({ path: `/dataset/{dataset}/symbology`.replace(`{${"dataset"}}`, encodeURIComponent(String(requestParameters.dataset))), - method: 'POST', + method: 'PUT', headers: headerParameters, query: queryParameters, body: SymbologyToJSON(requestParameters.symbology), From 27bc63796ee3c8a7c6cf3b762a8e8f31177a1551 Mon Sep 17 00:00:00 2001 From: Michael Mattig Date: Tue, 20 Feb 2024 14:39:32 +0100 Subject: [PATCH 7/7] update config --- .generation/config.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.generation/config.ini b/.generation/config.ini index fba5be3f..cd285f23 100644 --- a/.generation/config.ini +++ b/.generation/config.ini @@ -1,14 +1,14 @@ [input] -backendTag = pro-nightly-2024-02-08 +backendTag = pro-nightly-2024-02-21 [general] githubUrl = https://github.com/geo-engine/openapi-client [python] name = geoengine_openapi_client -version = 0.0.5 +version = 0.0.6 [typescript] name = @geoengine/openapi-client -version = 0.0.5 +version = 0.0.6