From e8d899310eaaad7dbce47de49419fdd7f3850337 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Fri, 13 Mar 2026 16:29:51 +0100 Subject: [PATCH] Update service generation after security (roles + apikey) --- lib/api/openApiTest.dart | 2 +- lib/api/swagger.yaml | 314 +++++++++++++++--- manager_api_new/.openapi-generator/FILES | 34 +- manager_api_new/README.md | 17 +- manager_api_new/doc/AIApi.md | 2 +- manager_api_new/doc/ApiKeyApi.md | 141 ++++++++ manager_api_new/doc/ApiKeyAppType.md | 14 + manager_api_new/doc/ApplicationInstanceApi.md | 12 +- manager_api_new/doc/AuthenticationApi.md | 12 +- manager_api_new/doc/CreateApiKeyRequest.md | 16 + manager_api_new/doc/DeviceApi.md | 12 +- manager_api_new/doc/InstanceApi.md | 56 +++- manager_api_new/doc/ResourceApi.md | 12 +- manager_api_new/doc/SectionAgendaApi.md | 6 +- manager_api_new/doc/SectionApi.md | 24 +- manager_api_new/doc/SectionEventApi.md | 12 +- manager_api_new/doc/SectionMapApi.md | 18 +- manager_api_new/doc/SectionQuizApi.md | 6 +- manager_api_new/doc/StatsApi.md | 8 +- manager_api_new/doc/TokenDTO.md | 1 + manager_api_new/doc/UserApi.md | 4 +- manager_api_new/doc/UserDetailDTO.md | 2 + manager_api_new/doc/UserDetailDTORole.md | 14 + manager_api_new/doc/UserRole.md | 14 + manager_api_new/lib/api.dart | 7 +- manager_api_new/lib/api/api_key_api.dart | 170 ++++++++++ manager_api_new/lib/api/instance_api.dart | 69 ++++ manager_api_new/lib/api/user_api.dart | 8 +- manager_api_new/lib/api_client.dart | 2 - manager_api_new/lib/api_helper.dart | 6 + .../lib/model/agenda_event_stat_dto.dart | 152 +++++++++ .../lib/model/api_key_app_type.dart | 95 ++++++ ...nfiguration_link_application_instance.dart | 23 +- .../lib/model/create_api_key_request.dart | 140 ++++++++ manager_api_new/lib/model/token_dto.dart | 23 +- .../lib/model/user_detail_dto.dart | 28 +- .../lib/model/user_detail_dto_role.dart | 100 ++++++ manager_api_new/lib/model/user_role.dart | 99 ++++++ .../lib/model/user_role_extensions.dart | 16 + manager_api_new/test/api_key_api_test.dart | 34 ++ .../test/api_key_app_type_test.dart | 17 + .../test/create_api_key_request_test.dart | 29 ++ .../test/user_detail_dto_role_test.dart | 19 ++ manager_api_new/test/user_role_test.dart | 17 + 44 files changed, 1691 insertions(+), 116 deletions(-) create mode 100644 manager_api_new/doc/ApiKeyApi.md create mode 100644 manager_api_new/doc/ApiKeyAppType.md create mode 100644 manager_api_new/doc/CreateApiKeyRequest.md create mode 100644 manager_api_new/doc/UserDetailDTORole.md create mode 100644 manager_api_new/doc/UserRole.md create mode 100644 manager_api_new/lib/api/api_key_api.dart create mode 100644 manager_api_new/lib/model/agenda_event_stat_dto.dart create mode 100644 manager_api_new/lib/model/api_key_app_type.dart create mode 100644 manager_api_new/lib/model/create_api_key_request.dart create mode 100644 manager_api_new/lib/model/user_detail_dto_role.dart create mode 100644 manager_api_new/lib/model/user_role.dart create mode 100644 manager_api_new/lib/model/user_role_extensions.dart create mode 100644 manager_api_new/test/api_key_api_test.dart create mode 100644 manager_api_new/test/api_key_app_type_test.dart create mode 100644 manager_api_new/test/create_api_key_request_test.dart create mode 100644 manager_api_new/test/user_detail_dto_role_test.dart create mode 100644 manager_api_new/test/user_role_test.dart diff --git a/lib/api/openApiTest.dart b/lib/api/openApiTest.dart index e434c54..ddaa072 100644 --- a/lib/api/openApiTest.dart +++ b/lib/api/openApiTest.dart @@ -1,4 +1,4 @@ -// Openapi Generator last run: : 2026-03-13T12:04:24.358808 +// Openapi Generator last run: : 2026-03-13T16:08:54.634997 import 'package:openapi_generator_annotations/openapi_generator_annotations.dart'; @Openapi( diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml index ed8783a..b3262fa 100644 --- a/lib/api/swagger.yaml +++ b/lib/api/swagger.yaml @@ -4,7 +4,7 @@ "info": { "title": "Manager Service", "description": "API Manager Service", - "version": "Version Alpha 5.0" + "version": "Version Alpha 2.0" }, "servers": [ { @@ -183,7 +183,112 @@ } } } - } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/ApiKey": { + "get": { + "tags": [ + "ApiKey" + ], + "operationId": "ApiKey_GetApiKeys", + "responses": { + "200": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + }, + "post": { + "tags": [ + "ApiKey" + ], + "operationId": "ApiKey_CreateApiKey", + "requestBody": { + "x-name": "request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateApiKeyRequest" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] + } + }, + "/api/ApiKey/{id}": { + "delete": { + "tags": [ + "ApiKey" + ], + "operationId": "ApiKey_RevokeApiKey", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + }, + "security": [ + { + "bearer": [] + } + ] } }, "/api/ApplicationInstance": { @@ -807,7 +912,12 @@ } } } - } + }, + "security": [ + { + "bearer": [] + } + ] }, "post": { "tags": [ @@ -991,7 +1101,12 @@ } } } - } + }, + "security": [ + { + "bearer": [] + } + ] } }, "/api/Configuration/{id}": { @@ -1043,7 +1158,12 @@ } } } - } + }, + "security": [ + { + "bearer": [] + } + ] }, "delete": { "tags": [ @@ -1180,7 +1300,12 @@ } } } - } + }, + "security": [ + { + "bearer": [] + } + ] } }, "/api/Configuration/import": { @@ -1971,6 +2096,64 @@ } } }, + "/api/Instance/app-key": { + "get": { + "tags": [ + "Instance" + ], + "operationId": "Instance_GetAppKeyByPin", + "parameters": [ + { + "name": "pinCode", + "in": "query", + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 1 + }, + { + "name": "appType", + "in": "query", + "schema": { + "type": "string", + "nullable": true + }, + "x-position": 2 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, "/api/Resource": { "get": { "tags": [ @@ -5385,7 +5568,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/UserDetailDTO" } } } @@ -5699,9 +5882,28 @@ "pinCode": { "type": "string", "nullable": true + }, + "role": { + "$ref": "#/components/schemas/UserRole" } } }, + "UserRole": { + "type": "integer", + "description": "0 = SuperAdmin\n1 = InstanceAdmin\n2 = ContentEditor\n3 = Viewer", + "x-enumNames": [ + "SuperAdmin", + "InstanceAdmin", + "ContentEditor", + "Viewer" + ], + "enum": [ + 0, + 1, + 2, + 3 + ] + }, "LoginDTO": { "type": "object", "additionalProperties": false, @@ -5872,6 +6074,33 @@ } } }, + "CreateApiKeyRequest": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "appType": { + "$ref": "#/components/schemas/ApiKeyAppType" + } + } + }, + "ApiKeyAppType": { + "type": "integer", + "description": "0 = VisitApp\n1 = TabletApp\n2 = Other", + "x-enumNames": [ + "VisitApp", + "TabletApp", + "Other" + ], + "enum": [ + 0, + 1, + 2 + ] + }, "ApplicationInstanceDTO": { "type": "object", "additionalProperties": false, @@ -9761,52 +9990,6 @@ } } }, - "User": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "email", - "password", - "lastName", - "token", - "instanceId" - ], - "properties": { - "id": { - "type": "string", - "minLength": 1 - }, - "email": { - "type": "string", - "minLength": 1 - }, - "password": { - "type": "string", - "minLength": 1 - }, - "firstName": { - "type": "string", - "nullable": true - }, - "lastName": { - "type": "string", - "minLength": 1 - }, - "token": { - "type": "string", - "minLength": 1 - }, - "dateCreation": { - "type": "string", - "format": "date-time" - }, - "instanceId": { - "type": "string", - "minLength": 1 - } - } - }, "UserDetailDTO": { "type": "object", "additionalProperties": false, @@ -9830,6 +10013,18 @@ "instanceId": { "type": "string", "nullable": true + }, + "role": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/UserRole" + } + ] + }, + "password": { + "type": "string", + "nullable": true } } } @@ -9847,12 +10042,21 @@ } } } + }, + "apikey": { + "type": "apiKey", + "description": "API Key for mobile apps", + "name": "X-Api-Key", + "in": "header" } } }, "security": [ { "bearer": [] + }, + { + "apikey": [] } ], "tags": [ @@ -9864,6 +10068,10 @@ "name": "AI", "description": "Assistant IA" }, + { + "name": "ApiKey", + "description": "API Key management for mobile apps" + }, { "name": "ApplicationInstance", "description": "Application instance management" diff --git a/manager_api_new/.openapi-generator/FILES b/manager_api_new/.openapi-generator/FILES index 252916a..8ba88c3 100644 --- a/manager_api_new/.openapi-generator/FILES +++ b/manager_api_new/.openapi-generator/FILES @@ -11,6 +11,8 @@ doc/AiChatMessage.md doc/AiChatRequest.md doc/AiChatResponse.md doc/AiChatResponseNavigation.md +doc/ApiKeyApi.md +doc/ApiKeyAppType.md doc/AppConfigurationLink.md doc/AppConfigurationLinkApplicationInstance.md doc/AppConfigurationLinkConfiguration.md @@ -35,6 +37,7 @@ doc/Coordinate.md doc/CoordinateEqualityComparer.md doc/CoordinateSequence.md doc/CoordinateSequenceFactory.md +doc/CreateApiKeyRequest.md doc/DayStatDTO.md doc/Device.md doc/DeviceApi.md @@ -146,9 +149,10 @@ doc/StatsSummaryDTO.md doc/TokenDTO.md doc/TranslationAndResourceDTO.md doc/TranslationDTO.md -doc/User.md doc/UserApi.md doc/UserDetailDTO.md +doc/UserDetailDTORole.md +doc/UserRole.md doc/VideoDTO.md doc/VisitEventDTO.md doc/WeatherDTO.md @@ -156,6 +160,7 @@ doc/WebDTO.md git_push.sh lib/api.dart lib/api/ai_api.dart +lib/api/api_key_api.dart lib/api/application_instance_api.dart lib/api/authentication_api.dart lib/api/configuration_api.dart @@ -185,6 +190,7 @@ lib/model/ai_chat_message.dart lib/model/ai_chat_request.dart lib/model/ai_chat_response.dart lib/model/ai_chat_response_navigation.dart +lib/model/api_key_app_type.dart lib/model/app_configuration_link.dart lib/model/app_configuration_link_application_instance.dart lib/model/app_configuration_link_configuration.dart @@ -206,6 +212,7 @@ lib/model/coordinate.dart lib/model/coordinate_equality_comparer.dart lib/model/coordinate_sequence.dart lib/model/coordinate_sequence_factory.dart +lib/model/create_api_key_request.dart lib/model/day_stat_dto.dart lib/model/device.dart lib/model/device_detail_dto.dart @@ -308,27 +315,16 @@ lib/model/stats_summary_dto.dart lib/model/token_dto.dart lib/model/translation_and_resource_dto.dart lib/model/translation_dto.dart -lib/model/user.dart lib/model/user_detail_dto.dart +lib/model/user_detail_dto_role.dart +lib/model/user_role.dart lib/model/video_dto.dart lib/model/visit_event_dto.dart lib/model/weather_dto.dart lib/model/web_dto.dart pubspec.yaml -test/agenda_event_stat_dto_test.dart -test/ai_api_test.dart -test/ai_card_dto_test.dart -test/ai_chat_message_test.dart -test/ai_chat_request_test.dart -test/ai_chat_response_navigation_test.dart -test/ai_chat_response_test.dart -test/day_stat_dto_test.dart -test/game_stat_dto_test.dart -test/navigation_action_dto_test.dart -test/poi_stat_dto_test.dart -test/problem_details_test.dart -test/quiz_stat_dto_test.dart -test/section_stat_dto_test.dart -test/stats_api_test.dart -test/stats_summary_dto_test.dart -test/visit_event_dto_test.dart +test/api_key_api_test.dart +test/api_key_app_type_test.dart +test/create_api_key_request_test.dart +test/user_detail_dto_role_test.dart +test/user_role_test.dart diff --git a/manager_api_new/README.md b/manager_api_new/README.md index 39ea9f3..0b2a03d 100644 --- a/manager_api_new/README.md +++ b/manager_api_new/README.md @@ -3,7 +3,7 @@ API Manager Service This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: Version Alpha 5.0 +- API version: Version Alpha 2.0 - Generator version: 7.9.0 - Build package: org.openapitools.codegen.languages.DartClientCodegen @@ -62,6 +62,9 @@ All URIs are relative to *https://localhost:5001* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AIApi* | [**aiChat**](doc//AIApi.md#aichat) | **POST** /api/Ai/chat | +*ApiKeyApi* | [**apiKeyCreateApiKey**](doc//ApiKeyApi.md#apikeycreateapikey) | **POST** /api/ApiKey | +*ApiKeyApi* | [**apiKeyGetApiKeys**](doc//ApiKeyApi.md#apikeygetapikeys) | **GET** /api/ApiKey | +*ApiKeyApi* | [**apiKeyRevokeApiKey**](doc//ApiKeyApi.md#apikeyrevokeapikey) | **DELETE** /api/ApiKey/{id} | *ApplicationInstanceApi* | [**applicationInstanceAddConfigurationToApplicationInstance**](doc//ApplicationInstanceApi.md#applicationinstanceaddconfigurationtoapplicationinstance) | **POST** /api/ApplicationInstance/{applicationInstanceId}/application-link | *ApplicationInstanceApi* | [**applicationInstanceCreate**](doc//ApplicationInstanceApi.md#applicationinstancecreate) | **POST** /api/ApplicationInstance | *ApplicationInstanceApi* | [**applicationInstanceDelete**](doc//ApplicationInstanceApi.md#applicationinstancedelete) | **DELETE** /api/ApplicationInstance/{id} | @@ -90,6 +93,7 @@ Class | Method | HTTP request | Description *InstanceApi* | [**instanceCreateInstance**](doc//InstanceApi.md#instancecreateinstance) | **POST** /api/Instance | *InstanceApi* | [**instanceDeleteInstance**](doc//InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | *InstanceApi* | [**instanceGet**](doc//InstanceApi.md#instanceget) | **GET** /api/Instance | +*InstanceApi* | [**instanceGetAppKeyByPin**](doc//InstanceApi.md#instancegetappkeybypin) | **GET** /api/Instance/app-key | *InstanceApi* | [**instanceGetDetail**](doc//InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | *InstanceApi* | [**instanceGetInstanceByPinCode**](doc//InstanceApi.md#instancegetinstancebypincode) | **GET** /api/Instance/byPin | *InstanceApi* | [**instanceUpdateinstance**](doc//InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | @@ -173,6 +177,7 @@ Class | Method | HTTP request | Description - [AiChatRequest](doc//AiChatRequest.md) - [AiChatResponse](doc//AiChatResponse.md) - [AiChatResponseNavigation](doc//AiChatResponseNavigation.md) + - [ApiKeyAppType](doc//ApiKeyAppType.md) - [AppConfigurationLink](doc//AppConfigurationLink.md) - [AppConfigurationLinkApplicationInstance](doc//AppConfigurationLinkApplicationInstance.md) - [AppConfigurationLinkConfiguration](doc//AppConfigurationLinkConfiguration.md) @@ -194,6 +199,7 @@ Class | Method | HTTP request | Description - [CoordinateEqualityComparer](doc//CoordinateEqualityComparer.md) - [CoordinateSequence](doc//CoordinateSequence.md) - [CoordinateSequenceFactory](doc//CoordinateSequenceFactory.md) + - [CreateApiKeyRequest](doc//CreateApiKeyRequest.md) - [DayStatDTO](doc//DayStatDTO.md) - [Device](doc//Device.md) - [DeviceDTO](doc//DeviceDTO.md) @@ -296,8 +302,9 @@ Class | Method | HTTP request | Description - [TokenDTO](doc//TokenDTO.md) - [TranslationAndResourceDTO](doc//TranslationAndResourceDTO.md) - [TranslationDTO](doc//TranslationDTO.md) - - [User](doc//User.md) - [UserDetailDTO](doc//UserDetailDTO.md) + - [UserDetailDTORole](doc//UserDetailDTORole.md) + - [UserRole](doc//UserRole.md) - [VideoDTO](doc//VideoDTO.md) - [VisitEventDTO](doc//VisitEventDTO.md) - [WeatherDTO](doc//WeatherDTO.md) @@ -316,6 +323,12 @@ Authentication schemes defined for the API: - **Scopes**: - **Manager-api**: Manager WebAPI +### apikey + +- **Type**: API key +- **API key parameter name**: X-Api-Key +- **Location**: HTTP header + ## Author diff --git a/manager_api_new/doc/AIApi.md b/manager_api_new/doc/AIApi.md index c6ed324..d85ce6e 100644 --- a/manager_api_new/doc/AIApi.md +++ b/manager_api_new/doc/AIApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *http://192.168.31.228:5000* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/ApiKeyApi.md b/manager_api_new/doc/ApiKeyApi.md new file mode 100644 index 0000000..d4f32c0 --- /dev/null +++ b/manager_api_new/doc/ApiKeyApi.md @@ -0,0 +1,141 @@ +# manager_api_new.api.ApiKeyApi + +## Load the API package +```dart +import 'package:manager_api_new/api.dart'; +``` + +All URIs are relative to *https://localhost:5001* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**apiKeyCreateApiKey**](ApiKeyApi.md#apikeycreateapikey) | **POST** /api/ApiKey | +[**apiKeyGetApiKeys**](ApiKeyApi.md#apikeygetapikeys) | **GET** /api/ApiKey | +[**apiKeyRevokeApiKey**](ApiKeyApi.md#apikeyrevokeapikey) | **DELETE** /api/ApiKey/{id} | + + +# **apiKeyCreateApiKey** +> MultipartFile apiKeyCreateApiKey(createApiKeyRequest) + + + +### Example +```dart +import 'package:manager_api_new/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ApiKeyApi(); +final createApiKeyRequest = CreateApiKeyRequest(); // CreateApiKeyRequest | + +try { + final result = api_instance.apiKeyCreateApiKey(createApiKeyRequest); + print(result); +} catch (e) { + print('Exception when calling ApiKeyApi->apiKeyCreateApiKey: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createApiKeyRequest** | [**CreateApiKeyRequest**](CreateApiKeyRequest.md)| | + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **apiKeyGetApiKeys** +> MultipartFile apiKeyGetApiKeys() + + + +### Example +```dart +import 'package:manager_api_new/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ApiKeyApi(); + +try { + final result = api_instance.apiKeyGetApiKeys(); + print(result); +} catch (e) { + print('Exception when calling ApiKeyApi->apiKeyGetApiKeys: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **apiKeyRevokeApiKey** +> MultipartFile apiKeyRevokeApiKey(id) + + + +### Example +```dart +import 'package:manager_api_new/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ApiKeyApi(); +final id = id_example; // String | + +try { + final result = api_instance.apiKeyRevokeApiKey(id); + print(result); +} catch (e) { + print('Exception when calling ApiKeyApi->apiKeyRevokeApiKey: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**MultipartFile**](MultipartFile.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/manager_api_new/doc/ApiKeyAppType.md b/manager_api_new/doc/ApiKeyAppType.md new file mode 100644 index 0000000..b48ad61 --- /dev/null +++ b/manager_api_new/doc/ApiKeyAppType.md @@ -0,0 +1,14 @@ +# manager_api_new.model.ApiKeyAppType + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/ApplicationInstanceApi.md b/manager_api_new/doc/ApplicationInstanceApi.md index bb036d2..f2756e2 100644 --- a/manager_api_new/doc/ApplicationInstanceApi.md +++ b/manager_api_new/doc/ApplicationInstanceApi.md @@ -204,6 +204,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -230,7 +234,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers @@ -247,6 +251,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -273,7 +281,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers diff --git a/manager_api_new/doc/AuthenticationApi.md b/manager_api_new/doc/AuthenticationApi.md index 9ef127e..9572d91 100644 --- a/manager_api_new/doc/AuthenticationApi.md +++ b/manager_api_new/doc/AuthenticationApi.md @@ -21,6 +21,10 @@ Method | HTTP request | Description ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -55,7 +59,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers @@ -72,6 +76,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -98,7 +106,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers diff --git a/manager_api_new/doc/CreateApiKeyRequest.md b/manager_api_new/doc/CreateApiKeyRequest.md new file mode 100644 index 0000000..de91551 --- /dev/null +++ b/manager_api_new/doc/CreateApiKeyRequest.md @@ -0,0 +1,16 @@ +# manager_api_new.model.CreateApiKeyRequest + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**appType** | [**ApiKeyAppType**](ApiKeyAppType.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/DeviceApi.md b/manager_api_new/doc/DeviceApi.md index 1173900..153c0b1 100644 --- a/manager_api_new/doc/DeviceApi.md +++ b/manager_api_new/doc/DeviceApi.md @@ -25,6 +25,10 @@ Method | HTTP request | Description ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -51,7 +55,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers @@ -154,6 +158,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -180,7 +188,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers diff --git a/manager_api_new/doc/InstanceApi.md b/manager_api_new/doc/InstanceApi.md index 5d8e006..0657f32 100644 --- a/manager_api_new/doc/InstanceApi.md +++ b/manager_api_new/doc/InstanceApi.md @@ -12,6 +12,7 @@ Method | HTTP request | Description [**instanceCreateInstance**](InstanceApi.md#instancecreateinstance) | **POST** /api/Instance | [**instanceDeleteInstance**](InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | [**instanceGet**](InstanceApi.md#instanceget) | **GET** /api/Instance | +[**instanceGetAppKeyByPin**](InstanceApi.md#instancegetappkeybypin) | **GET** /api/Instance/app-key | [**instanceGetDetail**](InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | [**instanceGetInstanceByPinCode**](InstanceApi.md#instancegetinstancebypincode) | **GET** /api/Instance/byPin | [**instanceUpdateinstance**](InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | @@ -142,6 +143,55 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **instanceGetAppKeyByPin** +> Object instanceGetAppKeyByPin(pinCode, appType) + + + +### Example +```dart +import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = InstanceApi(); +final pinCode = pinCode_example; // String | +final appType = appType_example; // String | + +try { + final result = api_instance.instanceGetAppKeyByPin(pinCode, appType); + print(result); +} catch (e) { + print('Exception when calling InstanceApi->instanceGetAppKeyByPin: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pinCode** | **String**| | [optional] + **appType** | **String**| | [optional] + +### Return type + +[**Object**](Object.md) + +### Authorization + +[apikey](../README.md#apikey), [bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **instanceGetDetail** > InstanceDTO instanceGetDetail(id) @@ -193,6 +243,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -219,7 +273,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers diff --git a/manager_api_new/doc/ResourceApi.md b/manager_api_new/doc/ResourceApi.md index ff8f425..8d6556c 100644 --- a/manager_api_new/doc/ResourceApi.md +++ b/manager_api_new/doc/ResourceApi.md @@ -157,6 +157,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -183,7 +187,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers @@ -200,6 +204,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -226,7 +234,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers diff --git a/manager_api_new/doc/SectionAgendaApi.md b/manager_api_new/doc/SectionAgendaApi.md index d1b3296..c0917e4 100644 --- a/manager_api_new/doc/SectionAgendaApi.md +++ b/manager_api_new/doc/SectionAgendaApi.md @@ -111,6 +111,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -137,7 +141,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers diff --git a/manager_api_new/doc/SectionApi.md b/manager_api_new/doc/SectionApi.md index 5c08160..fd78207 100644 --- a/manager_api_new/doc/SectionApi.md +++ b/manager_api_new/doc/SectionApi.md @@ -256,6 +256,10 @@ This endpoint does not need any parameter. ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -282,7 +286,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers @@ -426,6 +430,10 @@ This endpoint does not need any parameter. ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -452,7 +460,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers @@ -469,6 +477,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -495,7 +507,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers @@ -512,6 +524,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -538,7 +554,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers diff --git a/manager_api_new/doc/SectionEventApi.md b/manager_api_new/doc/SectionEventApi.md index 04371a6..4d8e8b6 100644 --- a/manager_api_new/doc/SectionEventApi.md +++ b/manager_api_new/doc/SectionEventApi.md @@ -203,6 +203,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -229,7 +233,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers @@ -246,6 +250,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -272,7 +280,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers diff --git a/manager_api_new/doc/SectionMapApi.md b/manager_api_new/doc/SectionMapApi.md index 348f749..b3848a0 100644 --- a/manager_api_new/doc/SectionMapApi.md +++ b/manager_api_new/doc/SectionMapApi.md @@ -295,6 +295,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -321,7 +325,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers @@ -338,6 +342,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -364,7 +372,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers @@ -381,6 +389,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -407,7 +419,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers diff --git a/manager_api_new/doc/SectionQuizApi.md b/manager_api_new/doc/SectionQuizApi.md index 6d35ebf..3f72438 100644 --- a/manager_api_new/doc/SectionQuizApi.md +++ b/manager_api_new/doc/SectionQuizApi.md @@ -111,6 +111,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -137,7 +141,7 @@ Name | Type | Description | Notes ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers diff --git a/manager_api_new/doc/StatsApi.md b/manager_api_new/doc/StatsApi.md index 42b7509..476eccc 100644 --- a/manager_api_new/doc/StatsApi.md +++ b/manager_api_new/doc/StatsApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *http://192.168.31.228:5000* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -70,6 +70,10 @@ Name | Type | Description | Notes ### Example ```dart import 'package:manager_api_new/api.dart'; +// TODO Configure API key authorization: apikey +//defaultApiClient.getAuthentication('apikey').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('apikey').apiKeyPrefix = 'Bearer'; // TODO Configure OAuth2 access token for authorization: bearer //defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; @@ -95,7 +99,7 @@ void (empty response body) ### Authorization -[bearer](../README.md#bearer) +[apikey](../README.md#apikey), [bearer](../README.md#bearer) ### HTTP request headers diff --git a/manager_api_new/doc/TokenDTO.md b/manager_api_new/doc/TokenDTO.md index 975c521..65973cc 100644 --- a/manager_api_new/doc/TokenDTO.md +++ b/manager_api_new/doc/TokenDTO.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **expiration** | [**DateTime**](DateTime.md) | | [optional] **instanceId** | **String** | | [optional] **pinCode** | **String** | | [optional] +**role** | [**UserRole**](UserRole.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/UserApi.md b/manager_api_new/doc/UserApi.md index c46e856..3fcca3d 100644 --- a/manager_api_new/doc/UserApi.md +++ b/manager_api_new/doc/UserApi.md @@ -103,7 +103,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **userGet** -> List userGet() +> List userGet() @@ -128,7 +128,7 @@ This endpoint does not need any parameter. ### Return type -[**List**](User.md) +[**List**](UserDetailDTO.md) ### Authorization diff --git a/manager_api_new/doc/UserDetailDTO.md b/manager_api_new/doc/UserDetailDTO.md index 5c4a0ea..0bd66ba 100644 --- a/manager_api_new/doc/UserDetailDTO.md +++ b/manager_api_new/doc/UserDetailDTO.md @@ -13,6 +13,8 @@ Name | Type | Description | Notes **firstName** | **String** | | [optional] **lastName** | **String** | | [optional] **instanceId** | **String** | | [optional] +**role** | [**UserDetailDTORole**](UserDetailDTORole.md) | | [optional] +**password** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/UserDetailDTORole.md b/manager_api_new/doc/UserDetailDTORole.md new file mode 100644 index 0000000..3b0f374 --- /dev/null +++ b/manager_api_new/doc/UserDetailDTORole.md @@ -0,0 +1,14 @@ +# manager_api_new.model.UserDetailDTORole + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/UserRole.md b/manager_api_new/doc/UserRole.md new file mode 100644 index 0000000..ae10cc2 --- /dev/null +++ b/manager_api_new/doc/UserRole.md @@ -0,0 +1,14 @@ +# manager_api_new.model.UserRole + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/lib/api.dart b/manager_api_new/lib/api.dart index ca264ea..d7182bd 100644 --- a/manager_api_new/lib/api.dart +++ b/manager_api_new/lib/api.dart @@ -29,6 +29,7 @@ part 'auth/http_basic_auth.dart'; part 'auth/http_bearer_auth.dart'; part 'api/ai_api.dart'; +part 'api/api_key_api.dart'; part 'api/application_instance_api.dart'; part 'api/authentication_api.dart'; part 'api/configuration_api.dart'; @@ -50,6 +51,7 @@ part 'model/ai_chat_message.dart'; part 'model/ai_chat_request.dart'; part 'model/ai_chat_response.dart'; part 'model/ai_chat_response_navigation.dart'; +part 'model/api_key_app_type.dart'; part 'model/app_configuration_link.dart'; part 'model/app_configuration_link_application_instance.dart'; part 'model/app_configuration_link_configuration.dart'; @@ -72,6 +74,7 @@ part 'model/coordinate.dart'; part 'model/coordinate_equality_comparer.dart'; part 'model/coordinate_sequence.dart'; part 'model/coordinate_sequence_factory.dart'; +part 'model/create_api_key_request.dart'; part 'model/device.dart'; part 'model/device_dto.dart'; part 'model/device_detail_dto.dart'; @@ -169,8 +172,10 @@ part 'model/stats_summary_dto.dart'; part 'model/token_dto.dart'; part 'model/translation_and_resource_dto.dart'; part 'model/translation_dto.dart'; -part 'model/user.dart'; part 'model/user_detail_dto.dart'; +part 'model/user_detail_dto_role.dart'; +part 'model/user_role.dart'; +part 'model/user_role_extensions.dart'; part 'model/video_dto.dart'; part 'model/visit_event_dto.dart'; part 'model/weather_dto.dart'; diff --git a/manager_api_new/lib/api/api_key_api.dart b/manager_api_new/lib/api/api_key_api.dart new file mode 100644 index 0000000..7957507 --- /dev/null +++ b/manager_api_new/lib/api/api_key_api.dart @@ -0,0 +1,170 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ApiKeyApi { + ApiKeyApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/ApiKey' operation and returns the [Response]. + /// Parameters: + /// + /// * [CreateApiKeyRequest] createApiKeyRequest (required): + Future apiKeyCreateApiKeyWithHttpInfo( + CreateApiKeyRequest createApiKeyRequest, + ) async { + // ignore: prefer_const_declarations + final path = r'/api/ApiKey'; + + // ignore: prefer_final_locals + Object? postBody = createApiKeyRequest; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [CreateApiKeyRequest] createApiKeyRequest (required): + Future apiKeyCreateApiKey( + CreateApiKeyRequest createApiKeyRequest, + ) async { + final response = await apiKeyCreateApiKeyWithHttpInfo( + createApiKeyRequest, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && + response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync( + await _decodeBodyBytes(response), + 'MultipartFile', + ) as MultipartFile; + } + return null; + } + + /// Performs an HTTP 'GET /api/ApiKey' operation and returns the [Response]. + Future apiKeyGetApiKeysWithHttpInfo() async { + // ignore: prefer_const_declarations + final path = r'/api/ApiKey'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future apiKeyGetApiKeys() async { + final response = await apiKeyGetApiKeysWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && + response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync( + await _decodeBodyBytes(response), + 'MultipartFile', + ) as MultipartFile; + } + return null; + } + + /// Performs an HTTP 'DELETE /api/ApiKey/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future apiKeyRevokeApiKeyWithHttpInfo( + String id, + ) async { + // ignore: prefer_const_declarations + final path = r'/api/ApiKey/{id}'.replaceAll('{id}', id); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + return apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future apiKeyRevokeApiKey( + String id, + ) async { + final response = await apiKeyRevokeApiKeyWithHttpInfo( + id, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && + response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync( + await _decodeBodyBytes(response), + 'MultipartFile', + ) as MultipartFile; + } + return null; + } +} diff --git a/manager_api_new/lib/api/instance_api.dart b/manager_api_new/lib/api/instance_api.dart index 45b2163..38bc796 100644 --- a/manager_api_new/lib/api/instance_api.dart +++ b/manager_api_new/lib/api/instance_api.dart @@ -170,6 +170,75 @@ class InstanceApi { return null; } + /// Performs an HTTP 'GET /api/Instance/app-key' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] pinCode: + /// + /// * [String] appType: + Future instanceGetAppKeyByPinWithHttpInfo({ + String? pinCode, + String? appType, + }) async { + // ignore: prefer_const_declarations + final path = r'/api/Instance/app-key'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (pinCode != null) { + queryParams.addAll(_queryParams('', 'pinCode', pinCode)); + } + if (appType != null) { + queryParams.addAll(_queryParams('', 'appType', appType)); + } + + const contentTypes = []; + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Parameters: + /// + /// * [String] pinCode: + /// + /// * [String] appType: + Future instanceGetAppKeyByPin({ + String? pinCode, + String? appType, + }) async { + final response = await instanceGetAppKeyByPinWithHttpInfo( + pinCode: pinCode, + appType: appType, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && + response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync( + await _decodeBodyBytes(response), + 'Object', + ) as Object; + } + return null; + } + /// Performs an HTTP 'GET /api/Instance/{id}' operation and returns the [Response]. /// Parameters: /// diff --git a/manager_api_new/lib/api/user_api.dart b/manager_api_new/lib/api/user_api.dart index 786a2da..bd8d299 100644 --- a/manager_api_new/lib/api/user_api.dart +++ b/manager_api_new/lib/api/user_api.dart @@ -150,7 +150,7 @@ class UserApi { ); } - Future?> userGet() async { + Future?> userGet() async { final response = await userGetWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); @@ -161,9 +161,9 @@ class UserApi { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { final responseBody = await _decodeBodyBytes(response); - return (await apiClient.deserializeAsync(responseBody, 'List') - as List) - .cast() + return (await apiClient.deserializeAsync( + responseBody, 'List') as List) + .cast() .toList(growable: false); } return null; diff --git a/manager_api_new/lib/api_client.dart b/manager_api_new/lib/api_client.dart index bd71a5f..8f39185 100644 --- a/manager_api_new/lib/api_client.dart +++ b/manager_api_new/lib/api_client.dart @@ -491,8 +491,6 @@ class ApiClient { return TranslationAndResourceDTO.fromJson(value); case 'TranslationDTO': return TranslationDTO.fromJson(value); - case 'User': - return User.fromJson(value); case 'UserDetailDTO': return UserDetailDTO.fromJson(value); case 'VideoDTO': diff --git a/manager_api_new/lib/api_helper.dart b/manager_api_new/lib/api_helper.dart index 3948ee7..7ee03ef 100644 --- a/manager_api_new/lib/api_helper.dart +++ b/manager_api_new/lib/api_helper.dart @@ -65,6 +65,9 @@ String parameterToString(dynamic value) { if (value is DateTime) { return value.toUtc().toIso8601String(); } + if (value is ApiKeyAppType) { + return ApiKeyAppTypeTypeTransformer().encode(value).toString(); + } if (value is AppType) { return AppTypeTypeTransformer().encode(value).toString(); } @@ -107,6 +110,9 @@ String parameterToString(dynamic value) { if (value is SectionType) { return SectionTypeTypeTransformer().encode(value).toString(); } + if (value is UserRole) { + return UserRoleTypeTransformer().encode(value).toString(); + } return value.toString(); } diff --git a/manager_api_new/lib/model/agenda_event_stat_dto.dart b/manager_api_new/lib/model/agenda_event_stat_dto.dart new file mode 100644 index 0000000..1d92185 --- /dev/null +++ b/manager_api_new/lib/model/agenda_event_stat_dto.dart @@ -0,0 +1,152 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AgendaEventStatDTO { + /// Returns a new [AgendaEventStatDTO] instance. + AgendaEventStatDTO({ + this.eventId, + this.eventTitle, + this.taps, + }); + + String? eventId; + + String? eventTitle; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? taps; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AgendaEventStatDTO && + other.eventId == eventId && + other.eventTitle == eventTitle && + other.taps == taps; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (eventId == null ? 0 : eventId!.hashCode) + + (eventTitle == null ? 0 : eventTitle!.hashCode) + + (taps == null ? 0 : taps!.hashCode); + + @override + String toString() => + 'AgendaEventStatDTO[eventId=$eventId, eventTitle=$eventTitle, taps=$taps]'; + + Map toJson() { + final json = {}; + if (this.eventId != null) { + json[r'eventId'] = this.eventId; + } else { + json[r'eventId'] = null; + } + if (this.eventTitle != null) { + json[r'eventTitle'] = this.eventTitle; + } else { + json[r'eventTitle'] = null; + } + if (this.taps != null) { + json[r'taps'] = this.taps; + } else { + json[r'taps'] = null; + } + return json; + } + + /// Returns a new [AgendaEventStatDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AgendaEventStatDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "AgendaEventStatDTO[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "AgendaEventStatDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AgendaEventStatDTO( + eventId: mapValueOfType(json, r'eventId'), + eventTitle: mapValueOfType(json, r'eventTitle'), + taps: mapValueOfType(json, r'taps'), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = AgendaEventStatDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AgendaEventStatDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AgendaEventStatDTO-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = AgendaEventStatDTO.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/api_key_app_type.dart b/manager_api_new/lib/model/api_key_app_type.dart new file mode 100644 index 0000000..79bc528 --- /dev/null +++ b/manager_api_new/lib/model/api_key_app_type.dart @@ -0,0 +1,95 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +/// 0 = VisitApp 1 = TabletApp 2 = Other +class ApiKeyAppType { + /// Instantiate a new enum with the provided [value]. + const ApiKeyAppType._(this.value); + + /// The underlying value of this enum member. + final int value; + + @override + String toString() => value.toString(); + + int toJson() => value; + + static const number0 = ApiKeyAppType._(0); + static const number1 = ApiKeyAppType._(1); + static const number2 = ApiKeyAppType._(2); + + /// List of all possible values in this [enum][ApiKeyAppType]. + static const values = [ + number0, + number1, + number2, + ]; + + static ApiKeyAppType? fromJson(dynamic value) => + ApiKeyAppTypeTypeTransformer().decode(value); + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ApiKeyAppType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [ApiKeyAppType] to int, +/// and [decode] dynamic data back to [ApiKeyAppType]. +class ApiKeyAppTypeTypeTransformer { + factory ApiKeyAppTypeTypeTransformer() => + _instance ??= const ApiKeyAppTypeTypeTransformer._(); + + const ApiKeyAppTypeTypeTransformer._(); + + int encode(ApiKeyAppType data) => data.value; + + /// Decodes a [dynamic value][data] to a ApiKeyAppType. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + ApiKeyAppType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + case 0: + return ApiKeyAppType.number0; + case 1: + return ApiKeyAppType.number1; + case 2: + return ApiKeyAppType.number2; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [ApiKeyAppTypeTypeTransformer] instance. + static ApiKeyAppTypeTypeTransformer? _instance; +} diff --git a/manager_api_new/lib/model/app_configuration_link_application_instance.dart b/manager_api_new/lib/model/app_configuration_link_application_instance.dart index d34d758..6ef7039 100644 --- a/manager_api_new/lib/model/app_configuration_link_application_instance.dart +++ b/manager_api_new/lib/model/app_configuration_link_application_instance.dart @@ -27,6 +27,7 @@ class AppConfigurationLinkApplicationInstance { this.languages = const [], this.sectionEventId, this.sectionEvent, + this.isAssistant, }); String instanceId; @@ -63,6 +64,14 @@ class AppConfigurationLinkApplicationInstance { ApplicationInstanceSectionEvent? sectionEvent; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isAssistant; + @override bool operator ==(Object other) => identical(this, other) || @@ -80,7 +89,8 @@ class AppConfigurationLinkApplicationInstance { other.layoutMainPage == layoutMainPage && _deepEquality.equals(other.languages, languages) && other.sectionEventId == sectionEventId && - other.sectionEvent == sectionEvent; + other.sectionEvent == sectionEvent && + other.isAssistant == isAssistant; @override int get hashCode => @@ -98,11 +108,12 @@ class AppConfigurationLinkApplicationInstance { (layoutMainPage == null ? 0 : layoutMainPage!.hashCode) + (languages == null ? 0 : languages!.hashCode) + (sectionEventId == null ? 0 : sectionEventId!.hashCode) + - (sectionEvent == null ? 0 : sectionEvent!.hashCode); + (sectionEvent == null ? 0 : sectionEvent!.hashCode) + + (isAssistant == null ? 0 : isAssistant!.hashCode); @override String toString() => - 'AppConfigurationLinkApplicationInstance[instanceId=$instanceId, appType=$appType, id=$id, configurations=$configurations, mainImageId=$mainImageId, mainImageUrl=$mainImageUrl, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, layoutMainPage=$layoutMainPage, languages=$languages, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent]'; + 'AppConfigurationLinkApplicationInstance[instanceId=$instanceId, appType=$appType, id=$id, configurations=$configurations, mainImageId=$mainImageId, mainImageUrl=$mainImageUrl, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, layoutMainPage=$layoutMainPage, languages=$languages, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent, isAssistant=$isAssistant]'; Map toJson() { final json = {}; @@ -168,6 +179,11 @@ class AppConfigurationLinkApplicationInstance { } else { json[r'sectionEvent'] = null; } + if (this.isAssistant != null) { + json[r'isAssistant'] = this.isAssistant; + } else { + json[r'isAssistant'] = null; + } return json; } @@ -212,6 +228,7 @@ class AppConfigurationLinkApplicationInstance { sectionEventId: mapValueOfType(json, r'sectionEventId'), sectionEvent: ApplicationInstanceSectionEvent.fromJson(json[r'sectionEvent']), + isAssistant: mapValueOfType(json, r'isAssistant'), ); } return null; diff --git a/manager_api_new/lib/model/create_api_key_request.dart b/manager_api_new/lib/model/create_api_key_request.dart new file mode 100644 index 0000000..ead0dc9 --- /dev/null +++ b/manager_api_new/lib/model/create_api_key_request.dart @@ -0,0 +1,140 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class CreateApiKeyRequest { + /// Returns a new [CreateApiKeyRequest] instance. + CreateApiKeyRequest({ + this.name, + this.appType, + }); + + String? name; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + ApiKeyAppType? appType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is CreateApiKeyRequest && + other.name == name && + other.appType == appType; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (name == null ? 0 : name!.hashCode) + + (appType == null ? 0 : appType!.hashCode); + + @override + String toString() => 'CreateApiKeyRequest[name=$name, appType=$appType]'; + + Map toJson() { + final json = {}; + if (this.name != null) { + json[r'name'] = this.name; + } else { + json[r'name'] = null; + } + if (this.appType != null) { + json[r'appType'] = this.appType; + } else { + json[r'appType'] = null; + } + return json; + } + + /// Returns a new [CreateApiKeyRequest] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateApiKeyRequest? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "CreateApiKeyRequest[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "CreateApiKeyRequest[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateApiKeyRequest( + name: mapValueOfType(json, r'name'), + appType: ApiKeyAppType.fromJson(json[r'appType']), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateApiKeyRequest.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateApiKeyRequest.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateApiKeyRequest-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateApiKeyRequest.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/token_dto.dart b/manager_api_new/lib/model/token_dto.dart index be65209..fec6d30 100644 --- a/manager_api_new/lib/model/token_dto.dart +++ b/manager_api_new/lib/model/token_dto.dart @@ -21,6 +21,7 @@ class TokenDTO { this.expiration, this.instanceId, this.pinCode, + this.role, }); String? accessToken; @@ -51,6 +52,14 @@ class TokenDTO { String? pinCode; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + UserRole? role; + @override bool operator ==(Object other) => identical(this, other) || @@ -62,7 +71,8 @@ class TokenDTO { other.expiresIn == expiresIn && other.expiration == expiration && other.instanceId == instanceId && - other.pinCode == pinCode; + other.pinCode == pinCode && + other.role == role; @override int get hashCode => @@ -74,11 +84,12 @@ class TokenDTO { (expiresIn == null ? 0 : expiresIn!.hashCode) + (expiration == null ? 0 : expiration!.hashCode) + (instanceId == null ? 0 : instanceId!.hashCode) + - (pinCode == null ? 0 : pinCode!.hashCode); + (pinCode == null ? 0 : pinCode!.hashCode) + + (role == null ? 0 : role!.hashCode); @override String toString() => - 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration, instanceId=$instanceId, pinCode=$pinCode]'; + 'TokenDTO[accessToken=$accessToken, refreshToken=$refreshToken, scope=$scope, tokenType=$tokenType, expiresIn=$expiresIn, expiration=$expiration, instanceId=$instanceId, pinCode=$pinCode, role=$role]'; Map toJson() { final json = {}; @@ -122,6 +133,11 @@ class TokenDTO { } else { json[r'pinCode'] = null; } + if (this.role != null) { + json[r'role'] = this.role; + } else { + json[r'role'] = null; + } return json; } @@ -154,6 +170,7 @@ class TokenDTO { expiration: mapDateTime(json, r'expiration', r''), instanceId: mapValueOfType(json, r'instanceId'), pinCode: mapValueOfType(json, r'pinCode'), + role: UserRole.fromJson(json[r'role']), ); } return null; diff --git a/manager_api_new/lib/model/user_detail_dto.dart b/manager_api_new/lib/model/user_detail_dto.dart index fb48547..70d3f18 100644 --- a/manager_api_new/lib/model/user_detail_dto.dart +++ b/manager_api_new/lib/model/user_detail_dto.dart @@ -18,6 +18,8 @@ class UserDetailDTO { this.firstName, this.lastName, this.instanceId, + this.role, + this.password, }); String? id; @@ -30,6 +32,10 @@ class UserDetailDTO { String? instanceId; + UserDetailDTORole? role; + + String? password; + @override bool operator ==(Object other) => identical(this, other) || @@ -38,7 +44,9 @@ class UserDetailDTO { other.email == email && other.firstName == firstName && other.lastName == lastName && - other.instanceId == instanceId; + other.instanceId == instanceId && + other.role == role && + other.password == password; @override int get hashCode => @@ -47,11 +55,13 @@ class UserDetailDTO { (email == null ? 0 : email!.hashCode) + (firstName == null ? 0 : firstName!.hashCode) + (lastName == null ? 0 : lastName!.hashCode) + - (instanceId == null ? 0 : instanceId!.hashCode); + (instanceId == null ? 0 : instanceId!.hashCode) + + (role == null ? 0 : role!.hashCode) + + (password == null ? 0 : password!.hashCode); @override String toString() => - 'UserDetailDTO[id=$id, email=$email, firstName=$firstName, lastName=$lastName, instanceId=$instanceId]'; + 'UserDetailDTO[id=$id, email=$email, firstName=$firstName, lastName=$lastName, instanceId=$instanceId, role=$role, password=$password]'; Map toJson() { final json = {}; @@ -80,6 +90,16 @@ class UserDetailDTO { } else { json[r'instanceId'] = null; } + if (this.role != null) { + json[r'role'] = this.role; + } else { + json[r'role'] = null; + } + if (this.password != null) { + json[r'password'] = this.password; + } else { + json[r'password'] = null; + } return json; } @@ -109,6 +129,8 @@ class UserDetailDTO { firstName: mapValueOfType(json, r'firstName'), lastName: mapValueOfType(json, r'lastName'), instanceId: mapValueOfType(json, r'instanceId'), + role: UserDetailDTORole.fromJson(json[r'role']), + password: mapValueOfType(json, r'password'), ); } return null; diff --git a/manager_api_new/lib/model/user_detail_dto_role.dart b/manager_api_new/lib/model/user_detail_dto_role.dart new file mode 100644 index 0000000..1545a8e --- /dev/null +++ b/manager_api_new/lib/model/user_detail_dto_role.dart @@ -0,0 +1,100 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class UserDetailDTORole { + /// Returns a new [UserDetailDTORole] instance. + UserDetailDTORole(); + + @override + bool operator ==(Object other) => identical(this, other) || other is UserDetailDTORole; + + /*@override + int get hashCode => + // ignore: unnecessary_parenthesis + + @override + String toString() => 'UserDetailDTORole[]';*/ + + Map toJson() { + final json = {}; + return json; + } + + /// Returns a new [UserDetailDTORole] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static UserDetailDTORole? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "UserDetailDTORole[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "UserDetailDTORole[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return UserDetailDTORole( + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = UserDetailDTORole.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = UserDetailDTORole.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of UserDetailDTORole-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = UserDetailDTORole.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api_new/lib/model/user_role.dart b/manager_api_new/lib/model/user_role.dart new file mode 100644 index 0000000..b00777a --- /dev/null +++ b/manager_api_new/lib/model/user_role.dart @@ -0,0 +1,99 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +/// 0 = SuperAdmin 1 = InstanceAdmin 2 = ContentEditor 3 = Viewer +class UserRole { + /// Instantiate a new enum with the provided [value]. + const UserRole._(this.value); + + /// The underlying value of this enum member. + final int value; + + @override + String toString() => value.toString(); + + int toJson() => value; + + static const number0 = UserRole._(0); + static const number1 = UserRole._(1); + static const number2 = UserRole._(2); + static const number3 = UserRole._(3); + + /// List of all possible values in this [enum][UserRole]. + static const values = [ + number0, + number1, + number2, + number3, + ]; + + static UserRole? fromJson(dynamic value) => + UserRoleTypeTransformer().decode(value); + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = UserRole.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [UserRole] to int, +/// and [decode] dynamic data back to [UserRole]. +class UserRoleTypeTransformer { + factory UserRoleTypeTransformer() => + _instance ??= const UserRoleTypeTransformer._(); + + const UserRoleTypeTransformer._(); + + int encode(UserRole data) => data.value; + + /// Decodes a [dynamic value][data] to a UserRole. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + UserRole? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + case 0: + return UserRole.number0; + case 1: + return UserRole.number1; + case 2: + return UserRole.number2; + case 3: + return UserRole.number3; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [UserRoleTypeTransformer] instance. + static UserRoleTypeTransformer? _instance; +} diff --git a/manager_api_new/lib/model/user_role_extensions.dart b/manager_api_new/lib/model/user_role_extensions.dart new file mode 100644 index 0000000..72e11bb --- /dev/null +++ b/manager_api_new/lib/model/user_role_extensions.dart @@ -0,0 +1,16 @@ +// @dart=2.18 + +part of openapi.api; + +/// Extension ajoutant le nom string à [UserRole], synchronisé avec l'enum C# backend. +extension UserRoleName on UserRole { + String get name { + switch (value) { + case 0: return 'SuperAdmin'; + case 1: return 'InstanceAdmin'; + case 2: return 'ContentEditor'; + case 3: return 'Viewer'; + default: return value.toString(); + } + } +} diff --git a/manager_api_new/test/api_key_api_test.dart b/manager_api_new/test/api_key_api_test.dart new file mode 100644 index 0000000..e161e85 --- /dev/null +++ b/manager_api_new/test/api_key_api_test.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +/// tests for ApiKeyApi +void main() { + // final instance = ApiKeyApi(); + + group('tests for ApiKeyApi', () { + //Future apiKeyCreateApiKey(CreateApiKeyRequest createApiKeyRequest) async + test('test apiKeyCreateApiKey', () async { + // TODO + }); + + //Future apiKeyGetApiKeys() async + test('test apiKeyGetApiKeys', () async { + // TODO + }); + + //Future apiKeyRevokeApiKey(String id) async + test('test apiKeyRevokeApiKey', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/api_key_app_type_test.dart b/manager_api_new/test/api_key_app_type_test.dart new file mode 100644 index 0000000..02ae838 --- /dev/null +++ b/manager_api_new/test/api_key_app_type_test.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiKeyAppType +void main() { + group('test ApiKeyAppType', () {}); +} diff --git a/manager_api_new/test/create_api_key_request_test.dart b/manager_api_new/test/create_api_key_request_test.dart new file mode 100644 index 0000000..371bd64 --- /dev/null +++ b/manager_api_new/test/create_api_key_request_test.dart @@ -0,0 +1,29 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateApiKeyRequest +void main() { + // final instance = CreateApiKeyRequest(); + + group('test CreateApiKeyRequest', () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + // ApiKeyAppType appType + test('to test the property `appType`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/user_detail_dto_role_test.dart b/manager_api_new/test/user_detail_dto_role_test.dart new file mode 100644 index 0000000..b74d075 --- /dev/null +++ b/manager_api_new/test/user_detail_dto_role_test.dart @@ -0,0 +1,19 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for UserDetailDTORole +void main() { + // final instance = UserDetailDTORole(); + + group('test UserDetailDTORole', () {}); +} diff --git a/manager_api_new/test/user_role_test.dart b/manager_api_new/test/user_role_test.dart new file mode 100644 index 0000000..941a9dd --- /dev/null +++ b/manager_api_new/test/user_role_test.dart @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for UserRole +void main() { + group('test UserRole', () {}); +}