diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 5e6e6f4..3255622 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,9 @@ + _apiClient; + + TokenApi _tokenApi; + TokenApi get tokenApi => _tokenApi; + + AuthenticationApi _authenticationApi; + AuthenticationApi get authenticationApi => _authenticationApi; + + UserApi _userApi; + UserApi get userApi => _userApi; + + ValuesApi _valuesApi; + ValuesApi get valuesApi => _valuesApi; + + Client() { + _apiClient = ApiClient( + basePath: "http://192.168.31.140"); + //basePath: "http://localhost:25049"); + _tokenApi = TokenApi(_apiClient); + _authenticationApi = AuthenticationApi(_apiClient); + _userApi = UserApi(_apiClient); + _valuesApi = ValuesApi(_apiClient); + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 4af8f9c..21dc5ab 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,8 +1,8 @@ -import 'dart:io'; - import 'package:flutter/material.dart'; import 'package:mqtt_client/mqtt_client.dart'; import 'package:mqtt_client/mqtt_server_client.dart'; +import 'package:mycoreapi/api.dart'; +import 'package:myhomie_app/client.dart'; import 'constants.dart'; @@ -30,7 +30,7 @@ class MyApp extends StatefulWidget { } class _MyAppState extends State { - + @override Widget build(BuildContext context) { return MaterialApp( @@ -57,7 +57,6 @@ class _MyAppState extends State { class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); - final String title; @override @@ -66,32 +65,46 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { int _counter = 0; - //final MqttServerClient client = MqttServerClient.withPort('192.168.31.140', 'flutter_client00', 1883); - final MqttServerClient client = MqttServerClient.withPort('myhomie.be', 'flutter_client00', 1883); // TODO ONLINE + //final MqttServerClient client = MqttServerClient.withPort('192.168.31.140', 'flutter_client', 1883); // TODO Add switch button or check online connexion if local broker available + //final MqttServerClient client = MqttServerClient.withPort('myhomie.be', 'flutter_client00', 1883); // TODO ONLINE + final clientAPI = Client(); void _incrementCounter() { setState(() { _counter++; - - print("client.connectionStatus !!! ==" + client.connectionStatus.toString()); + + /*print("client.connectionStatus !!! ==" + client.connectionStatus.toString()); if (client.connectionStatus.state == MqttConnectionState.connected) { const pubTopic = 'topic/test'; final builder = MqttClientPayloadBuilder(); builder.addString('Hello MQTT'); client.publishMessage(pubTopic, MqttQos.atLeastOnce, builder.payload); - } + }*/ }); } + void authenticateTRY() async { + print("try auth.. "); + LoginDTO loginDTO = new LoginDTO(email: "test", password: "test"); + LoginDTO user = await clientAPI.authenticationApi.authenticationAuthenticateWithJson(loginDTO); + print("USER ??"); + print(user); + // TODO Call authenticationAuthenticateWithJson to retrieve token and set apiclient bearer token with the result + + /*var user2 = await clientAPI.userApi.userGet2("604a33639b4a377a413045b9"); + print("user2 values ??"); + print(user2.email);*/ + } + // connection succeeded void onConnected() { print('Connected !!!!!!!!!!!! ----------------------------------'); - client.updates.listen((List> c) { + /*client.updates.listen((List> c) { final MqttPublishMessage message = c[0].payload; final payload = MqttPublishPayload.bytesToStringAsString(message.payload.message); print('Received message:$payload from topic: ${c[0].topic}>'); - }); + });*/ } // unconnected @@ -115,11 +128,11 @@ class _MyHomePageState extends State { } Future connect() async { - client.logging(on: false); + /*client.logging(on: false); client.keepAlivePeriod = 20; client.onDisconnected = onDisconnected; client.onConnected = onConnected; - client.onSubscribed = onSubscribed; + client.onSubscribed = onSubscribed;*/ /// Security context /*SecurityContext context = new SecurityContext() @@ -139,7 +152,7 @@ class _MyHomePageState extends State { .startClean(); //.withWillQos(MqttQos.atLeastOnce); //client.secure = true; - client.connectionMessage = connMessage; + /*client.connectionMessage = connMessage; client.autoReconnect = true; try { await client.connect(); @@ -149,8 +162,9 @@ class _MyHomePageState extends State { } client.subscribe("#", MqttQos.atLeastOnce); - - return client; +*/ + //return client; + return null; } @override @@ -175,7 +189,7 @@ class _MyHomePageState extends State { ), ), floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, + onPressed: authenticateTRY, tooltip: 'Increment', child: Icon(Icons.add), ), diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index d38195a..e71a16d 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #include "generated_plugin_registrant.h" diff --git a/linux/flutter/generated_plugin_registrant.h b/linux/flutter/generated_plugin_registrant.h index 9bf7478..e0f0a47 100644 --- a/linux/flutter/generated_plugin_registrant.h +++ b/linux/flutter/generated_plugin_registrant.h @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index cccf817..cf98146 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + import FlutterMacOS import Foundation diff --git a/mycore_api/.gitignore b/mycore_api/.gitignore new file mode 100644 index 0000000..7c28044 --- /dev/null +++ b/mycore_api/.gitignore @@ -0,0 +1,27 @@ +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub +.buildlog +.packages +.project +.pub/ +build/ +**/packages/ + +# Files created by dart2js +# (Most Dart developers will use pub build to compile Dart, use/modify these +# rules if you intend to use dart2js directly +# Convention is to use extension '.dart.js' for Dart compiled to Javascript to +# differentiate from explicit Javascript files) +*.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + +# Directory created by dartdoc +doc/api/ + +# Don't commit pubspec lock file +# (Library packages only! Remove pattern if developing an application package) +pubspec.lock diff --git a/mycore_api/.openapi-generator-ignore b/mycore_api/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/mycore_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/mycore_api/.openapi-generator/FILES b/mycore_api/.openapi-generator/FILES new file mode 100644 index 0000000..abba30d --- /dev/null +++ b/mycore_api/.openapi-generator/FILES @@ -0,0 +1,237 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +doc/Action.md +doc/ActionType.md +doc/AuthenticationApi.md +doc/Automation.md +doc/AutomationApi.md +doc/AutomationCreateOrUpdateDetailDTO.md +doc/AutomationCreateOrUpdateDetailDTOAllOf.md +doc/AutomationDTO.md +doc/AutomationDetailDTO.md +doc/AutomationDetailDTOAllOf.md +doc/AzureADAuthModel.md +doc/AzureApi.md +doc/Book.md +doc/BooksApi.md +doc/Condition.md +doc/ConditionType.md +doc/ConditionValue.md +doc/ConnectionStatus.md +doc/Device.md +doc/DeviceApi.md +doc/DeviceDetailDTO.md +doc/DeviceDetailDTOAllOf.md +doc/DeviceSummaryDTO.md +doc/DeviceType.md +doc/ElectricityProduction.md +doc/EnergyApi.md +doc/FacebookApi.md +doc/FacebookAuthModel.md +doc/GoogleApi.md +doc/GoogleAuthModel.md +doc/Group.md +doc/GroupApi.md +doc/GroupCreateOrUpdateDetailDTO.md +doc/GroupCreateOrUpdateDetailDTOAllOf.md +doc/GroupDetailDTO.md +doc/GroupDetailDTOAllOf.md +doc/GroupSummaryDTO.md +doc/IOTApi.md +doc/LayoutApi.md +doc/LocationDTO.md +doc/LoginDTO.md +doc/MQTTApi.md +doc/MeansOfCommunication.md +doc/MqttMessageDTO.md +doc/OddApi.md +doc/OddH2H.md +doc/OddNice.md +doc/PanelMenuItem.md +doc/PanelSection.md +doc/Provider.md +doc/ProviderApi.md +doc/ProviderDTO.md +doc/RoomApi.md +doc/RoomCreateOrUpdateDetailDTO.md +doc/RoomDetailDTO.md +doc/RoomSummaryDTO.md +doc/ScreenConfiguration.md +doc/ScreenDevice.md +doc/ScreenDeviceApi.md +doc/SmartGardenMessage.md +doc/SmartPrinterMessage.md +doc/State.md +doc/TokenApi.md +doc/Trigger.md +doc/TriggerType.md +doc/TwitterApi.md +doc/TwitterAuthModel.md +doc/User.md +doc/UserApi.md +doc/UserInfo.md +doc/UserInfoDetailDTO.md +doc/ValuesApi.md +doc/ViewBy.md +doc/Widget.md +git_push.sh +lib/api.dart +lib/api/authentication_api.dart +lib/api/automation_api.dart +lib/api/azure_api.dart +lib/api/books_api.dart +lib/api/device_api.dart +lib/api/energy_api.dart +lib/api/facebook_api.dart +lib/api/google_api.dart +lib/api/group_api.dart +lib/api/iot_api.dart +lib/api/layout_api.dart +lib/api/mqtt_api.dart +lib/api/odd_api.dart +lib/api/provider_api.dart +lib/api/room_api.dart +lib/api/screen_device_api.dart +lib/api/token_api.dart +lib/api/twitter_api.dart +lib/api/user_api.dart +lib/api/values_api.dart +lib/api_client.dart +lib/api_exception.dart +lib/api_helper.dart +lib/auth/api_key_auth.dart +lib/auth/authentication.dart +lib/auth/http_basic_auth.dart +lib/auth/http_bearer_auth.dart +lib/auth/oauth.dart +lib/model/action.dart +lib/model/action_type.dart +lib/model/automation.dart +lib/model/automation_create_or_update_detail_dto.dart +lib/model/automation_create_or_update_detail_dto_all_of.dart +lib/model/automation_detail_dto.dart +lib/model/automation_detail_dto_all_of.dart +lib/model/automation_dto.dart +lib/model/azure_ad_auth_model.dart +lib/model/book.dart +lib/model/condition.dart +lib/model/condition_type.dart +lib/model/condition_value.dart +lib/model/connection_status.dart +lib/model/device.dart +lib/model/device_detail_dto.dart +lib/model/device_detail_dto_all_of.dart +lib/model/device_summary_dto.dart +lib/model/device_type.dart +lib/model/electricity_production.dart +lib/model/facebook_auth_model.dart +lib/model/google_auth_model.dart +lib/model/group.dart +lib/model/group_create_or_update_detail_dto.dart +lib/model/group_create_or_update_detail_dto_all_of.dart +lib/model/group_detail_dto.dart +lib/model/group_detail_dto_all_of.dart +lib/model/group_summary_dto.dart +lib/model/location_dto.dart +lib/model/login_dto.dart +lib/model/means_of_communication.dart +lib/model/mqtt_message_dto.dart +lib/model/odd_h2_h.dart +lib/model/odd_nice.dart +lib/model/panel_menu_item.dart +lib/model/panel_section.dart +lib/model/provider.dart +lib/model/provider_dto.dart +lib/model/room_create_or_update_detail_dto.dart +lib/model/room_detail_dto.dart +lib/model/room_summary_dto.dart +lib/model/screen_configuration.dart +lib/model/screen_device.dart +lib/model/smart_garden_message.dart +lib/model/smart_printer_message.dart +lib/model/state.dart +lib/model/trigger.dart +lib/model/trigger_type.dart +lib/model/twitter_auth_model.dart +lib/model/user.dart +lib/model/user_info.dart +lib/model/user_info_detail_dto.dart +lib/model/view_by.dart +lib/model/widget.dart +pubspec.yaml +test/action_test.dart +test/action_type_test.dart +test/authentication_api_test.dart +test/automation_api_test.dart +test/automation_create_or_update_detail_dto_all_of_test.dart +test/automation_create_or_update_detail_dto_test.dart +test/automation_detail_dto_all_of_test.dart +test/automation_detail_dto_test.dart +test/automation_dto_test.dart +test/automation_test.dart +test/azure_ad_auth_model_test.dart +test/azure_api_test.dart +test/book_test.dart +test/books_api_test.dart +test/condition_test.dart +test/condition_type_test.dart +test/condition_value_test.dart +test/connection_status_test.dart +test/device_api_test.dart +test/device_detail_dto_all_of_test.dart +test/device_detail_dto_test.dart +test/device_summary_dto_test.dart +test/device_test.dart +test/device_type_test.dart +test/electricity_production_test.dart +test/energy_api_test.dart +test/facebook_api_test.dart +test/facebook_auth_model_test.dart +test/google_api_test.dart +test/google_auth_model_test.dart +test/group_api_test.dart +test/group_create_or_update_detail_dto_all_of_test.dart +test/group_create_or_update_detail_dto_test.dart +test/group_detail_dto_all_of_test.dart +test/group_detail_dto_test.dart +test/group_summary_dto_test.dart +test/group_test.dart +test/iot_api_test.dart +test/layout_api_test.dart +test/location_dto_test.dart +test/login_dto_test.dart +test/means_of_communication_test.dart +test/mqtt_api_test.dart +test/mqtt_message_dto_test.dart +test/odd_api_test.dart +test/odd_h2_h_test.dart +test/odd_nice_test.dart +test/panel_menu_item_test.dart +test/panel_section_test.dart +test/provider_api_test.dart +test/provider_dto_test.dart +test/provider_test.dart +test/room_api_test.dart +test/room_create_or_update_detail_dto_test.dart +test/room_detail_dto_test.dart +test/room_summary_dto_test.dart +test/screen_configuration_test.dart +test/screen_device_api_test.dart +test/screen_device_test.dart +test/smart_garden_message_test.dart +test/smart_printer_message_test.dart +test/state_test.dart +test/token_api_test.dart +test/trigger_test.dart +test/trigger_type_test.dart +test/twitter_api_test.dart +test/twitter_auth_model_test.dart +test/user_api_test.dart +test/user_info_detail_dto_test.dart +test/user_info_test.dart +test/user_test.dart +test/values_api_test.dart +test/view_by_test.dart +test/widget_test.dart diff --git a/mycore_api/.openapi-generator/VERSION b/mycore_api/.openapi-generator/VERSION new file mode 100644 index 0000000..acf69b4 --- /dev/null +++ b/mycore_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.1.0 \ No newline at end of file diff --git a/mycore_api/.travis.yml b/mycore_api/.travis.yml new file mode 100644 index 0000000..1a3af66 --- /dev/null +++ b/mycore_api/.travis.yml @@ -0,0 +1,14 @@ +# +# AUTO-GENERATED FILE, DO NOT MODIFY! +# +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.2.0" +install: +- pub get + +script: +- pub run test diff --git a/mycore_api/README.md b/mycore_api/README.md new file mode 100644 index 0000000..220e744 --- /dev/null +++ b/mycore_api/README.md @@ -0,0 +1,217 @@ +# mycoreapi +API description + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: Version Pre-Alpha +- Build package: org.openapitools.codegen.languages.DartClientCodegen + +## Requirements + +Dart 2.0 or later + +## Installation & Usage + +### Github +If this Dart package is published to Github, add the following dependency to your pubspec.yaml +``` +dependencies: + mycoreapi: + git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` + +### Local +To use the package in your local drive, add the following dependency to your pubspec.yaml +``` +dependencies: + mycoreapi: + path: /path/to/mycoreapi +``` + +## Tests + +TODO + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:mycoreapi/api.dart'; + +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AuthenticationApi(); +final grantType = grantType_example; // String | +final username = username_example; // String | +final password = password_example; // String | +final clientId = clientId_example; // String | +final clientSecret = clientSecret_example; // String | + +try { + final result = api_instance.authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret); + print(result); +} catch (e) { + print('Exception when calling AuthenticationApi->authenticationAuthenticateWithForm: $e\n'); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://192.168.31.140* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AuthenticationApi* | [**authenticationAuthenticateWithForm**](doc\/AuthenticationApi.md#authenticationauthenticatewithform) | **POST** /api/Authentication/Token | Authenticate with form parameters (used by Swagger test client) +*AuthenticationApi* | [**authenticationAuthenticateWithJson**](doc\/AuthenticationApi.md#authenticationauthenticatewithjson) | **POST** /api/Authentication/Authenticate | Authenticate with Json parameters (used by most clients) +*AutomationApi* | [**automationCreate**](doc\/AutomationApi.md#automationcreate) | **POST** /api/automation | +*AutomationApi* | [**automationDelete**](doc\/AutomationApi.md#automationdelete) | **DELETE** /api/automation/{automationId} | Delete an automation +*AutomationApi* | [**automationDeleteAllForUser**](doc\/AutomationApi.md#automationdeleteallforuser) | **DELETE** /api/automation/user/{userId} | Delete all automation for a specified +*AutomationApi* | [**automationGetAll**](doc\/AutomationApi.md#automationgetall) | **GET** /api/automation/{userId} | Get all automations for the specified user +*AutomationApi* | [**automationGetDetail**](doc\/AutomationApi.md#automationgetdetail) | **GET** /api/automation/detail/{automationId} | Get detail info of a specified automation +*AutomationApi* | [**automationUpdate**](doc\/AutomationApi.md#automationupdate) | **PUT** /api/automation | Update an automation +*AzureApi* | [**azureCreate**](doc\/AzureApi.md#azurecreate) | **POST** /azure | +*BooksApi* | [**booksCreate**](doc\/BooksApi.md#bookscreate) | **POST** /api/books | +*BooksApi* | [**booksDelete**](doc\/BooksApi.md#booksdelete) | **DELETE** /api/books/{id} | +*BooksApi* | [**booksGet**](doc\/BooksApi.md#booksget) | **GET** /api/books/{id} | +*BooksApi* | [**booksGetAll**](doc\/BooksApi.md#booksgetall) | **GET** /api/books | +*BooksApi* | [**booksUpdate**](doc\/BooksApi.md#booksupdate) | **PUT** /api/books/{id} | +*DeviceApi* | [**deviceCreate**](doc\/DeviceApi.md#devicecreate) | **POST** /api/device | Create a device +*DeviceApi* | [**deviceCreateDevicesFromProvider**](doc\/DeviceApi.md#devicecreatedevicesfromprovider) | **POST** /api/device/{userId}/fromProvider/{providerId} | Create devices from provider +*DeviceApi* | [**deviceDelete**](doc\/DeviceApi.md#devicedelete) | **DELETE** /api/device/{deviceId} | Delete a device +*DeviceApi* | [**deviceDeleteAllForUser**](doc\/DeviceApi.md#devicedeleteallforuser) | **DELETE** /api/device/user/{userId} | Delete all device for a specified +*DeviceApi* | [**deviceDeleteDevicesFromProvider**](doc\/DeviceApi.md#devicedeletedevicesfromprovider) | **DELETE** /api/device/{userId}/fromProvider/{providerId} | Delete devices from provider +*DeviceApi* | [**deviceGetAll**](doc\/DeviceApi.md#devicegetall) | **GET** /api/device/{userId} | Get all devices summary +*DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/device/detail/{deviceId} | Get a specific device info +*DeviceApi* | [**deviceGetDevicesByType**](doc\/DeviceApi.md#devicegetdevicesbytype) | **GET** /api/device/{userId}/type/{type} | Get list of devices from a type +*DeviceApi* | [**deviceGetDevicesFromProvider**](doc\/DeviceApi.md#devicegetdevicesfromprovider) | **GET** /api/device/{userId}/fromProvider/{providerId} | Get devices from provider +*DeviceApi* | [**deviceGetDevicesFromZigbee2Mqtt**](doc\/DeviceApi.md#devicegetdevicesfromzigbee2mqtt) | **GET** /api/device/zigbee2Mqtt/{userId} | Get all zigbee2Mqtt devices +*DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/device/{deviceId} | Update a device +*EnergyApi* | [**energyGetElectricityProduction**](doc\/EnergyApi.md#energygetelectricityproduction) | **GET** /api/energy/electricity | Get summary production of Kwh/Year +*FacebookApi* | [**facebookCreate**](doc\/FacebookApi.md#facebookcreate) | **POST** /facebook | +*GoogleApi* | [**googleCreate**](doc\/GoogleApi.md#googlecreate) | **POST** /google | +*GroupApi* | [**groupCreate**](doc\/GroupApi.md#groupcreate) | **POST** /api/group | Create a group +*GroupApi* | [**groupCreateDevicesFromZigbee2Mqtt**](doc\/GroupApi.md#groupcreatedevicesfromzigbee2mqtt) | **POST** /api/group/{userId}/fromZigbee | Create groups from provider +*GroupApi* | [**groupDelete**](doc\/GroupApi.md#groupdelete) | **DELETE** /api/group/{groupId}/device/{deviceId} | Delete device from a group +*GroupApi* | [**groupDelete2**](doc\/GroupApi.md#groupdelete2) | **DELETE** /api/group/{groupId} | Delete a group +*GroupApi* | [**groupDeleteAllForUser**](doc\/GroupApi.md#groupdeleteallforuser) | **DELETE** /api/group/user/{userId} | Delete all group for a specified +*GroupApi* | [**groupGetAll**](doc\/GroupApi.md#groupgetall) | **GET** /api/group/{userId} | Get all groups for the specified user +*GroupApi* | [**groupGetDetail**](doc\/GroupApi.md#groupgetdetail) | **GET** /api/group/detail/{groupId} | Get detail info of a specified group +*GroupApi* | [**groupGetGroupsByType**](doc\/GroupApi.md#groupgetgroupsbytype) | **GET** /api/group/{userId}/type/{type} | Get list of group from a type +*GroupApi* | [**groupGetGroupsFromZigbee2Mqtt**](doc\/GroupApi.md#groupgetgroupsfromzigbee2mqtt) | **GET** /api/group/zigbee2Mqtt/{userId} | Get all zigbee2Mqtt groups +*GroupApi* | [**groupUpdate**](doc\/GroupApi.md#groupupdate) | **PUT** /api/group | Update a group +*IOTApi* | [**iOTGetSmartPrinterMessages**](doc\/IOTApi.md#iotgetsmartprintermessages) | **GET** /api/iot/smartprinter/{idDevice} | Retrieve all SmartPrinterMessage +*IOTApi* | [**iOTPostToDBPrinter**](doc\/IOTApi.md#iotposttodbprinter) | **POST** /api/iot/smartprinter/{idDevice} | It's the method to post data from mqtt broker to Database (Thanks Rpi!) +*IOTApi* | [**iOTPostToDBSmartGarden**](doc\/IOTApi.md#iotposttodbsmartgarden) | **POST** /api/iot/smartgarden/{idDevice} | It's the method to post data from mqtt broker to Database (Thanks Rpi!) +*LayoutApi* | [**layoutGet**](doc\/LayoutApi.md#layoutget) | **GET** /api/layout/panelSection | It's a test ! :) +*MQTTApi* | [**mQTTPublishMessage**](doc\/MQTTApi.md#mqttpublishmessage) | **POST** /api/mqtt | Publish mqtt test +*OddApi* | [**oddGetAll**](doc\/OddApi.md#oddgetall) | **GET** /api/odd/{oddRequest} | Get odds for one country and one odd value maximum +*OddApi* | [**oddGetForCountry**](doc\/OddApi.md#oddgetforcountry) | **GET** /api/odd/country/{id}/{oddRequest} | Get odds for one country and one odd value maximum +*ProviderApi* | [**providerCreate**](doc\/ProviderApi.md#providercreate) | **POST** /api/provider | Create a provider +*ProviderApi* | [**providerDelete**](doc\/ProviderApi.md#providerdelete) | **DELETE** /api/provider/{providerId} | Delete a provider +*ProviderApi* | [**providerGetAll**](doc\/ProviderApi.md#providergetall) | **GET** /api/provider/{userId} | Get all user providers +*ProviderApi* | [**providerUpdate**](doc\/ProviderApi.md#providerupdate) | **PUT** /api/provider | Update a provider +*RoomApi* | [**roomCreate**](doc\/RoomApi.md#roomcreate) | **POST** /api/room | Create a room +*RoomApi* | [**roomDelete**](doc\/RoomApi.md#roomdelete) | **DELETE** /api/room/{roomId}/device/{deviceId} | Delete device from a room +*RoomApi* | [**roomDelete2**](doc\/RoomApi.md#roomdelete2) | **DELETE** /api/room/{roomId} | Delete a room +*RoomApi* | [**roomDeleteAllForUser**](doc\/RoomApi.md#roomdeleteallforuser) | **DELETE** /api/room/user/{userId} | Delete all room for a specified +*RoomApi* | [**roomGetAll**](doc\/RoomApi.md#roomgetall) | **GET** /api/room/{userId} | Get all rooms for the specified user +*RoomApi* | [**roomGetDetail**](doc\/RoomApi.md#roomgetdetail) | **GET** /api/room/detail/{roomId} | Get detail info of a specified room +*RoomApi* | [**roomUpdate**](doc\/RoomApi.md#roomupdate) | **PUT** /api/room | Update a room +*ScreenDeviceApi* | [**screenDeviceCreateDevice**](doc\/ScreenDeviceApi.md#screendevicecreatedevice) | **POST** /api/device/screen | +*ScreenDeviceApi* | [**screenDeviceDeleteDevice**](doc\/ScreenDeviceApi.md#screendevicedeletedevice) | **DELETE** /api/device/screen/{deviceId} | +*ScreenDeviceApi* | [**screenDeviceGetAllScreenDevices**](doc\/ScreenDeviceApi.md#screendevicegetallscreendevices) | **GET** /api/device/screen | +*ScreenDeviceApi* | [**screenDeviceGetDeviceInfo**](doc\/ScreenDeviceApi.md#screendevicegetdeviceinfo) | **GET** /api/device/screen/{screenDeviceId} | +*ScreenDeviceApi* | [**screenDeviceUpdateDevice**](doc\/ScreenDeviceApi.md#screendeviceupdatedevice) | **PUT** /api/device/screen/{screenDeviceId} | +*TokenApi* | [**tokenConnectUser**](doc\/TokenApi.md#tokenconnectuser) | **POST** /api/token | +*TokenApi* | [**tokenCreate**](doc\/TokenApi.md#tokencreate) | **POST** /token | +*TwitterApi* | [**twitterCreate**](doc\/TwitterApi.md#twittercreate) | **POST** /twitter | +*UserApi* | [**userCreateUser**](doc\/UserApi.md#usercreateuser) | **POST** /api/user | +*UserApi* | [**userDeleteUser**](doc\/UserApi.md#userdeleteuser) | **DELETE** /api/user/{id} | +*UserApi* | [**userGet**](doc\/UserApi.md#userget) | **GET** /api/user | Get a list of user +*UserApi* | [**userGet2**](doc\/UserApi.md#userget2) | **GET** /api/user/{id} | Get a specific user +*UserApi* | [**userUpdateUser**](doc\/UserApi.md#userupdateuser) | **PUT** /api/user | +*ValuesApi* | [**valuesDelete**](doc\/ValuesApi.md#valuesdelete) | **DELETE** /api/test/{id} | +*ValuesApi* | [**valuesGet**](doc\/ValuesApi.md#valuesget) | **GET** /api/test/{id} | +*ValuesApi* | [**valuesGetAll**](doc\/ValuesApi.md#valuesgetall) | **GET** /api/test | It's a test ! :) +*ValuesApi* | [**valuesPost**](doc\/ValuesApi.md#valuespost) | **POST** /api/test | +*ValuesApi* | [**valuesPut**](doc\/ValuesApi.md#valuesput) | **PUT** /api/test/{id} | + + +## Documentation For Models + + - [Action](doc\/Action.md) + - [ActionType](doc\/ActionType.md) + - [Automation](doc\/Automation.md) + - [AutomationCreateOrUpdateDetailDTO](doc\/AutomationCreateOrUpdateDetailDTO.md) + - [AutomationCreateOrUpdateDetailDTOAllOf](doc\/AutomationCreateOrUpdateDetailDTOAllOf.md) + - [AutomationDTO](doc\/AutomationDTO.md) + - [AutomationDetailDTO](doc\/AutomationDetailDTO.md) + - [AutomationDetailDTOAllOf](doc\/AutomationDetailDTOAllOf.md) + - [AzureADAuthModel](doc\/AzureADAuthModel.md) + - [Book](doc\/Book.md) + - [Condition](doc\/Condition.md) + - [ConditionType](doc\/ConditionType.md) + - [ConditionValue](doc\/ConditionValue.md) + - [ConnectionStatus](doc\/ConnectionStatus.md) + - [Device](doc\/Device.md) + - [DeviceDetailDTO](doc\/DeviceDetailDTO.md) + - [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md) + - [DeviceSummaryDTO](doc\/DeviceSummaryDTO.md) + - [DeviceType](doc\/DeviceType.md) + - [ElectricityProduction](doc\/ElectricityProduction.md) + - [FacebookAuthModel](doc\/FacebookAuthModel.md) + - [GoogleAuthModel](doc\/GoogleAuthModel.md) + - [Group](doc\/Group.md) + - [GroupCreateOrUpdateDetailDTO](doc\/GroupCreateOrUpdateDetailDTO.md) + - [GroupCreateOrUpdateDetailDTOAllOf](doc\/GroupCreateOrUpdateDetailDTOAllOf.md) + - [GroupDetailDTO](doc\/GroupDetailDTO.md) + - [GroupDetailDTOAllOf](doc\/GroupDetailDTOAllOf.md) + - [GroupSummaryDTO](doc\/GroupSummaryDTO.md) + - [LocationDTO](doc\/LocationDTO.md) + - [LoginDTO](doc\/LoginDTO.md) + - [MeansOfCommunication](doc\/MeansOfCommunication.md) + - [MqttMessageDTO](doc\/MqttMessageDTO.md) + - [OddH2H](doc\/OddH2H.md) + - [OddNice](doc\/OddNice.md) + - [PanelMenuItem](doc\/PanelMenuItem.md) + - [PanelSection](doc\/PanelSection.md) + - [Provider](doc\/Provider.md) + - [ProviderDTO](doc\/ProviderDTO.md) + - [RoomCreateOrUpdateDetailDTO](doc\/RoomCreateOrUpdateDetailDTO.md) + - [RoomDetailDTO](doc\/RoomDetailDTO.md) + - [RoomSummaryDTO](doc\/RoomSummaryDTO.md) + - [ScreenConfiguration](doc\/ScreenConfiguration.md) + - [ScreenDevice](doc\/ScreenDevice.md) + - [SmartGardenMessage](doc\/SmartGardenMessage.md) + - [SmartPrinterMessage](doc\/SmartPrinterMessage.md) + - [State](doc\/State.md) + - [Trigger](doc\/Trigger.md) + - [TriggerType](doc\/TriggerType.md) + - [TwitterAuthModel](doc\/TwitterAuthModel.md) + - [User](doc\/User.md) + - [UserInfo](doc\/UserInfo.md) + - [UserInfoDetailDTO](doc\/UserInfoDetailDTO.md) + - [ViewBy](doc\/ViewBy.md) + - [Widget](doc\/Widget.md) + + +## Documentation For Authorization + + +## bearer + +- **Type**: OAuth +- **Flow**: password +- **Authorization URL**: /authentication/Token +- **Scopes**: + - **MyCore-api**: MyCore WebAPI + + +## Author + + + + diff --git a/mycore_api/doc/Action.md b/mycore_api/doc/Action.md new file mode 100644 index 0000000..cccb51a --- /dev/null +++ b/mycore_api/doc/Action.md @@ -0,0 +1,20 @@ +# mycoreapi.model.Action + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**groupId** | **String** | | [optional] +**deviceId** | **String** | | [optional] +**states** | [**List**](State.md) | | [optional] [default to const []] +**rawRequest** | **String** | | [optional] +**providerId** | **String** | | [optional] +**type** | [**ActionType**](ActionType.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/mycore_api/doc/ActionType.md b/mycore_api/doc/ActionType.md new file mode 100644 index 0000000..0529e1a --- /dev/null +++ b/mycore_api/doc/ActionType.md @@ -0,0 +1,14 @@ +# mycoreapi.model.ActionType + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api/doc/AuthenticationApi.md b/mycore_api/doc/AuthenticationApi.md new file mode 100644 index 0000000..19d7b68 --- /dev/null +++ b/mycore_api/doc/AuthenticationApi.md @@ -0,0 +1,109 @@ +# mycoreapi.api.AuthenticationApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**authenticationAuthenticateWithForm**](AuthenticationApi.md#authenticationauthenticatewithform) | **POST** /api/Authentication/Token | Authenticate with form parameters (used by Swagger test client) +[**authenticationAuthenticateWithJson**](AuthenticationApi.md#authenticationauthenticatewithjson) | **POST** /api/Authentication/Authenticate | Authenticate with Json parameters (used by most clients) + + +# **authenticationAuthenticateWithForm** +> LoginDTO authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret) + +Authenticate with form parameters (used by Swagger test client) + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AuthenticationApi(); +final grantType = grantType_example; // String | +final username = username_example; // String | +final password = password_example; // String | +final clientId = clientId_example; // String | +final clientSecret = clientSecret_example; // String | + +try { + final result = api_instance.authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret); + print(result); +} catch (e) { + print('Exception when calling AuthenticationApi->authenticationAuthenticateWithForm: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **grantType** | **String**| | [optional] + **username** | **String**| | [optional] + **password** | **String**| | [optional] + **clientId** | **String**| | [optional] + **clientSecret** | **String**| | [optional] + +### Return type + +[**LoginDTO**](LoginDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **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) + +# **authenticationAuthenticateWithJson** +> LoginDTO authenticationAuthenticateWithJson(loginDTO) + +Authenticate with Json parameters (used by most clients) + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AuthenticationApi(); +final loginDTO = LoginDTO(); // LoginDTO | Login DTO + +try { + final result = api_instance.authenticationAuthenticateWithJson(loginDTO); + print(result); +} catch (e) { + print('Exception when calling AuthenticationApi->authenticationAuthenticateWithJson: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loginDTO** | [**LoginDTO**](LoginDTO.md)| Login DTO | + +### Return type + +[**LoginDTO**](LoginDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + diff --git a/mycore_api/doc/Automation.md b/mycore_api/doc/Automation.md new file mode 100644 index 0000000..7f21f61 --- /dev/null +++ b/mycore_api/doc/Automation.md @@ -0,0 +1,23 @@ +# mycoreapi.model.Automation + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**name** | **String** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**conditions** | [**List**](Condition.md) | | [optional] [default to const []] +**actions** | [**List**](Action.md) | | [optional] [default to const []] +**devicesIds** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/AutomationApi.md b/mycore_api/doc/AutomationApi.md new file mode 100644 index 0000000..222ff90 --- /dev/null +++ b/mycore_api/doc/AutomationApi.md @@ -0,0 +1,277 @@ +# mycoreapi.api.AutomationApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**automationCreate**](AutomationApi.md#automationcreate) | **POST** /api/automation | +[**automationDelete**](AutomationApi.md#automationdelete) | **DELETE** /api/automation/{automationId} | Delete an automation +[**automationDeleteAllForUser**](AutomationApi.md#automationdeleteallforuser) | **DELETE** /api/automation/user/{userId} | Delete all automation for a specified +[**automationGetAll**](AutomationApi.md#automationgetall) | **GET** /api/automation/{userId} | Get all automations for the specified user +[**automationGetDetail**](AutomationApi.md#automationgetdetail) | **GET** /api/automation/detail/{automationId} | Get detail info of a specified automation +[**automationUpdate**](AutomationApi.md#automationupdate) | **PUT** /api/automation | Update an automation + + +# **automationCreate** +> AutomationDTO automationCreate(automationCreateOrUpdateDetailDTO) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final automationCreateOrUpdateDetailDTO = AutomationCreateOrUpdateDetailDTO(); // AutomationCreateOrUpdateDetailDTO | + +try { + final result = api_instance.automationCreate(automationCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **automationCreateOrUpdateDetailDTO** | [**AutomationCreateOrUpdateDetailDTO**](AutomationCreateOrUpdateDetailDTO.md)| | + +### Return type + +[**AutomationDTO**](AutomationDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **automationDelete** +> MultipartFile automationDelete(automationId) + +Delete an automation + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final automationId = automationId_example; // String | Id of automation to delete + +try { + final result = api_instance.automationDelete(automationId); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **automationId** | **String**| Id of automation to delete | + +### 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) + +# **automationDeleteAllForUser** +> MultipartFile automationDeleteAllForUser(userId) + +Delete all automation for a specified + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final userId = userId_example; // String | Id of user + +try { + final result = api_instance.automationDeleteAllForUser(userId); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationDeleteAllForUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| Id of user | + +### 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) + +# **automationGetAll** +> List automationGetAll(userId) + +Get all automations for the specified user + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final userId = userId_example; // String | Id of user + +try { + final result = api_instance.automationGetAll(userId); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| Id of user | + +### Return type + +[**List**](RoomSummaryDTO.md) + +### Authorization + +[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) + +# **automationGetDetail** +> AutomationDetailDTO automationGetDetail(automationId) + +Get detail info of a specified automation + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final automationId = automationId_example; // String | automation id + +try { + final result = api_instance.automationGetDetail(automationId); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **automationId** | **String**| automation id | + +### Return type + +[**AutomationDetailDTO**](AutomationDetailDTO.md) + +### Authorization + +[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) + +# **automationUpdate** +> AutomationCreateOrUpdateDetailDTO automationUpdate(automationCreateOrUpdateDetailDTO) + +Update an automation + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AutomationApi(); +final automationCreateOrUpdateDetailDTO = AutomationCreateOrUpdateDetailDTO(); // AutomationCreateOrUpdateDetailDTO | automation to update + +try { + final result = api_instance.automationUpdate(automationCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling AutomationApi->automationUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **automationCreateOrUpdateDetailDTO** | [**AutomationCreateOrUpdateDetailDTO**](AutomationCreateOrUpdateDetailDTO.md)| automation to update | + +### Return type + +[**AutomationCreateOrUpdateDetailDTO**](AutomationCreateOrUpdateDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + diff --git a/mycore_api/doc/AutomationCreateOrUpdateDetailDTO.md b/mycore_api/doc/AutomationCreateOrUpdateDetailDTO.md new file mode 100644 index 0000000..0914263 --- /dev/null +++ b/mycore_api/doc/AutomationCreateOrUpdateDetailDTO.md @@ -0,0 +1,23 @@ +# mycoreapi.model.AutomationCreateOrUpdateDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**userId** | **String** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**conditions** | [**List**](Condition.md) | | [optional] [default to const []] +**actions** | [**List**](Action.md) | | [optional] [default to const []] +**deviceIds** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/AutomationCreateOrUpdateDetailDTOAllOf.md b/mycore_api/doc/AutomationCreateOrUpdateDetailDTOAllOf.md new file mode 100644 index 0000000..be4fefd --- /dev/null +++ b/mycore_api/doc/AutomationCreateOrUpdateDetailDTOAllOf.md @@ -0,0 +1,18 @@ +# mycoreapi.model.AutomationCreateOrUpdateDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**conditions** | [**List**](Condition.md) | | [optional] [default to const []] +**actions** | [**List**](Action.md) | | [optional] [default to const []] +**deviceIds** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/AutomationDTO.md b/mycore_api/doc/AutomationDTO.md new file mode 100644 index 0000000..c1af32f --- /dev/null +++ b/mycore_api/doc/AutomationDTO.md @@ -0,0 +1,19 @@ +# mycoreapi.model.AutomationDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**userId** | **String** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.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/mycore_api/doc/AutomationDetailDTO.md b/mycore_api/doc/AutomationDetailDTO.md new file mode 100644 index 0000000..f5aedde --- /dev/null +++ b/mycore_api/doc/AutomationDetailDTO.md @@ -0,0 +1,23 @@ +# mycoreapi.model.AutomationDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**userId** | **String** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**conditions** | [**List**](Condition.md) | | [optional] [default to const []] +**actions** | [**List**](Action.md) | | [optional] [default to const []] +**devicesIds** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/AutomationDetailDTOAllOf.md b/mycore_api/doc/AutomationDetailDTOAllOf.md new file mode 100644 index 0000000..1a10d67 --- /dev/null +++ b/mycore_api/doc/AutomationDetailDTOAllOf.md @@ -0,0 +1,18 @@ +# mycoreapi.model.AutomationDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triggers** | [**List**](Trigger.md) | | [optional] [default to const []] +**conditions** | [**List**](Condition.md) | | [optional] [default to const []] +**actions** | [**List**](Action.md) | | [optional] [default to const []] +**devicesIds** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/AzureADAuthModel.md b/mycore_api/doc/AzureADAuthModel.md new file mode 100644 index 0000000..76da060 --- /dev/null +++ b/mycore_api/doc/AzureADAuthModel.md @@ -0,0 +1,15 @@ +# mycoreapi.model.AzureADAuthModel + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apiKey** | **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/mycore_api/doc/AzureApi.md b/mycore_api/doc/AzureApi.md new file mode 100644 index 0000000..53812e2 --- /dev/null +++ b/mycore_api/doc/AzureApi.md @@ -0,0 +1,57 @@ +# mycoreapi.api.AzureApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**azureCreate**](AzureApi.md#azurecreate) | **POST** /azure | + + +# **azureCreate** +> MultipartFile azureCreate(azureADAuthModel) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = AzureApi(); +final azureADAuthModel = AzureADAuthModel(); // AzureADAuthModel | + +try { + final result = api_instance.azureCreate(azureADAuthModel); + print(result); +} catch (e) { + print('Exception when calling AzureApi->azureCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **azureADAuthModel** | [**AzureADAuthModel**](AzureADAuthModel.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) + diff --git a/mycore_api/doc/Book.md b/mycore_api/doc/Book.md new file mode 100644 index 0000000..4e3d95f --- /dev/null +++ b/mycore_api/doc/Book.md @@ -0,0 +1,19 @@ +# mycoreapi.model.Book + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**bookName** | **String** | | [optional] +**price** | **num** | | [optional] +**category** | **String** | | [optional] +**author** | **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/mycore_api/doc/BooksApi.md b/mycore_api/doc/BooksApi.md new file mode 100644 index 0000000..f3af77f --- /dev/null +++ b/mycore_api/doc/BooksApi.md @@ -0,0 +1,231 @@ +# mycoreapi.api.BooksApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**booksCreate**](BooksApi.md#bookscreate) | **POST** /api/books | +[**booksDelete**](BooksApi.md#booksdelete) | **DELETE** /api/books/{id} | +[**booksGet**](BooksApi.md#booksget) | **GET** /api/books/{id} | +[**booksGetAll**](BooksApi.md#booksgetall) | **GET** /api/books | +[**booksUpdate**](BooksApi.md#booksupdate) | **PUT** /api/books/{id} | + + +# **booksCreate** +> Book booksCreate(book) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = BooksApi(); +final book = Book(); // Book | + +try { + final result = api_instance.booksCreate(book); + print(result); +} catch (e) { + print('Exception when calling BooksApi->booksCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **book** | [**Book**](Book.md)| | + +### Return type + +[**Book**](Book.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **booksDelete** +> MultipartFile booksDelete(id) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = BooksApi(); +final id = id_example; // String | + +try { + final result = api_instance.booksDelete(id); + print(result); +} catch (e) { + print('Exception when calling BooksApi->booksDelete: $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) + +# **booksGet** +> Book booksGet(id) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = BooksApi(); +final id = id_example; // String | + +try { + final result = api_instance.booksGet(id); + print(result); +} catch (e) { + print('Exception when calling BooksApi->booksGet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**Book**](Book.md) + +### Authorization + +[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) + +# **booksGetAll** +> List booksGetAll() + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = BooksApi(); + +try { + final result = api_instance.booksGetAll(); + print(result); +} catch (e) { + print('Exception when calling BooksApi->booksGetAll: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](Book.md) + +### Authorization + +[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) + +# **booksUpdate** +> MultipartFile booksUpdate(id, book) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = BooksApi(); +final id = id_example; // String | +final book = Book(); // Book | + +try { + final result = api_instance.booksUpdate(id, book); + print(result); +} catch (e) { + print('Exception when calling BooksApi->booksUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + **book** | [**Book**](Book.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) + diff --git a/mycore_api/doc/Condition.md b/mycore_api/doc/Condition.md new file mode 100644 index 0000000..0d14c7a --- /dev/null +++ b/mycore_api/doc/Condition.md @@ -0,0 +1,20 @@ +# mycoreapi.model.Condition + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deviceId** | **String** | | [optional] +**state** | [**OneOfState**](OneOfState.md) | | [optional] +**startTime** | **String** | | [optional] +**endTime** | **String** | | [optional] +**type** | [**ConditionType**](ConditionType.md) | | [optional] +**value** | [**ConditionValue**](ConditionValue.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/mycore_api/doc/ConditionType.md b/mycore_api/doc/ConditionType.md new file mode 100644 index 0000000..0ab4c5f --- /dev/null +++ b/mycore_api/doc/ConditionType.md @@ -0,0 +1,14 @@ +# mycoreapi.model.ConditionType + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api/doc/ConditionValue.md b/mycore_api/doc/ConditionValue.md new file mode 100644 index 0000000..a557e0c --- /dev/null +++ b/mycore_api/doc/ConditionValue.md @@ -0,0 +1,14 @@ +# mycoreapi.model.ConditionValue + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api/doc/ConnectionStatus.md b/mycore_api/doc/ConnectionStatus.md new file mode 100644 index 0000000..7c1e861 --- /dev/null +++ b/mycore_api/doc/ConnectionStatus.md @@ -0,0 +1,14 @@ +# mycoreapi.model.ConnectionStatus + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api/doc/Device.md b/mycore_api/doc/Device.md new file mode 100644 index 0000000..fe66fbb --- /dev/null +++ b/mycore_api/doc/Device.md @@ -0,0 +1,40 @@ +# mycoreapi.model.Device + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**name** | **String** | | [optional] +**description** | **String** | | [optional] +**model** | **String** | | [optional] +**port** | **int** | | [optional] +**firmwareVersion** | **String** | | [optional] +**hardwareVersion** | **String** | | [optional] +**status** | **bool** | | [optional] +**type** | [**DeviceType**](DeviceType.md) | | [optional] +**connectionStatus** | [**ConnectionStatus**](ConnectionStatus.md) | | [optional] +**locationId** | **String** | | [optional] +**meansOfCommunications** | [**List**](MeansOfCommunication.md) | | [optional] [default to const []] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**lastState** | **String** | | [optional] +**lastStateDate** | [**DateTime**](DateTime.md) | | [optional] +**ipAddress** | **String** | | [optional] +**serviceIdentification** | **String** | | [optional] +**battery** | **bool** | | [optional] +**batteryStatus** | **int** | | [optional] +**providerId** | **String** | | [optional] +**manufacturerName** | **String** | | [optional] +**groupIds** | **List** | | [optional] [default to const []] +**properties** | [**Map**](Object.md) | | [optional] [default to const {}] +**supportedOperations** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/DeviceApi.md b/mycore_api/doc/DeviceApi.md new file mode 100644 index 0000000..9f7b8d5 --- /dev/null +++ b/mycore_api/doc/DeviceApi.md @@ -0,0 +1,507 @@ +# mycoreapi.api.DeviceApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deviceCreate**](DeviceApi.md#devicecreate) | **POST** /api/device | Create a device +[**deviceCreateDevicesFromProvider**](DeviceApi.md#devicecreatedevicesfromprovider) | **POST** /api/device/{userId}/fromProvider/{providerId} | Create devices from provider +[**deviceDelete**](DeviceApi.md#devicedelete) | **DELETE** /api/device/{deviceId} | Delete a device +[**deviceDeleteAllForUser**](DeviceApi.md#devicedeleteallforuser) | **DELETE** /api/device/user/{userId} | Delete all device for a specified +[**deviceDeleteDevicesFromProvider**](DeviceApi.md#devicedeletedevicesfromprovider) | **DELETE** /api/device/{userId}/fromProvider/{providerId} | Delete devices from provider +[**deviceGetAll**](DeviceApi.md#devicegetall) | **GET** /api/device/{userId} | Get all devices summary +[**deviceGetDetail**](DeviceApi.md#devicegetdetail) | **GET** /api/device/detail/{deviceId} | Get a specific device info +[**deviceGetDevicesByType**](DeviceApi.md#devicegetdevicesbytype) | **GET** /api/device/{userId}/type/{type} | Get list of devices from a type +[**deviceGetDevicesFromProvider**](DeviceApi.md#devicegetdevicesfromprovider) | **GET** /api/device/{userId}/fromProvider/{providerId} | Get devices from provider +[**deviceGetDevicesFromZigbee2Mqtt**](DeviceApi.md#devicegetdevicesfromzigbee2mqtt) | **GET** /api/device/zigbee2Mqtt/{userId} | Get all zigbee2Mqtt devices +[**deviceUpdate**](DeviceApi.md#deviceupdate) | **PUT** /api/device/{deviceId} | Update a device + + +# **deviceCreate** +> DeviceDetailDTO deviceCreate(deviceDetailDTO) + +Create a device + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | Device to create + +try { + final result = api_instance.deviceCreate(deviceDetailDTO); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceDetailDTO** | [**DeviceDetailDTO**](DeviceDetailDTO.md)| Device to create | + +### Return type + +[**DeviceDetailDTO**](DeviceDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **deviceCreateDevicesFromProvider** +> List deviceCreateDevicesFromProvider(userId, providerId) + +Create devices from provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final userId = userId_example; // String | User Id +final providerId = providerId_example; // String | Id of Provider + +try { + final result = api_instance.deviceCreateDevicesFromProvider(userId, providerId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceCreateDevicesFromProvider: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| User Id | + **providerId** | **String**| Id of Provider | + +### Return type + +[**List**](DeviceDetailDTO.md) + +### Authorization + +[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) + +# **deviceDelete** +> MultipartFile deviceDelete(deviceId) + +Delete a device + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceId = deviceId_example; // String | Id of device to delete + +try { + final result = api_instance.deviceDelete(deviceId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **String**| Id of device to delete | + +### 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) + +# **deviceDeleteAllForUser** +> MultipartFile deviceDeleteAllForUser(userId) + +Delete all device for a specified + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final userId = userId_example; // String | Id of user + +try { + final result = api_instance.deviceDeleteAllForUser(userId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceDeleteAllForUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| Id of user | + +### 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) + +# **deviceDeleteDevicesFromProvider** +> MultipartFile deviceDeleteDevicesFromProvider(userId, providerId) + +Delete devices from provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final userId = userId_example; // String | User Id +final providerId = providerId_example; // String | Id of Provider + +try { + final result = api_instance.deviceDeleteDevicesFromProvider(userId, providerId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceDeleteDevicesFromProvider: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| User Id | + **providerId** | **String**| Id of Provider | + +### 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) + +# **deviceGetAll** +> List deviceGetAll(userId) + +Get all devices summary + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final userId = userId_example; // String | Id of user + +try { + final result = api_instance.deviceGetAll(userId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| Id of user | + +### Return type + +[**List**](DeviceSummaryDTO.md) + +### Authorization + +[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) + +# **deviceGetDetail** +> DeviceDetailDTO deviceGetDetail(deviceId) + +Get a specific device info + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceId = deviceId_example; // String | id of device + +try { + final result = api_instance.deviceGetDetail(deviceId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **String**| id of device | + +### Return type + +[**DeviceDetailDTO**](DeviceDetailDTO.md) + +### Authorization + +[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) + +# **deviceGetDevicesByType** +> List deviceGetDevicesByType(userId, type) + +Get list of devices from a type + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final userId = userId_example; // String | user Id +final type = ; // DeviceType | device type + +try { + final result = api_instance.deviceGetDevicesByType(userId, type); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetDevicesByType: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| user Id | + **type** | [**DeviceType**](.md)| device type | + +### Return type + +[**List**](DeviceDetailDTO.md) + +### Authorization + +[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) + +# **deviceGetDevicesFromProvider** +> List deviceGetDevicesFromProvider(userId, providerId) + +Get devices from provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final userId = userId_example; // String | User Id +final providerId = providerId_example; // String | Id of Provider + +try { + final result = api_instance.deviceGetDevicesFromProvider(userId, providerId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetDevicesFromProvider: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| User Id | + **providerId** | **String**| Id of Provider | + +### Return type + +[**List**](DeviceDetailDTO.md) + +### Authorization + +[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) + +# **deviceGetDevicesFromZigbee2Mqtt** +> List deviceGetDevicesFromZigbee2Mqtt(userId) + +Get all zigbee2Mqtt devices + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final userId = userId_example; // String | User Id + +try { + final result = api_instance.deviceGetDevicesFromZigbee2Mqtt(userId); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceGetDevicesFromZigbee2Mqtt: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| User Id | + +### Return type + +[**List**](DeviceDetailDTO.md) + +### Authorization + +[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) + +# **deviceUpdate** +> DeviceDetailDTO deviceUpdate(deviceId, deviceDetailDTO) + +Update a device + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = DeviceApi(); +final deviceId = deviceId_example; // String | +final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | Device to update + +try { + final result = api_instance.deviceUpdate(deviceId, deviceDetailDTO); + print(result); +} catch (e) { + print('Exception when calling DeviceApi->deviceUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **String**| | + **deviceDetailDTO** | [**DeviceDetailDTO**](DeviceDetailDTO.md)| Device to update | + +### Return type + +[**DeviceDetailDTO**](DeviceDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + diff --git a/mycore_api/doc/DeviceDetailDTO.md b/mycore_api/doc/DeviceDetailDTO.md new file mode 100644 index 0000000..359b390 --- /dev/null +++ b/mycore_api/doc/DeviceDetailDTO.md @@ -0,0 +1,42 @@ +# mycoreapi.model.DeviceDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**description** | **String** | | [optional] +**name** | **String** | | [optional] +**model** | **String** | | [optional] +**type** | [**DeviceType**](DeviceType.md) | | [optional] +**status** | **bool** | | [optional] +**connectionStatus** | [**ConnectionStatus**](ConnectionStatus.md) | | [optional] +**locationId** | **String** | | [optional] +**providerId** | **String** | | [optional] +**providerName** | **String** | | [optional] +**location** | [**OneOfLocationDTO**](OneOfLocationDTO.md) | | [optional] +**lastStateDate** | [**DateTime**](DateTime.md) | | [optional] +**battery** | **bool** | | [optional] +**batteryStatus** | **int** | | [optional] +**firmwareVersion** | **String** | | [optional] +**hardwareVersion** | **String** | | [optional] +**port** | **int** | | [optional] +**meansOfCommunications** | [**List**](MeansOfCommunication.md) | | [optional] [default to const []] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**lastState** | **String** | | [optional] +**ipAddress** | **String** | | [optional] +**serviceIdentification** | **String** | | [optional] +**manufacturerName** | **String** | | [optional] +**groupIds** | **List** | | [optional] [default to const []] +**properties** | [**Map**](Object.md) | | [optional] [default to const {}] +**supportedOperations** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/DeviceDetailDTOAllOf.md b/mycore_api/doc/DeviceDetailDTOAllOf.md new file mode 100644 index 0000000..3de3325 --- /dev/null +++ b/mycore_api/doc/DeviceDetailDTOAllOf.md @@ -0,0 +1,27 @@ +# mycoreapi.model.DeviceDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**firmwareVersion** | **String** | | [optional] +**hardwareVersion** | **String** | | [optional] +**port** | **int** | | [optional] +**meansOfCommunications** | [**List**](MeansOfCommunication.md) | | [optional] [default to const []] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**lastState** | **String** | | [optional] +**ipAddress** | **String** | | [optional] +**serviceIdentification** | **String** | | [optional] +**manufacturerName** | **String** | | [optional] +**groupIds** | **List** | | [optional] [default to const []] +**properties** | [**Map**](Object.md) | | [optional] [default to const {}] +**supportedOperations** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/DeviceSummaryDTO.md b/mycore_api/doc/DeviceSummaryDTO.md new file mode 100644 index 0000000..79ef563 --- /dev/null +++ b/mycore_api/doc/DeviceSummaryDTO.md @@ -0,0 +1,29 @@ +# mycoreapi.model.DeviceSummaryDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**description** | **String** | | [optional] +**name** | **String** | | [optional] +**model** | **String** | | [optional] +**type** | [**DeviceType**](DeviceType.md) | | [optional] +**status** | **bool** | | [optional] +**connectionStatus** | [**ConnectionStatus**](ConnectionStatus.md) | | [optional] +**locationId** | **String** | | [optional] +**providerId** | **String** | | [optional] +**providerName** | **String** | | [optional] +**location** | [**OneOfLocationDTO**](OneOfLocationDTO.md) | | [optional] +**lastStateDate** | [**DateTime**](DateTime.md) | | [optional] +**battery** | **bool** | | [optional] +**batteryStatus** | **int** | | [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/mycore_api/doc/DeviceType.md b/mycore_api/doc/DeviceType.md new file mode 100644 index 0000000..a35a53e --- /dev/null +++ b/mycore_api/doc/DeviceType.md @@ -0,0 +1,14 @@ +# mycoreapi.model.DeviceType + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api/doc/ElectricityProduction.md b/mycore_api/doc/ElectricityProduction.md new file mode 100644 index 0000000..c362d02 --- /dev/null +++ b/mycore_api/doc/ElectricityProduction.md @@ -0,0 +1,20 @@ +# mycoreapi.model.ElectricityProduction + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**deviceId** | **String** | | [optional] +**userId** | **String** | | [optional] +**watt** | **double** | | [optional] +**ampere** | **double** | | [optional] +**timestamp** | [**DateTime**](DateTime.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/mycore_api/doc/EnergyApi.md b/mycore_api/doc/EnergyApi.md new file mode 100644 index 0000000..44c4290 --- /dev/null +++ b/mycore_api/doc/EnergyApi.md @@ -0,0 +1,59 @@ +# mycoreapi.api.EnergyApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**energyGetElectricityProduction**](EnergyApi.md#energygetelectricityproduction) | **GET** /api/energy/electricity | Get summary production of Kwh/Year + + +# **energyGetElectricityProduction** +> List energyGetElectricityProduction(userId, viewBy) + +Get summary production of Kwh/Year + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = EnergyApi(); +final userId = userId_example; // String | +final viewBy = ; // ViewBy | + +try { + final result = api_instance.energyGetElectricityProduction(userId, viewBy); + print(result); +} catch (e) { + print('Exception when calling EnergyApi->energyGetElectricityProduction: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | [optional] + **viewBy** | [**ViewBy**](.md)| | [optional] + +### Return type + +[**List**](ElectricityProduction.md) + +### Authorization + +[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) + diff --git a/mycore_api/doc/FacebookApi.md b/mycore_api/doc/FacebookApi.md new file mode 100644 index 0000000..189a21b --- /dev/null +++ b/mycore_api/doc/FacebookApi.md @@ -0,0 +1,57 @@ +# mycoreapi.api.FacebookApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**facebookCreate**](FacebookApi.md#facebookcreate) | **POST** /facebook | + + +# **facebookCreate** +> MultipartFile facebookCreate(facebookAuthModel) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = FacebookApi(); +final facebookAuthModel = FacebookAuthModel(); // FacebookAuthModel | + +try { + final result = api_instance.facebookCreate(facebookAuthModel); + print(result); +} catch (e) { + print('Exception when calling FacebookApi->facebookCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **facebookAuthModel** | [**FacebookAuthModel**](FacebookAuthModel.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) + diff --git a/mycore_api/doc/FacebookAuthModel.md b/mycore_api/doc/FacebookAuthModel.md new file mode 100644 index 0000000..fbc7fdc --- /dev/null +++ b/mycore_api/doc/FacebookAuthModel.md @@ -0,0 +1,15 @@ +# mycoreapi.model.FacebookAuthModel + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userAccessToken** | **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/mycore_api/doc/GoogleApi.md b/mycore_api/doc/GoogleApi.md new file mode 100644 index 0000000..29e2edb --- /dev/null +++ b/mycore_api/doc/GoogleApi.md @@ -0,0 +1,57 @@ +# mycoreapi.api.GoogleApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**googleCreate**](GoogleApi.md#googlecreate) | **POST** /google | + + +# **googleCreate** +> MultipartFile googleCreate(googleAuthModel) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GoogleApi(); +final googleAuthModel = GoogleAuthModel(); // GoogleAuthModel | + +try { + final result = api_instance.googleCreate(googleAuthModel); + print(result); +} catch (e) { + print('Exception when calling GoogleApi->googleCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **googleAuthModel** | [**GoogleAuthModel**](GoogleAuthModel.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) + diff --git a/mycore_api/doc/GoogleAuthModel.md b/mycore_api/doc/GoogleAuthModel.md new file mode 100644 index 0000000..aad8249 --- /dev/null +++ b/mycore_api/doc/GoogleAuthModel.md @@ -0,0 +1,16 @@ +# mycoreapi.model.GoogleAuthModel + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authorizationCode** | **String** | | [optional] +**apiKey** | **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/mycore_api/doc/Group.md b/mycore_api/doc/Group.md new file mode 100644 index 0000000..7101fb4 --- /dev/null +++ b/mycore_api/doc/Group.md @@ -0,0 +1,23 @@ +# mycoreapi.model.Group + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**serviceIdentification** | **int** | | [optional] +**isAlarm** | **bool** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**devicesIds** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/GroupApi.md b/mycore_api/doc/GroupApi.md new file mode 100644 index 0000000..814bf73 --- /dev/null +++ b/mycore_api/doc/GroupApi.md @@ -0,0 +1,459 @@ +# mycoreapi.api.GroupApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**groupCreate**](GroupApi.md#groupcreate) | **POST** /api/group | Create a group +[**groupCreateDevicesFromZigbee2Mqtt**](GroupApi.md#groupcreatedevicesfromzigbee2mqtt) | **POST** /api/group/{userId}/fromZigbee | Create groups from provider +[**groupDelete**](GroupApi.md#groupdelete) | **DELETE** /api/group/{groupId}/device/{deviceId} | Delete device from a group +[**groupDelete2**](GroupApi.md#groupdelete2) | **DELETE** /api/group/{groupId} | Delete a group +[**groupDeleteAllForUser**](GroupApi.md#groupdeleteallforuser) | **DELETE** /api/group/user/{userId} | Delete all group for a specified +[**groupGetAll**](GroupApi.md#groupgetall) | **GET** /api/group/{userId} | Get all groups for the specified user +[**groupGetDetail**](GroupApi.md#groupgetdetail) | **GET** /api/group/detail/{groupId} | Get detail info of a specified group +[**groupGetGroupsByType**](GroupApi.md#groupgetgroupsbytype) | **GET** /api/group/{userId}/type/{type} | Get list of group from a type +[**groupGetGroupsFromZigbee2Mqtt**](GroupApi.md#groupgetgroupsfromzigbee2mqtt) | **GET** /api/group/zigbee2Mqtt/{userId} | Get all zigbee2Mqtt groups +[**groupUpdate**](GroupApi.md#groupupdate) | **PUT** /api/group | Update a group + + +# **groupCreate** +> GroupDetailDTO groupCreate(groupCreateOrUpdateDetailDTO) + +Create a group + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final groupCreateOrUpdateDetailDTO = GroupCreateOrUpdateDetailDTO(); // GroupCreateOrUpdateDetailDTO | Group to create + +try { + final result = api_instance.groupCreate(groupCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupCreateOrUpdateDetailDTO** | [**GroupCreateOrUpdateDetailDTO**](GroupCreateOrUpdateDetailDTO.md)| Group to create | + +### Return type + +[**GroupDetailDTO**](GroupDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **groupCreateDevicesFromZigbee2Mqtt** +> List groupCreateDevicesFromZigbee2Mqtt(userId) + +Create groups from provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final userId = userId_example; // String | User Id + +try { + final result = api_instance.groupCreateDevicesFromZigbee2Mqtt(userId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupCreateDevicesFromZigbee2Mqtt: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| User Id | + +### Return type + +[**List**](GroupDetailDTO.md) + +### Authorization + +[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) + +# **groupDelete** +> MultipartFile groupDelete(deviceId, groupId) + +Delete device from a group + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final deviceId = deviceId_example; // String | Id of device to delete from the group +final groupId = groupId_example; // String | Id of group + +try { + final result = api_instance.groupDelete(deviceId, groupId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **String**| Id of device to delete from the group | + **groupId** | **String**| Id of group | + +### 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) + +# **groupDelete2** +> MultipartFile groupDelete2(groupId) + +Delete a group + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final groupId = groupId_example; // String | Id of group + +try { + final result = api_instance.groupDelete2(groupId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupDelete2: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| Id of group | + +### 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) + +# **groupDeleteAllForUser** +> MultipartFile groupDeleteAllForUser(userId) + +Delete all group for a specified + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final userId = userId_example; // String | Id of user + +try { + final result = api_instance.groupDeleteAllForUser(userId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupDeleteAllForUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| Id of user | + +### 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) + +# **groupGetAll** +> List groupGetAll(userId) + +Get all groups for the specified user + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final userId = userId_example; // String | Id of user + +try { + final result = api_instance.groupGetAll(userId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| Id of user | + +### Return type + +[**List**](GroupSummaryDTO.md) + +### Authorization + +[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) + +# **groupGetDetail** +> GroupDetailDTO groupGetDetail(groupId, userId) + +Get detail info of a specified group + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final groupId = groupId_example; // String | groupid +final userId = userId_example; // String | user id + +try { + final result = api_instance.groupGetDetail(groupId, userId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **String**| groupid | + **userId** | **String**| user id | [optional] + +### Return type + +[**GroupDetailDTO**](GroupDetailDTO.md) + +### Authorization + +[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) + +# **groupGetGroupsByType** +> List groupGetGroupsByType(userId, type) + +Get list of group from a type + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final userId = userId_example; // String | user Id +final type = type_example; // String | group type + +try { + final result = api_instance.groupGetGroupsByType(userId, type); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupGetGroupsByType: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| user Id | + **type** | **String**| group type | + +### Return type + +[**List**](GroupSummaryDTO.md) + +### Authorization + +[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) + +# **groupGetGroupsFromZigbee2Mqtt** +> List groupGetGroupsFromZigbee2Mqtt(userId) + +Get all zigbee2Mqtt groups + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final userId = userId_example; // String | User Id + +try { + final result = api_instance.groupGetGroupsFromZigbee2Mqtt(userId); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupGetGroupsFromZigbee2Mqtt: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| User Id | + +### Return type + +[**List**](GroupDetailDTO.md) + +### Authorization + +[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) + +# **groupUpdate** +> GroupCreateOrUpdateDetailDTO groupUpdate(groupCreateOrUpdateDetailDTO) + +Update a group + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = GroupApi(); +final groupCreateOrUpdateDetailDTO = GroupCreateOrUpdateDetailDTO(); // GroupCreateOrUpdateDetailDTO | group to update + +try { + final result = api_instance.groupUpdate(groupCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling GroupApi->groupUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupCreateOrUpdateDetailDTO** | [**GroupCreateOrUpdateDetailDTO**](GroupCreateOrUpdateDetailDTO.md)| group to update | + +### Return type + +[**GroupCreateOrUpdateDetailDTO**](GroupCreateOrUpdateDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + diff --git a/mycore_api/doc/GroupCreateOrUpdateDetailDTO.md b/mycore_api/doc/GroupCreateOrUpdateDetailDTO.md new file mode 100644 index 0000000..3b60497 --- /dev/null +++ b/mycore_api/doc/GroupCreateOrUpdateDetailDTO.md @@ -0,0 +1,20 @@ +# mycoreapi.model.GroupCreateOrUpdateDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**isAlarm** | **bool** | | [optional] +**deviceIds** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/GroupCreateOrUpdateDetailDTOAllOf.md b/mycore_api/doc/GroupCreateOrUpdateDetailDTOAllOf.md new file mode 100644 index 0000000..759be14 --- /dev/null +++ b/mycore_api/doc/GroupCreateOrUpdateDetailDTOAllOf.md @@ -0,0 +1,15 @@ +# mycoreapi.model.GroupCreateOrUpdateDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deviceIds** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/GroupDetailDTO.md b/mycore_api/doc/GroupDetailDTO.md new file mode 100644 index 0000000..3512ac6 --- /dev/null +++ b/mycore_api/doc/GroupDetailDTO.md @@ -0,0 +1,22 @@ +# mycoreapi.model.GroupDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**isAlarm** | **bool** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**devices** | [**List**](DeviceDetailDTO.md) | | [optional] [default to const []] + +[[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/mycore_api/doc/GroupDetailDTOAllOf.md b/mycore_api/doc/GroupDetailDTOAllOf.md new file mode 100644 index 0000000..619df51 --- /dev/null +++ b/mycore_api/doc/GroupDetailDTOAllOf.md @@ -0,0 +1,17 @@ +# mycoreapi.model.GroupDetailDTOAllOf + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**devices** | [**List**](DeviceDetailDTO.md) | | [optional] [default to const []] + +[[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/mycore_api/doc/GroupSummaryDTO.md b/mycore_api/doc/GroupSummaryDTO.md new file mode 100644 index 0000000..677b077 --- /dev/null +++ b/mycore_api/doc/GroupSummaryDTO.md @@ -0,0 +1,19 @@ +# mycoreapi.model.GroupSummaryDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**isAlarm** | **bool** | | [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/mycore_api/doc/IOTApi.md b/mycore_api/doc/IOTApi.md new file mode 100644 index 0000000..c999c1f --- /dev/null +++ b/mycore_api/doc/IOTApi.md @@ -0,0 +1,151 @@ +# mycoreapi.api.IOTApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**iOTGetSmartPrinterMessages**](IOTApi.md#iotgetsmartprintermessages) | **GET** /api/iot/smartprinter/{idDevice} | Retrieve all SmartPrinterMessage +[**iOTPostToDBPrinter**](IOTApi.md#iotposttodbprinter) | **POST** /api/iot/smartprinter/{idDevice} | It's the method to post data from mqtt broker to Database (Thanks Rpi!) +[**iOTPostToDBSmartGarden**](IOTApi.md#iotposttodbsmartgarden) | **POST** /api/iot/smartgarden/{idDevice} | It's the method to post data from mqtt broker to Database (Thanks Rpi!) + + +# **iOTGetSmartPrinterMessages** +> List iOTGetSmartPrinterMessages(idDevice, id) + +Retrieve all SmartPrinterMessage + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = IOTApi(); +final idDevice = idDevice_example; // String | +final id = 56; // int | Id of the smart printer message + +try { + final result = api_instance.iOTGetSmartPrinterMessages(idDevice, id); + print(result); +} catch (e) { + print('Exception when calling IOTApi->iOTGetSmartPrinterMessages: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **idDevice** | **String**| | + **id** | **int**| Id of the smart printer message | [optional] + +### Return type + +[**List**](SmartPrinterMessage.md) + +### Authorization + +[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) + +# **iOTPostToDBPrinter** +> MultipartFile iOTPostToDBPrinter(idDevice, smartPrinterMessage) + +It's the method to post data from mqtt broker to Database (Thanks Rpi!) + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = IOTApi(); +final idDevice = 56; // int | Id of the device to upload to DB +final smartPrinterMessage = [List()]; // List | Content that will be uploaded + +try { + final result = api_instance.iOTPostToDBPrinter(idDevice, smartPrinterMessage); + print(result); +} catch (e) { + print('Exception when calling IOTApi->iOTPostToDBPrinter: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **idDevice** | **int**| Id of the device to upload to DB | + **smartPrinterMessage** | [**List**](SmartPrinterMessage.md)| Content that will be uploaded | + +### 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) + +# **iOTPostToDBSmartGarden** +> MultipartFile iOTPostToDBSmartGarden(idDevice, smartGardenMessage) + +It's the method to post data from mqtt broker to Database (Thanks Rpi!) + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = IOTApi(); +final idDevice = 56; // int | +final smartGardenMessage = [List()]; // List | + +try { + final result = api_instance.iOTPostToDBSmartGarden(idDevice, smartGardenMessage); + print(result); +} catch (e) { + print('Exception when calling IOTApi->iOTPostToDBSmartGarden: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **idDevice** | **int**| | + **smartGardenMessage** | [**List**](SmartGardenMessage.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) + diff --git a/mycore_api/doc/LayoutApi.md b/mycore_api/doc/LayoutApi.md new file mode 100644 index 0000000..facfb02 --- /dev/null +++ b/mycore_api/doc/LayoutApi.md @@ -0,0 +1,53 @@ +# mycoreapi.api.LayoutApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**layoutGet**](LayoutApi.md#layoutget) | **GET** /api/layout/panelSection | It's a test ! :) + + +# **layoutGet** +> List layoutGet() + +It's a test ! :) + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = LayoutApi(); + +try { + final result = api_instance.layoutGet(); + print(result); +} catch (e) { + print('Exception when calling LayoutApi->layoutGet: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](PanelSection.md) + +### Authorization + +[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) + diff --git a/mycore_api/doc/LocationDTO.md b/mycore_api/doc/LocationDTO.md new file mode 100644 index 0000000..7a34251 --- /dev/null +++ b/mycore_api/doc/LocationDTO.md @@ -0,0 +1,16 @@ +# mycoreapi.model.LocationDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **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/mycore_api/doc/LoginDTO.md b/mycore_api/doc/LoginDTO.md new file mode 100644 index 0000000..80fa242 --- /dev/null +++ b/mycore_api/doc/LoginDTO.md @@ -0,0 +1,16 @@ +# mycoreapi.model.LoginDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | [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/mycore_api/doc/MQTTApi.md b/mycore_api/doc/MQTTApi.md new file mode 100644 index 0000000..4d42331 --- /dev/null +++ b/mycore_api/doc/MQTTApi.md @@ -0,0 +1,57 @@ +# mycoreapi.api.MQTTApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**mQTTPublishMessage**](MQTTApi.md#mqttpublishmessage) | **POST** /api/mqtt | Publish mqtt test + + +# **mQTTPublishMessage** +> bool mQTTPublishMessage(mqttMessageDTO) + +Publish mqtt test + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = MQTTApi(); +final mqttMessageDTO = MqttMessageDTO(); // MqttMessageDTO | Message to send + +try { + final result = api_instance.mQTTPublishMessage(mqttMessageDTO); + print(result); +} catch (e) { + print('Exception when calling MQTTApi->mQTTPublishMessage: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **mqttMessageDTO** | [**MqttMessageDTO**](MqttMessageDTO.md)| Message to send | + +### Return type + +**bool** + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + diff --git a/mycore_api/doc/MeansOfCommunication.md b/mycore_api/doc/MeansOfCommunication.md new file mode 100644 index 0000000..6545c1c --- /dev/null +++ b/mycore_api/doc/MeansOfCommunication.md @@ -0,0 +1,14 @@ +# mycoreapi.model.MeansOfCommunication + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api/doc/MqttMessageDTO.md b/mycore_api/doc/MqttMessageDTO.md new file mode 100644 index 0000000..14e4475 --- /dev/null +++ b/mycore_api/doc/MqttMessageDTO.md @@ -0,0 +1,17 @@ +# mycoreapi.model.MqttMessageDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**topic** | **String** | | [optional] +**message** | **String** | | [optional] +**online** | **bool** | | [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/mycore_api/doc/OddApi.md b/mycore_api/doc/OddApi.md new file mode 100644 index 0000000..64f416c --- /dev/null +++ b/mycore_api/doc/OddApi.md @@ -0,0 +1,103 @@ +# mycoreapi.api.OddApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**oddGetAll**](OddApi.md#oddgetall) | **GET** /api/odd/{oddRequest} | Get odds for one country and one odd value maximum +[**oddGetForCountry**](OddApi.md#oddgetforcountry) | **GET** /api/odd/country/{id}/{oddRequest} | Get odds for one country and one odd value maximum + + +# **oddGetAll** +> List oddGetAll(oddRequest) + +Get odds for one country and one odd value maximum + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = OddApi(); +final oddRequest = 1.2; // double | Odd Maximum value + +try { + final result = api_instance.oddGetAll(oddRequest); + print(result); +} catch (e) { + print('Exception when calling OddApi->oddGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oddRequest** | **double**| Odd Maximum value | + +### Return type + +[**List**](OddNice.md) + +### Authorization + +[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) + +# **oddGetForCountry** +> List oddGetForCountry(id, oddRequest) + +Get odds for one country and one odd value maximum + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = OddApi(); +final id = id_example; // String | id of country, e.g = BE for Belgium +final oddRequest = 1.2; // double | Odd Maximum value + +try { + final result = api_instance.oddGetForCountry(id, oddRequest); + print(result); +} catch (e) { + print('Exception when calling OddApi->oddGetForCountry: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| id of country, e.g = BE for Belgium | + **oddRequest** | **double**| Odd Maximum value | + +### Return type + +[**List**](OddNice.md) + +### Authorization + +[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) + diff --git a/mycore_api/doc/OddH2H.md b/mycore_api/doc/OddH2H.md new file mode 100644 index 0000000..47c485a --- /dev/null +++ b/mycore_api/doc/OddH2H.md @@ -0,0 +1,17 @@ +# mycoreapi.model.OddH2H + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**homeOdd** | **double** | | [optional] +**drawOdd** | **double** | | [optional] +**visitOdd** | **double** | | [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/mycore_api/doc/OddNice.md b/mycore_api/doc/OddNice.md new file mode 100644 index 0000000..40a7bb7 --- /dev/null +++ b/mycore_api/doc/OddNice.md @@ -0,0 +1,18 @@ +# mycoreapi.model.OddNice + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**teams** | **List** | | [optional] [default to const []] +**commenceTime** | **int** | | [optional] +**homeTeam** | **String** | | [optional] +**odds** | [**OneOfOddH2H**](OneOfOddH2H.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/mycore_api/doc/PanelMenuItem.md b/mycore_api/doc/PanelMenuItem.md new file mode 100644 index 0000000..62ec649 --- /dev/null +++ b/mycore_api/doc/PanelMenuItem.md @@ -0,0 +1,21 @@ +# mycoreapi.model.PanelMenuItem + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **String** | | [optional] +**route** | **String** | | [optional] +**icon** | **String** | | [optional] +**color** | **String** | | [optional] +**badgeValue** | **int** | | [optional] +**badgeType** | **String** | | [optional] +**children** | [**List**](PanelMenuItem.md) | | [optional] [default to const []] + +[[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/mycore_api/doc/PanelSection.md b/mycore_api/doc/PanelSection.md new file mode 100644 index 0000000..fa22d45 --- /dev/null +++ b/mycore_api/doc/PanelSection.md @@ -0,0 +1,19 @@ +# mycoreapi.model.PanelSection + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **String** | | [optional] +**icon** | **String** | | [optional] +**color** | **String** | | [optional] +**defaultRoute** | **String** | | [optional] +**children** | [**List**](PanelMenuItem.md) | | [optional] [default to const []] + +[[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/mycore_api/doc/Provider.md b/mycore_api/doc/Provider.md new file mode 100644 index 0000000..a3d719d --- /dev/null +++ b/mycore_api/doc/Provider.md @@ -0,0 +1,24 @@ +# mycoreapi.model.Provider + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**username** | **String** | | [optional] +**password** | **String** | | [optional] +**endpoint** | **String** | | [optional] +**apiKey** | **String** | | [optional] +**value** | **String** | | [optional] +**active** | **bool** | | [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/mycore_api/doc/ProviderApi.md b/mycore_api/doc/ProviderApi.md new file mode 100644 index 0000000..bb566cc --- /dev/null +++ b/mycore_api/doc/ProviderApi.md @@ -0,0 +1,189 @@ +# mycoreapi.api.ProviderApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**providerCreate**](ProviderApi.md#providercreate) | **POST** /api/provider | Create a provider +[**providerDelete**](ProviderApi.md#providerdelete) | **DELETE** /api/provider/{providerId} | Delete a provider +[**providerGetAll**](ProviderApi.md#providergetall) | **GET** /api/provider/{userId} | Get all user providers +[**providerUpdate**](ProviderApi.md#providerupdate) | **PUT** /api/provider | Update a provider + + +# **providerCreate** +> ProviderDTO providerCreate(providerDTO) + +Create a provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ProviderApi(); +final providerDTO = ProviderDTO(); // ProviderDTO | Provider to create + +try { + final result = api_instance.providerCreate(providerDTO); + print(result); +} catch (e) { + print('Exception when calling ProviderApi->providerCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **providerDTO** | [**ProviderDTO**](ProviderDTO.md)| Provider to create | + +### Return type + +[**ProviderDTO**](ProviderDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **providerDelete** +> MultipartFile providerDelete(providerId) + +Delete a provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ProviderApi(); +final providerId = providerId_example; // String | Id of provider to delete + +try { + final result = api_instance.providerDelete(providerId); + print(result); +} catch (e) { + print('Exception when calling ProviderApi->providerDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **providerId** | **String**| Id of provider to delete | + +### 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) + +# **providerGetAll** +> List providerGetAll(userId) + +Get all user providers + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ProviderApi(); +final userId = userId_example; // String | + +try { + final result = api_instance.providerGetAll(userId); + print(result); +} catch (e) { + print('Exception when calling ProviderApi->providerGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| | + +### Return type + +[**List**](ProviderDTO.md) + +### Authorization + +[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) + +# **providerUpdate** +> DeviceDetailDTO providerUpdate(providerDTO) + +Update a provider + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ProviderApi(); +final providerDTO = ProviderDTO(); // ProviderDTO | Provider to update + +try { + final result = api_instance.providerUpdate(providerDTO); + print(result); +} catch (e) { + print('Exception when calling ProviderApi->providerUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **providerDTO** | [**ProviderDTO**](ProviderDTO.md)| Provider to update | + +### Return type + +[**DeviceDetailDTO**](DeviceDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + diff --git a/mycore_api/doc/ProviderDTO.md b/mycore_api/doc/ProviderDTO.md new file mode 100644 index 0000000..1c82d23 --- /dev/null +++ b/mycore_api/doc/ProviderDTO.md @@ -0,0 +1,23 @@ +# mycoreapi.model.ProviderDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**userId** | **String** | | [optional] +**endpoint** | **String** | | [optional] +**username** | **String** | | [optional] +**password** | **String** | | [optional] +**apiKey** | **String** | | [optional] +**active** | **bool** | | [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/mycore_api/doc/RoomApi.md b/mycore_api/doc/RoomApi.md new file mode 100644 index 0000000..3b7deb5 --- /dev/null +++ b/mycore_api/doc/RoomApi.md @@ -0,0 +1,325 @@ +# mycoreapi.api.RoomApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**roomCreate**](RoomApi.md#roomcreate) | **POST** /api/room | Create a room +[**roomDelete**](RoomApi.md#roomdelete) | **DELETE** /api/room/{roomId}/device/{deviceId} | Delete device from a room +[**roomDelete2**](RoomApi.md#roomdelete2) | **DELETE** /api/room/{roomId} | Delete a room +[**roomDeleteAllForUser**](RoomApi.md#roomdeleteallforuser) | **DELETE** /api/room/user/{userId} | Delete all room for a specified +[**roomGetAll**](RoomApi.md#roomgetall) | **GET** /api/room/{userId} | Get all rooms for the specified user +[**roomGetDetail**](RoomApi.md#roomgetdetail) | **GET** /api/room/detail/{roomId} | Get detail info of a specified room +[**roomUpdate**](RoomApi.md#roomupdate) | **PUT** /api/room | Update a room + + +# **roomCreate** +> RoomDetailDTO roomCreate(roomCreateOrUpdateDetailDTO) + +Create a room + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final roomCreateOrUpdateDetailDTO = RoomCreateOrUpdateDetailDTO(); // RoomCreateOrUpdateDetailDTO | Room to create + +try { + final result = api_instance.roomCreate(roomCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **roomCreateOrUpdateDetailDTO** | [**RoomCreateOrUpdateDetailDTO**](RoomCreateOrUpdateDetailDTO.md)| Room to create | + +### Return type + +[**RoomDetailDTO**](RoomDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **roomDelete** +> MultipartFile roomDelete(deviceId, roomId) + +Delete device from a room + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final deviceId = deviceId_example; // String | Id of device to delete from the room +final roomId = roomId_example; // String | Id of room + +try { + final result = api_instance.roomDelete(deviceId, roomId); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **String**| Id of device to delete from the room | + **roomId** | **String**| Id of room | + +### 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) + +# **roomDelete2** +> MultipartFile roomDelete2(roomId) + +Delete a room + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final roomId = roomId_example; // String | Id of room + +try { + final result = api_instance.roomDelete2(roomId); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomDelete2: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **roomId** | **String**| Id of room | + +### 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) + +# **roomDeleteAllForUser** +> MultipartFile roomDeleteAllForUser(userId) + +Delete all room for a specified + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final userId = userId_example; // String | Id of user + +try { + final result = api_instance.roomDeleteAllForUser(userId); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomDeleteAllForUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| Id of user | + +### 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) + +# **roomGetAll** +> List roomGetAll(userId) + +Get all rooms for the specified user + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final userId = userId_example; // String | Id of user + +try { + final result = api_instance.roomGetAll(userId); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomGetAll: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **String**| Id of user | + +### Return type + +[**List**](RoomSummaryDTO.md) + +### Authorization + +[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) + +# **roomGetDetail** +> RoomDetailDTO roomGetDetail(roomId, userId) + +Get detail info of a specified room + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final roomId = roomId_example; // String | room id +final userId = userId_example; // String | user id + +try { + final result = api_instance.roomGetDetail(roomId, userId); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomGetDetail: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **roomId** | **String**| room id | + **userId** | **String**| user id | [optional] + +### Return type + +[**RoomDetailDTO**](RoomDetailDTO.md) + +### Authorization + +[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) + +# **roomUpdate** +> RoomCreateOrUpdateDetailDTO roomUpdate(roomCreateOrUpdateDetailDTO) + +Update a room + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = RoomApi(); +final roomCreateOrUpdateDetailDTO = RoomCreateOrUpdateDetailDTO(); // RoomCreateOrUpdateDetailDTO | room to update + +try { + final result = api_instance.roomUpdate(roomCreateOrUpdateDetailDTO); + print(result); +} catch (e) { + print('Exception when calling RoomApi->roomUpdate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **roomCreateOrUpdateDetailDTO** | [**RoomCreateOrUpdateDetailDTO**](RoomCreateOrUpdateDetailDTO.md)| room to update | + +### Return type + +[**RoomCreateOrUpdateDetailDTO**](RoomCreateOrUpdateDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + diff --git a/mycore_api/doc/RoomCreateOrUpdateDetailDTO.md b/mycore_api/doc/RoomCreateOrUpdateDetailDTO.md new file mode 100644 index 0000000..d2f99ca --- /dev/null +++ b/mycore_api/doc/RoomCreateOrUpdateDetailDTO.md @@ -0,0 +1,18 @@ +# mycoreapi.model.RoomCreateOrUpdateDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**name** | **String** | | [optional] +**deviceIds** | **List** | | [optional] [default to const []] + +[[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/mycore_api/doc/RoomDetailDTO.md b/mycore_api/doc/RoomDetailDTO.md new file mode 100644 index 0000000..521c2ed --- /dev/null +++ b/mycore_api/doc/RoomDetailDTO.md @@ -0,0 +1,20 @@ +# mycoreapi.model.RoomDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**name** | **String** | | [optional] +**createdDate** | [**DateTime**](DateTime.md) | | [optional] +**updatedDate** | [**DateTime**](DateTime.md) | | [optional] +**devices** | [**List**](DeviceDetailDTO.md) | | [optional] [default to const []] + +[[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/mycore_api/doc/RoomSummaryDTO.md b/mycore_api/doc/RoomSummaryDTO.md new file mode 100644 index 0000000..fa55021 --- /dev/null +++ b/mycore_api/doc/RoomSummaryDTO.md @@ -0,0 +1,17 @@ +# mycoreapi.model.RoomSummaryDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**userId** | **String** | | [optional] +**name** | **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/mycore_api/doc/ScreenConfiguration.md b/mycore_api/doc/ScreenConfiguration.md new file mode 100644 index 0000000..131ec98 --- /dev/null +++ b/mycore_api/doc/ScreenConfiguration.md @@ -0,0 +1,20 @@ +# mycoreapi.model.ScreenConfiguration + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**widgets** | [**List**](Widget.md) | | [optional] [default to const []] +**height** | **int** | | [optional] +**width** | **int** | | [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/mycore_api/doc/ScreenDevice.md b/mycore_api/doc/ScreenDevice.md new file mode 100644 index 0000000..d512606 --- /dev/null +++ b/mycore_api/doc/ScreenDevice.md @@ -0,0 +1,21 @@ +# mycoreapi.model.ScreenDevice + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**type** | **String** | | [optional] +**location** | **String** | | [optional] +**locationExplanation** | **String** | | [optional] +**height** | **int** | | [optional] +**width** | **int** | | [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/mycore_api/doc/ScreenDeviceApi.md b/mycore_api/doc/ScreenDeviceApi.md new file mode 100644 index 0000000..367d096 --- /dev/null +++ b/mycore_api/doc/ScreenDeviceApi.md @@ -0,0 +1,231 @@ +# mycoreapi.api.ScreenDeviceApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**screenDeviceCreateDevice**](ScreenDeviceApi.md#screendevicecreatedevice) | **POST** /api/device/screen | +[**screenDeviceDeleteDevice**](ScreenDeviceApi.md#screendevicedeletedevice) | **DELETE** /api/device/screen/{deviceId} | +[**screenDeviceGetAllScreenDevices**](ScreenDeviceApi.md#screendevicegetallscreendevices) | **GET** /api/device/screen | +[**screenDeviceGetDeviceInfo**](ScreenDeviceApi.md#screendevicegetdeviceinfo) | **GET** /api/device/screen/{screenDeviceId} | +[**screenDeviceUpdateDevice**](ScreenDeviceApi.md#screendeviceupdatedevice) | **PUT** /api/device/screen/{screenDeviceId} | + + +# **screenDeviceCreateDevice** +> MultipartFile screenDeviceCreateDevice(screenDevice) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ScreenDeviceApi(); +final screenDevice = ScreenDevice(); // ScreenDevice | + +try { + final result = api_instance.screenDeviceCreateDevice(screenDevice); + print(result); +} catch (e) { + print('Exception when calling ScreenDeviceApi->screenDeviceCreateDevice: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **screenDevice** | [**ScreenDevice**](ScreenDevice.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) + +# **screenDeviceDeleteDevice** +> MultipartFile screenDeviceDeleteDevice(deviceId) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ScreenDeviceApi(); +final deviceId = deviceId_example; // String | + +try { + final result = api_instance.screenDeviceDeleteDevice(deviceId); + print(result); +} catch (e) { + print('Exception when calling ScreenDeviceApi->screenDeviceDeleteDevice: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deviceId** | **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) + +# **screenDeviceGetAllScreenDevices** +> List screenDeviceGetAllScreenDevices() + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ScreenDeviceApi(); + +try { + final result = api_instance.screenDeviceGetAllScreenDevices(); + print(result); +} catch (e) { + print('Exception when calling ScreenDeviceApi->screenDeviceGetAllScreenDevices: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List**](ScreenDevice.md) + +### Authorization + +[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) + +# **screenDeviceGetDeviceInfo** +> ScreenDevice screenDeviceGetDeviceInfo(screenDeviceId) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ScreenDeviceApi(); +final screenDeviceId = screenDeviceId_example; // String | Id of the screen device you want to get information + +try { + final result = api_instance.screenDeviceGetDeviceInfo(screenDeviceId); + print(result); +} catch (e) { + print('Exception when calling ScreenDeviceApi->screenDeviceGetDeviceInfo: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **screenDeviceId** | **String**| Id of the screen device you want to get information | + +### Return type + +[**ScreenDevice**](ScreenDevice.md) + +### Authorization + +[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) + +# **screenDeviceUpdateDevice** +> MultipartFile screenDeviceUpdateDevice(screenDeviceId, screenDevice) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ScreenDeviceApi(); +final screenDeviceId = 56; // int | +final screenDevice = ScreenDevice(); // ScreenDevice | + +try { + final result = api_instance.screenDeviceUpdateDevice(screenDeviceId, screenDevice); + print(result); +} catch (e) { + print('Exception when calling ScreenDeviceApi->screenDeviceUpdateDevice: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **screenDeviceId** | **int**| | + **screenDevice** | [**ScreenDevice**](ScreenDevice.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) + diff --git a/mycore_api/doc/SmartGardenMessage.md b/mycore_api/doc/SmartGardenMessage.md new file mode 100644 index 0000000..5e42dc5 --- /dev/null +++ b/mycore_api/doc/SmartGardenMessage.md @@ -0,0 +1,22 @@ +# mycoreapi.model.SmartGardenMessage + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**type** | **String** | | [optional] +**time** | **String** | | [optional] +**temperature** | **double** | | [optional] +**pressure** | **double** | | [optional] +**humidity** | **double** | | [optional] +**water** | **int** | | [optional] +**light** | **int** | | [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/mycore_api/doc/SmartPrinterMessage.md b/mycore_api/doc/SmartPrinterMessage.md new file mode 100644 index 0000000..cff4fae --- /dev/null +++ b/mycore_api/doc/SmartPrinterMessage.md @@ -0,0 +1,20 @@ +# mycoreapi.model.SmartPrinterMessage + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**type** | **String** | | [optional] +**time** | **String** | | [optional] +**temperature** | **double** | | [optional] +**pressure** | **double** | | [optional] +**smoke** | **int** | | [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/mycore_api/doc/State.md b/mycore_api/doc/State.md new file mode 100644 index 0000000..66a3444 --- /dev/null +++ b/mycore_api/doc/State.md @@ -0,0 +1,16 @@ +# mycoreapi.model.State + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**value** | **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/mycore_api/doc/TokenApi.md b/mycore_api/doc/TokenApi.md new file mode 100644 index 0000000..fed3edd --- /dev/null +++ b/mycore_api/doc/TokenApi.md @@ -0,0 +1,101 @@ +# mycoreapi.api.TokenApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**tokenConnectUser**](TokenApi.md#tokenconnectuser) | **POST** /api/token | +[**tokenCreate**](TokenApi.md#tokencreate) | **POST** /token | + + +# **tokenConnectUser** +> UserInfo tokenConnectUser(loginDTO) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = TokenApi(); +final loginDTO = LoginDTO(); // LoginDTO | + +try { + final result = api_instance.tokenConnectUser(loginDTO); + print(result); +} catch (e) { + print('Exception when calling TokenApi->tokenConnectUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loginDTO** | [**LoginDTO**](LoginDTO.md)| | + +### Return type + +[**UserInfo**](UserInfo.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **tokenCreate** +> MultipartFile tokenCreate(user) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = TokenApi(); +final user = User(); // User | + +try { + final result = api_instance.tokenCreate(user); + print(result); +} catch (e) { + print('Exception when calling TokenApi->tokenCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.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) + diff --git a/mycore_api/doc/Trigger.md b/mycore_api/doc/Trigger.md new file mode 100644 index 0000000..1ab8cb4 --- /dev/null +++ b/mycore_api/doc/Trigger.md @@ -0,0 +1,19 @@ +# mycoreapi.model.Trigger + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**providerId** | **String** | | [optional] +**deviceId** | **String** | | [optional] +**stateName** | **String** | | [optional] +**stateValue** | **String** | | [optional] +**type** | [**TriggerType**](TriggerType.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/mycore_api/doc/TriggerType.md b/mycore_api/doc/TriggerType.md new file mode 100644 index 0000000..6d73e21 --- /dev/null +++ b/mycore_api/doc/TriggerType.md @@ -0,0 +1,14 @@ +# mycoreapi.model.TriggerType + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api/doc/TwitterApi.md b/mycore_api/doc/TwitterApi.md new file mode 100644 index 0000000..04bf6e5 --- /dev/null +++ b/mycore_api/doc/TwitterApi.md @@ -0,0 +1,57 @@ +# mycoreapi.api.TwitterApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**twitterCreate**](TwitterApi.md#twittercreate) | **POST** /twitter | + + +# **twitterCreate** +> MultipartFile twitterCreate(twitterAuthModel) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = TwitterApi(); +final twitterAuthModel = TwitterAuthModel(); // TwitterAuthModel | + +try { + final result = api_instance.twitterCreate(twitterAuthModel); + print(result); +} catch (e) { + print('Exception when calling TwitterApi->twitterCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **twitterAuthModel** | [**TwitterAuthModel**](TwitterAuthModel.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) + diff --git a/mycore_api/doc/TwitterAuthModel.md b/mycore_api/doc/TwitterAuthModel.md new file mode 100644 index 0000000..3f56c06 --- /dev/null +++ b/mycore_api/doc/TwitterAuthModel.md @@ -0,0 +1,15 @@ +# mycoreapi.model.TwitterAuthModel + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apiKey** | **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/mycore_api/doc/User.md b/mycore_api/doc/User.md new file mode 100644 index 0000000..6ee02f4 --- /dev/null +++ b/mycore_api/doc/User.md @@ -0,0 +1,16 @@ +# mycoreapi.model.User + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [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/mycore_api/doc/UserApi.md b/mycore_api/doc/UserApi.md new file mode 100644 index 0000000..4d8d8de --- /dev/null +++ b/mycore_api/doc/UserApi.md @@ -0,0 +1,229 @@ +# mycoreapi.api.UserApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**userCreateUser**](UserApi.md#usercreateuser) | **POST** /api/user | +[**userDeleteUser**](UserApi.md#userdeleteuser) | **DELETE** /api/user/{id} | +[**userGet**](UserApi.md#userget) | **GET** /api/user | Get a list of user +[**userGet2**](UserApi.md#userget2) | **GET** /api/user/{id} | Get a specific user +[**userUpdateUser**](UserApi.md#userupdateuser) | **PUT** /api/user | + + +# **userCreateUser** +> UserInfoDetailDTO userCreateUser(userInfo) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); +final userInfo = UserInfo(); // UserInfo | + +try { + final result = api_instance.userCreateUser(userInfo); + print(result); +} catch (e) { + print('Exception when calling UserApi->userCreateUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userInfo** | [**UserInfo**](UserInfo.md)| | + +### Return type + +[**UserInfoDetailDTO**](UserInfoDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **userDeleteUser** +> MultipartFile userDeleteUser(id) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); +final id = id_example; // String | + +try { + final result = api_instance.userDeleteUser(id); + print(result); +} catch (e) { + print('Exception when calling UserApi->userDeleteUser: $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) + +# **userGet** +> MultipartFile userGet() + +Get a list of user + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); + +try { + final result = api_instance.userGet(); + print(result); +} catch (e) { + print('Exception when calling UserApi->userGet: $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) + +# **userGet2** +> UserInfoDetailDTO userGet2(id) + +Get a specific user + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); +final id = id_example; // String | id user + +try { + final result = api_instance.userGet2(id); + print(result); +} catch (e) { + print('Exception when calling UserApi->userGet2: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| id user | + +### Return type + +[**UserInfoDetailDTO**](UserInfoDetailDTO.md) + +### Authorization + +[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) + +# **userUpdateUser** +> UserInfoDetailDTO userUpdateUser(userInfo) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = UserApi(); +final userInfo = UserInfo(); // UserInfo | + +try { + final result = api_instance.userUpdateUser(userInfo); + print(result); +} catch (e) { + print('Exception when calling UserApi->userUpdateUser: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userInfo** | [**UserInfo**](UserInfo.md)| | + +### Return type + +[**UserInfoDetailDTO**](UserInfoDetailDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + diff --git a/mycore_api/doc/UserInfo.md b/mycore_api/doc/UserInfo.md new file mode 100644 index 0000000..f1560a4 --- /dev/null +++ b/mycore_api/doc/UserInfo.md @@ -0,0 +1,36 @@ +# mycoreapi.model.UserInfo + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**role** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**token** | **String** | | [optional] +**birthday** | [**DateTime**](DateTime.md) | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**address** | **String** | | [optional] +**city** | **String** | | [optional] +**state** | **String** | | [optional] +**country** | **String** | | [optional] +**language** | **String** | | [optional] +**timeZone** | **String** | | [optional] +**postalCode** | **int** | | [optional] +**automations** | [**List**](Automation.md) | | [optional] [default to const []] +**devices** | [**List**](Device.md) | | [optional] [default to const []] +**providers** | [**List**](Provider.md) | | [optional] [default to const []] +**groups** | [**List**](Group.md) | | [optional] [default to const []] +**screenConfigurationIds** | [**List**](ScreenConfiguration.md) | | [optional] [default to const []] +**deviceIds** | [**List**](ScreenDevice.md) | | [optional] [default to const []] + +[[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/mycore_api/doc/UserInfoDetailDTO.md b/mycore_api/doc/UserInfoDetailDTO.md new file mode 100644 index 0000000..0361620 --- /dev/null +++ b/mycore_api/doc/UserInfoDetailDTO.md @@ -0,0 +1,18 @@ +# mycoreapi.model.UserInfoDetailDTO + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**email** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **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/mycore_api/doc/ValuesApi.md b/mycore_api/doc/ValuesApi.md new file mode 100644 index 0000000..170a923 --- /dev/null +++ b/mycore_api/doc/ValuesApi.md @@ -0,0 +1,228 @@ +# mycoreapi.api.ValuesApi + +## Load the API package +```dart +import 'package:mycoreapi/api.dart'; +``` + +All URIs are relative to *http://192.168.31.140* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**valuesDelete**](ValuesApi.md#valuesdelete) | **DELETE** /api/test/{id} | +[**valuesGet**](ValuesApi.md#valuesget) | **GET** /api/test/{id} | +[**valuesGetAll**](ValuesApi.md#valuesgetall) | **GET** /api/test | It's a test ! :) +[**valuesPost**](ValuesApi.md#valuespost) | **POST** /api/test | +[**valuesPut**](ValuesApi.md#valuesput) | **PUT** /api/test/{id} | + + +# **valuesDelete** +> valuesDelete(id) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ValuesApi(); +final id = 56; // int | + +try { + api_instance.valuesDelete(id); +} catch (e) { + print('Exception when calling ValuesApi->valuesDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + +# **valuesGet** +> String valuesGet(id) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ValuesApi(); +final id = 56; // int | + +try { + final result = api_instance.valuesGet(id); + print(result); +} catch (e) { + print('Exception when calling ValuesApi->valuesGet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + +### Return type + +**String** + +### Authorization + +[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) + +# **valuesGetAll** +> List valuesGetAll() + +It's a test ! :) + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ValuesApi(); + +try { + final result = api_instance.valuesGetAll(); + print(result); +} catch (e) { + print('Exception when calling ValuesApi->valuesGetAll: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**List** + +### Authorization + +[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) + +# **valuesPost** +> valuesPost(body) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ValuesApi(); +final body = String(); // String | + +try { + api_instance.valuesPost(body); +} catch (e) { + print('Exception when calling ValuesApi->valuesPost: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| | + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[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) + +# **valuesPut** +> valuesPut(id, body) + + + +### Example +```dart +import 'package:mycoreapi/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = ValuesApi(); +final id = 56; // int | +final body = String(); // String | + +try { + api_instance.valuesPut(id, body); +} catch (e) { + print('Exception when calling ValuesApi->valuesPut: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| | + **body** | **String**| | + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[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/mycore_api/doc/ViewBy.md b/mycore_api/doc/ViewBy.md new file mode 100644 index 0000000..a23cd79 --- /dev/null +++ b/mycore_api/doc/ViewBy.md @@ -0,0 +1,14 @@ +# mycoreapi.model.ViewBy + +## Load the model package +```dart +import 'package:mycoreapi/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/mycore_api/doc/Widget.md b/mycore_api/doc/Widget.md new file mode 100644 index 0000000..5ed7239 --- /dev/null +++ b/mycore_api/doc/Widget.md @@ -0,0 +1,27 @@ +# mycoreapi.model.Widget + +## Load the model package +```dart +import 'package:mycoreapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**name** | **String** | | [optional] +**displayName** | **String** | | [optional] +**type** | **String** | | [optional] +**activated** | **bool** | | [optional] +**form** | **String** | | [optional] +**font** | **String** | | [optional] +**color** | **String** | | [optional] +**size** | **String** | | [optional] +**width** | **int** | | [optional] +**height** | **int** | | [optional] +**positionX** | **int** | | [optional] +**positionY** | **int** | | [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/mycore_api/git_push.sh b/mycore_api/git_push.sh new file mode 100644 index 0000000..ced3be2 --- /dev/null +++ b/mycore_api/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/mycore_api/lib/api.dart b/mycore_api/lib/api.dart new file mode 100644 index 0000000..20b5dd4 --- /dev/null +++ b/mycore_api/lib/api.dart @@ -0,0 +1,114 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +library openapi.api; + +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +import 'package:http/http.dart'; +import 'package:intl/intl.dart'; + +import 'package:meta/meta.dart'; + +part 'api_client.dart'; +part 'api_helper.dart'; +part 'api_exception.dart'; +part 'auth/authentication.dart'; +part 'auth/api_key_auth.dart'; +part 'auth/oauth.dart'; +part 'auth/http_basic_auth.dart'; +part 'auth/http_bearer_auth.dart'; + +part 'api/authentication_api.dart'; +part 'api/automation_api.dart'; +part 'api/azure_api.dart'; +part 'api/books_api.dart'; +part 'api/device_api.dart'; +part 'api/energy_api.dart'; +part 'api/facebook_api.dart'; +part 'api/google_api.dart'; +part 'api/group_api.dart'; +part 'api/iot_api.dart'; +part 'api/layout_api.dart'; +part 'api/mqtt_api.dart'; +part 'api/odd_api.dart'; +part 'api/provider_api.dart'; +part 'api/room_api.dart'; +part 'api/screen_device_api.dart'; +part 'api/token_api.dart'; +part 'api/twitter_api.dart'; +part 'api/user_api.dart'; +part 'api/values_api.dart'; + +part 'model/action.dart'; +part 'model/action_type.dart'; +part 'model/automation.dart'; +part 'model/automation_create_or_update_detail_dto.dart'; +part 'model/automation_create_or_update_detail_dto_all_of.dart'; +part 'model/automation_dto.dart'; +part 'model/automation_detail_dto.dart'; +part 'model/automation_detail_dto_all_of.dart'; +part 'model/azure_ad_auth_model.dart'; +part 'model/book.dart'; +part 'model/condition.dart'; +part 'model/condition_type.dart'; +part 'model/condition_value.dart'; +part 'model/connection_status.dart'; +part 'model/device.dart'; +part 'model/device_detail_dto.dart'; +part 'model/device_detail_dto_all_of.dart'; +part 'model/device_summary_dto.dart'; +part 'model/device_type.dart'; +part 'model/electricity_production.dart'; +part 'model/facebook_auth_model.dart'; +part 'model/google_auth_model.dart'; +part 'model/group.dart'; +part 'model/group_create_or_update_detail_dto.dart'; +part 'model/group_create_or_update_detail_dto_all_of.dart'; +part 'model/group_detail_dto.dart'; +part 'model/group_detail_dto_all_of.dart'; +part 'model/group_summary_dto.dart'; +part 'model/location_dto.dart'; +part 'model/login_dto.dart'; +part 'model/means_of_communication.dart'; +part 'model/mqtt_message_dto.dart'; +part 'model/odd_h2_h.dart'; +part 'model/odd_nice.dart'; +part 'model/panel_menu_item.dart'; +part 'model/panel_section.dart'; +part 'model/provider.dart'; +part 'model/provider_dto.dart'; +part 'model/room_create_or_update_detail_dto.dart'; +part 'model/room_detail_dto.dart'; +part 'model/room_summary_dto.dart'; +part 'model/screen_configuration.dart'; +part 'model/screen_device.dart'; +part 'model/smart_garden_message.dart'; +part 'model/smart_printer_message.dart'; +part 'model/state.dart'; +part 'model/trigger.dart'; +part 'model/trigger_type.dart'; +part 'model/twitter_auth_model.dart'; +part 'model/user.dart'; +part 'model/user_info.dart'; +part 'model/user_info_detail_dto.dart'; +part 'model/view_by.dart'; +part 'model/widget.dart'; + + +const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; +const _dateEpochMarker = 'epoch'; +final _dateFormatter = DateFormat('yyyy-MM-dd'); +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ApiClient defaultApiClient = ApiClient(); diff --git a/mycore_api/lib/api/authentication_api.dart b/mycore_api/lib/api/authentication_api.dart new file mode 100644 index 0000000..af318e4 --- /dev/null +++ b/mycore_api/lib/api/authentication_api.dart @@ -0,0 +1,203 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class AuthenticationApi { + AuthenticationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Authenticate with form parameters (used by Swagger test client) + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] grantType: + /// + /// * [String] username: + /// + /// * [String] password: + /// + /// * [String] clientId: + /// + /// * [String] clientSecret: + Future authenticationAuthenticateWithFormWithHttpInfo({ String grantType, String username, String password, String clientId, String clientSecret }) async { + // Verify required params are set. + + final path = r'/api/Authentication/Token'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['multipart/form-data']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (grantType != null) { + hasFields = true; + mp.fields[r'grant_type'] = parameterToString(grantType); + } + if (username != null) { + hasFields = true; + mp.fields[r'username'] = parameterToString(username); + } + if (password != null) { + hasFields = true; + mp.fields[r'password'] = parameterToString(password); + } + if (clientId != null) { + hasFields = true; + mp.fields[r'client_id'] = parameterToString(clientId); + } + if (clientSecret != null) { + hasFields = true; + mp.fields[r'client_secret'] = parameterToString(clientSecret); + } + if (hasFields) { + postBody = mp; + } + } else { + if (grantType != null) { + formParams[r'grant_type'] = parameterToString(grantType); + } + if (username != null) { + formParams[r'username'] = parameterToString(username); + } + if (password != null) { + formParams[r'password'] = parameterToString(password); + } + if (clientId != null) { + formParams[r'client_id'] = parameterToString(clientId); + } + if (clientSecret != null) { + formParams[r'client_secret'] = parameterToString(clientSecret); + } + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Authenticate with form parameters (used by Swagger test client) + /// + /// Parameters: + /// + /// * [String] grantType: + /// + /// * [String] username: + /// + /// * [String] password: + /// + /// * [String] clientId: + /// + /// * [String] clientSecret: + Future authenticationAuthenticateWithForm({ String grantType, String username, String password, String clientId, String clientSecret }) async { + final response = await authenticationAuthenticateWithFormWithHttpInfo( grantType: grantType, username: username, password: password, clientId: clientId, clientSecret: clientSecret ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'LoginDTO') as LoginDTO; + } + return Future.value(null); + } + + /// Authenticate with Json parameters (used by most clients) + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [LoginDTO] loginDTO (required): + /// Login DTO + Future authenticationAuthenticateWithJsonWithHttpInfo(LoginDTO loginDTO) async { + // Verify required params are set. + if (loginDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: loginDTO'); + } + + final path = r'/api/Authentication/Authenticate'; + + Object postBody = loginDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Authenticate with Json parameters (used by most clients) + /// + /// Parameters: + /// + /// * [LoginDTO] loginDTO (required): + /// Login DTO + Future authenticationAuthenticateWithJson(LoginDTO loginDTO) async { + final response = await authenticationAuthenticateWithJsonWithHttpInfo(loginDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'LoginDTO') as LoginDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/automation_api.dart b/mycore_api/lib/api/automation_api.dart new file mode 100644 index 0000000..f032867 --- /dev/null +++ b/mycore_api/lib/api/automation_api.dart @@ -0,0 +1,436 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class AutomationApi { + AutomationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/automation' operation and returns the [Response]. + /// Parameters: + /// + /// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required): + Future automationCreateWithHttpInfo(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (automationCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: automationCreateOrUpdateDetailDTO'); + } + + final path = r'/api/automation'; + + Object postBody = automationCreateOrUpdateDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required): + Future automationCreate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async { + final response = await automationCreateWithHttpInfo(automationCreateOrUpdateDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'AutomationDTO') as AutomationDTO; + } + return Future.value(null); + } + + /// Delete an automation + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] automationId (required): + /// Id of automation to delete + Future automationDeleteWithHttpInfo(String automationId) async { + // Verify required params are set. + if (automationId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: automationId'); + } + + final path = r'/api/automation/{automationId}' + .replaceAll('{' + 'automationId' + '}', automationId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete an automation + /// + /// Parameters: + /// + /// * [String] automationId (required): + /// Id of automation to delete + Future automationDelete(String automationId) async { + final response = await automationDeleteWithHttpInfo(automationId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Delete all automation for a specified + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future automationDeleteAllForUserWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/automation/user/{userId}' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete all automation for a specified + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future automationDeleteAllForUser(String userId) async { + final response = await automationDeleteAllForUserWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Get all automations for the specified user + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future automationGetAllWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/automation/{userId}' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get all automations for the specified user + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future> automationGetAll(String userId) async { + final response = await automationGetAllWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Get detail info of a specified automation + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] automationId (required): + /// automation id + Future automationGetDetailWithHttpInfo(String automationId) async { + // Verify required params are set. + if (automationId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: automationId'); + } + + final path = r'/api/automation/detail/{automationId}' + .replaceAll('{' + 'automationId' + '}', automationId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get detail info of a specified automation + /// + /// Parameters: + /// + /// * [String] automationId (required): + /// automation id + Future automationGetDetail(String automationId) async { + final response = await automationGetDetailWithHttpInfo(automationId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'AutomationDetailDTO') as AutomationDetailDTO; + } + return Future.value(null); + } + + /// Update an automation + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required): + /// automation to update + Future automationUpdateWithHttpInfo(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (automationCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: automationCreateOrUpdateDetailDTO'); + } + + final path = r'/api/automation'; + + Object postBody = automationCreateOrUpdateDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Update an automation + /// + /// Parameters: + /// + /// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required): + /// automation to update + Future automationUpdate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async { + final response = await automationUpdateWithHttpInfo(automationCreateOrUpdateDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'AutomationCreateOrUpdateDetailDTO') as AutomationCreateOrUpdateDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/azure_api.dart b/mycore_api/lib/api/azure_api.dart new file mode 100644 index 0000000..3e2266a --- /dev/null +++ b/mycore_api/lib/api/azure_api.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class AzureApi { + AzureApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /azure' operation and returns the [Response]. + /// Parameters: + /// + /// * [AzureADAuthModel] azureADAuthModel (required): + Future azureCreateWithHttpInfo(AzureADAuthModel azureADAuthModel) async { + // Verify required params are set. + if (azureADAuthModel == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: azureADAuthModel'); + } + + final path = r'/azure'; + + Object postBody = azureADAuthModel; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [AzureADAuthModel] azureADAuthModel (required): + Future azureCreate(AzureADAuthModel azureADAuthModel) async { + final response = await azureCreateWithHttpInfo(azureADAuthModel); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/books_api.dart b/mycore_api/lib/api/books_api.dart new file mode 100644 index 0000000..03998f3 --- /dev/null +++ b/mycore_api/lib/api/books_api.dart @@ -0,0 +1,333 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class BooksApi { + BooksApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/books' operation and returns the [Response]. + /// Parameters: + /// + /// * [Book] book (required): + Future booksCreateWithHttpInfo(Book book) async { + // Verify required params are set. + if (book == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: book'); + } + + final path = r'/api/books'; + + Object postBody = book; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [Book] book (required): + Future booksCreate(Book book) async { + final response = await booksCreateWithHttpInfo(book); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'Book') as Book; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/books/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future booksDeleteWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/books/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future booksDelete(String id) async { + final response = await booksDeleteWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/books/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future booksGetWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/books/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future booksGet(String id) async { + final response = await booksGetWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'Book') as Book; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/books' operation and returns the [Response]. + Future booksGetAllWithHttpInfo() async { + final path = r'/api/books'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future> booksGetAll() async { + final response = await booksGetAllWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Performs an HTTP 'PUT /api/books/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + /// + /// * [Book] book (required): + Future booksUpdateWithHttpInfo(String id, Book book) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + if (book == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: book'); + } + + final path = r'/api/books/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody = book; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + /// + /// * [Book] book (required): + Future booksUpdate(String id, Book book) async { + final response = await booksUpdateWithHttpInfo(id, book); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/device_api.dart b/mycore_api/lib/api/device_api.dart new file mode 100644 index 0000000..c41b65b --- /dev/null +++ b/mycore_api/lib/api/device_api.dart @@ -0,0 +1,854 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class DeviceApi { + DeviceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create a device + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + /// Device to create + Future deviceCreateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async { + // Verify required params are set. + if (deviceDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO'); + } + + final path = r'/api/device'; + + Object postBody = deviceDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Create a device + /// + /// Parameters: + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + /// Device to create + Future deviceCreate(DeviceDetailDTO deviceDetailDTO) async { + final response = await deviceCreateWithHttpInfo(deviceDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; + } + return Future.value(null); + } + + /// Create devices from provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future deviceCreateDevicesFromProviderWithHttpInfo(String userId, String providerId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + if (providerId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); + } + + final path = r'/api/device/{userId}/fromProvider/{providerId}' + .replaceAll('{' + 'userId' + '}', userId.toString()) + .replaceAll('{' + 'providerId' + '}', providerId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Create devices from provider + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future> deviceCreateDevicesFromProvider(String userId, String providerId) async { + final response = await deviceCreateDevicesFromProviderWithHttpInfo(userId, providerId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Delete a device + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete + Future deviceDeleteWithHttpInfo(String deviceId) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + + final path = r'/api/device/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete a device + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete + Future deviceDelete(String deviceId) async { + final response = await deviceDeleteWithHttpInfo(deviceId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Delete all device for a specified + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future deviceDeleteAllForUserWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/device/user/{userId}' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete all device for a specified + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future deviceDeleteAllForUser(String userId) async { + final response = await deviceDeleteAllForUserWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Delete devices from provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future deviceDeleteDevicesFromProviderWithHttpInfo(String userId, String providerId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + if (providerId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); + } + + final path = r'/api/device/{userId}/fromProvider/{providerId}' + .replaceAll('{' + 'userId' + '}', userId.toString()) + .replaceAll('{' + 'providerId' + '}', providerId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete devices from provider + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future deviceDeleteDevicesFromProvider(String userId, String providerId) async { + final response = await deviceDeleteDevicesFromProviderWithHttpInfo(userId, providerId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Get all devices summary + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future deviceGetAllWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/device/{userId}' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get all devices summary + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future> deviceGetAll(String userId) async { + final response = await deviceGetAllWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Get a specific device info + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// id of device + Future deviceGetDetailWithHttpInfo(String deviceId) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + + final path = r'/api/device/detail/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get a specific device info + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// id of device + Future deviceGetDetail(String deviceId) async { + final response = await deviceGetDetailWithHttpInfo(deviceId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; + } + return Future.value(null); + } + + /// Get list of devices from a type + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// user Id + /// + /// * [DeviceType] type (required): + /// device type + Future deviceGetDevicesByTypeWithHttpInfo(String userId, DeviceType type) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + if (type == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: type'); + } + + final path = r'/api/device/{userId}/type/{type}' + .replaceAll('{' + 'userId' + '}', userId.toString()) + .replaceAll('{' + 'type' + '}', type.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get list of devices from a type + /// + /// Parameters: + /// + /// * [String] userId (required): + /// user Id + /// + /// * [DeviceType] type (required): + /// device type + Future> deviceGetDevicesByType(String userId, DeviceType type) async { + final response = await deviceGetDevicesByTypeWithHttpInfo(userId, type); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Get devices from provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future deviceGetDevicesFromProviderWithHttpInfo(String userId, String providerId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + if (providerId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); + } + + final path = r'/api/device/{userId}/fromProvider/{providerId}' + .replaceAll('{' + 'userId' + '}', userId.toString()) + .replaceAll('{' + 'providerId' + '}', providerId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get devices from provider + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + /// + /// * [String] providerId (required): + /// Id of Provider + Future> deviceGetDevicesFromProvider(String userId, String providerId) async { + final response = await deviceGetDevicesFromProviderWithHttpInfo(userId, providerId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Get all zigbee2Mqtt devices + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + Future deviceGetDevicesFromZigbee2MqttWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/device/zigbee2Mqtt/{userId}' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get all zigbee2Mqtt devices + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + Future> deviceGetDevicesFromZigbee2Mqtt(String userId) async { + final response = await deviceGetDevicesFromZigbee2MqttWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Update a device + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + /// Device to update + Future deviceUpdateWithHttpInfo(String deviceId, DeviceDetailDTO deviceDetailDTO) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + if (deviceDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO'); + } + + final path = r'/api/device/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.toString()); + + Object postBody = deviceDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Update a device + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// + /// * [DeviceDetailDTO] deviceDetailDTO (required): + /// Device to update + Future deviceUpdate(String deviceId, DeviceDetailDTO deviceDetailDTO) async { + final response = await deviceUpdateWithHttpInfo(deviceId, deviceDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/energy_api.dart b/mycore_api/lib/api/energy_api.dart new file mode 100644 index 0000000..be16150 --- /dev/null +++ b/mycore_api/lib/api/energy_api.dart @@ -0,0 +1,95 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class EnergyApi { + EnergyApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Get summary production of Kwh/Year + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId: + /// + /// * [ViewBy] viewBy: + Future energyGetElectricityProductionWithHttpInfo({ String userId, ViewBy viewBy }) async { + // Verify required params are set. + + final path = r'/api/energy/electricity'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (userId != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'userId', userId)); + } + if (viewBy != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'viewBy', viewBy)); + } + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get summary production of Kwh/Year + /// + /// Parameters: + /// + /// * [String] userId: + /// + /// * [ViewBy] viewBy: + Future> energyGetElectricityProduction({ String userId, ViewBy viewBy }) async { + final response = await energyGetElectricityProductionWithHttpInfo( userId: userId, viewBy: viewBy ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } +} diff --git a/mycore_api/lib/api/facebook_api.dart b/mycore_api/lib/api/facebook_api.dart new file mode 100644 index 0000000..d98657b --- /dev/null +++ b/mycore_api/lib/api/facebook_api.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class FacebookApi { + FacebookApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /facebook' operation and returns the [Response]. + /// Parameters: + /// + /// * [FacebookAuthModel] facebookAuthModel (required): + Future facebookCreateWithHttpInfo(FacebookAuthModel facebookAuthModel) async { + // Verify required params are set. + if (facebookAuthModel == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: facebookAuthModel'); + } + + final path = r'/facebook'; + + Object postBody = facebookAuthModel; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [FacebookAuthModel] facebookAuthModel (required): + Future facebookCreate(FacebookAuthModel facebookAuthModel) async { + final response = await facebookCreateWithHttpInfo(facebookAuthModel); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/google_api.dart b/mycore_api/lib/api/google_api.dart new file mode 100644 index 0000000..64faecc --- /dev/null +++ b/mycore_api/lib/api/google_api.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class GoogleApi { + GoogleApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /google' operation and returns the [Response]. + /// Parameters: + /// + /// * [GoogleAuthModel] googleAuthModel (required): + Future googleCreateWithHttpInfo(GoogleAuthModel googleAuthModel) async { + // Verify required params are set. + if (googleAuthModel == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: googleAuthModel'); + } + + final path = r'/google'; + + Object postBody = googleAuthModel; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [GoogleAuthModel] googleAuthModel (required): + Future googleCreate(GoogleAuthModel googleAuthModel) async { + final response = await googleCreateWithHttpInfo(googleAuthModel); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/group_api.dart b/mycore_api/lib/api/group_api.dart new file mode 100644 index 0000000..a1964eb --- /dev/null +++ b/mycore_api/lib/api/group_api.dart @@ -0,0 +1,763 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class GroupApi { + GroupApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create a group + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): + /// Group to create + Future groupCreateWithHttpInfo(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (groupCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: groupCreateOrUpdateDetailDTO'); + } + + final path = r'/api/group'; + + Object postBody = groupCreateOrUpdateDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Create a group + /// + /// Parameters: + /// + /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): + /// Group to create + Future groupCreate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { + final response = await groupCreateWithHttpInfo(groupCreateOrUpdateDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'GroupDetailDTO') as GroupDetailDTO; + } + return Future.value(null); + } + + /// Create groups from provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + Future groupCreateDevicesFromZigbee2MqttWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/group/{userId}/fromZigbee' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Create groups from provider + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + Future> groupCreateDevicesFromZigbee2Mqtt(String userId) async { + final response = await groupCreateDevicesFromZigbee2MqttWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Delete device from a group + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete from the group + /// + /// * [String] groupId (required): + /// Id of group + Future groupDeleteWithHttpInfo(String deviceId, String groupId) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + if (groupId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: groupId'); + } + + final path = r'/api/group/{groupId}/device/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.toString()) + .replaceAll('{' + 'groupId' + '}', groupId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete device from a group + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete from the group + /// + /// * [String] groupId (required): + /// Id of group + Future groupDelete(String deviceId, String groupId) async { + final response = await groupDeleteWithHttpInfo(deviceId, groupId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Delete a group + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] groupId (required): + /// Id of group + Future groupDelete2WithHttpInfo(String groupId) async { + // Verify required params are set. + if (groupId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: groupId'); + } + + final path = r'/api/group/{groupId}' + .replaceAll('{' + 'groupId' + '}', groupId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete a group + /// + /// Parameters: + /// + /// * [String] groupId (required): + /// Id of group + Future groupDelete2(String groupId) async { + final response = await groupDelete2WithHttpInfo(groupId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Delete all group for a specified + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future groupDeleteAllForUserWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/group/user/{userId}' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete all group for a specified + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future groupDeleteAllForUser(String userId) async { + final response = await groupDeleteAllForUserWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Get all groups for the specified user + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future groupGetAllWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/group/{userId}' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get all groups for the specified user + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future> groupGetAll(String userId) async { + final response = await groupGetAllWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Get detail info of a specified group + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] groupId (required): + /// groupid + /// + /// * [String] userId: + /// user id + Future groupGetDetailWithHttpInfo(String groupId, { String userId }) async { + // Verify required params are set. + if (groupId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: groupId'); + } + + final path = r'/api/group/detail/{groupId}' + .replaceAll('{' + 'groupId' + '}', groupId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (userId != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'userId', userId)); + } + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get detail info of a specified group + /// + /// Parameters: + /// + /// * [String] groupId (required): + /// groupid + /// + /// * [String] userId: + /// user id + Future groupGetDetail(String groupId, { String userId }) async { + final response = await groupGetDetailWithHttpInfo(groupId, userId: userId ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'GroupDetailDTO') as GroupDetailDTO; + } + return Future.value(null); + } + + /// Get list of group from a type + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// user Id + /// + /// * [String] type (required): + /// group type + Future groupGetGroupsByTypeWithHttpInfo(String userId, String type) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + if (type == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: type'); + } + + final path = r'/api/group/{userId}/type/{type}' + .replaceAll('{' + 'userId' + '}', userId.toString()) + .replaceAll('{' + 'type' + '}', type.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get list of group from a type + /// + /// Parameters: + /// + /// * [String] userId (required): + /// user Id + /// + /// * [String] type (required): + /// group type + Future> groupGetGroupsByType(String userId, String type) async { + final response = await groupGetGroupsByTypeWithHttpInfo(userId, type); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Get all zigbee2Mqtt groups + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + Future groupGetGroupsFromZigbee2MqttWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/group/zigbee2Mqtt/{userId}' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get all zigbee2Mqtt groups + /// + /// Parameters: + /// + /// * [String] userId (required): + /// User Id + Future> groupGetGroupsFromZigbee2Mqtt(String userId) async { + final response = await groupGetGroupsFromZigbee2MqttWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Update a group + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): + /// group to update + Future groupUpdateWithHttpInfo(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (groupCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: groupCreateOrUpdateDetailDTO'); + } + + final path = r'/api/group'; + + Object postBody = groupCreateOrUpdateDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Update a group + /// + /// Parameters: + /// + /// * [GroupCreateOrUpdateDetailDTO] groupCreateOrUpdateDetailDTO (required): + /// group to update + Future groupUpdate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async { + final response = await groupUpdateWithHttpInfo(groupCreateOrUpdateDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'GroupCreateOrUpdateDetailDTO') as GroupCreateOrUpdateDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/iot_api.dart b/mycore_api/lib/api/iot_api.dart new file mode 100644 index 0000000..33bb0f4 --- /dev/null +++ b/mycore_api/lib/api/iot_api.dart @@ -0,0 +1,254 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class IOTApi { + IOTApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Retrieve all SmartPrinterMessage + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] idDevice (required): + /// + /// * [int] id: + /// Id of the smart printer message + Future iOTGetSmartPrinterMessagesWithHttpInfo(String idDevice, { int id }) async { + // Verify required params are set. + if (idDevice == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: idDevice'); + } + + final path = r'/api/iot/smartprinter/{idDevice}' + .replaceAll('{' + 'idDevice' + '}', idDevice.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (id != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'id', id)); + } + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Retrieve all SmartPrinterMessage + /// + /// Parameters: + /// + /// * [String] idDevice (required): + /// + /// * [int] id: + /// Id of the smart printer message + Future> iOTGetSmartPrinterMessages(String idDevice, { int id }) async { + final response = await iOTGetSmartPrinterMessagesWithHttpInfo(idDevice, id: id ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// It's the method to post data from mqtt broker to Database (Thanks Rpi!) + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [int] idDevice (required): + /// Id of the device to upload to DB + /// + /// * [List] smartPrinterMessage (required): + /// Content that will be uploaded + Future iOTPostToDBPrinterWithHttpInfo(int idDevice, List smartPrinterMessage) async { + // Verify required params are set. + if (idDevice == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: idDevice'); + } + if (smartPrinterMessage == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: smartPrinterMessage'); + } + + final path = r'/api/iot/smartprinter/{idDevice}' + .replaceAll('{' + 'idDevice' + '}', idDevice.toString()); + + Object postBody = smartPrinterMessage; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// It's the method to post data from mqtt broker to Database (Thanks Rpi!) + /// + /// Parameters: + /// + /// * [int] idDevice (required): + /// Id of the device to upload to DB + /// + /// * [List] smartPrinterMessage (required): + /// Content that will be uploaded + Future iOTPostToDBPrinter(int idDevice, List smartPrinterMessage) async { + final response = await iOTPostToDBPrinterWithHttpInfo(idDevice, smartPrinterMessage); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// It's the method to post data from mqtt broker to Database (Thanks Rpi!) + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [int] idDevice (required): + /// + /// * [List] smartGardenMessage (required): + Future iOTPostToDBSmartGardenWithHttpInfo(int idDevice, List smartGardenMessage) async { + // Verify required params are set. + if (idDevice == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: idDevice'); + } + if (smartGardenMessage == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: smartGardenMessage'); + } + + final path = r'/api/iot/smartgarden/{idDevice}' + .replaceAll('{' + 'idDevice' + '}', idDevice.toString()); + + Object postBody = smartGardenMessage; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// It's the method to post data from mqtt broker to Database (Thanks Rpi!) + /// + /// Parameters: + /// + /// * [int] idDevice (required): + /// + /// * [List] smartGardenMessage (required): + Future iOTPostToDBSmartGarden(int idDevice, List smartGardenMessage) async { + final response = await iOTPostToDBSmartGardenWithHttpInfo(idDevice, smartGardenMessage); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/layout_api.dart b/mycore_api/lib/api/layout_api.dart new file mode 100644 index 0000000..c433978 --- /dev/null +++ b/mycore_api/lib/api/layout_api.dart @@ -0,0 +1,74 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class LayoutApi { + LayoutApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// It's a test ! :) + /// + /// Note: This method returns the HTTP [Response]. + Future layoutGetWithHttpInfo() async { + final path = r'/api/layout/panelSection'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// It's a test ! :) + Future> layoutGet() async { + final response = await layoutGetWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } +} diff --git a/mycore_api/lib/api/mqtt_api.dart b/mycore_api/lib/api/mqtt_api.dart new file mode 100644 index 0000000..4b360bf --- /dev/null +++ b/mycore_api/lib/api/mqtt_api.dart @@ -0,0 +1,87 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class MQTTApi { + MQTTApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Publish mqtt test + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [MqttMessageDTO] mqttMessageDTO (required): + /// Message to send + Future mQTTPublishMessageWithHttpInfo(MqttMessageDTO mqttMessageDTO) async { + // Verify required params are set. + if (mqttMessageDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: mqttMessageDTO'); + } + + final path = r'/api/mqtt'; + + Object postBody = mqttMessageDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Publish mqtt test + /// + /// Parameters: + /// + /// * [MqttMessageDTO] mqttMessageDTO (required): + /// Message to send + Future mQTTPublishMessage(MqttMessageDTO mqttMessageDTO) async { + final response = await mQTTPublishMessageWithHttpInfo(mqttMessageDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'bool') as bool; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/odd_api.dart b/mycore_api/lib/api/odd_api.dart new file mode 100644 index 0000000..cfde296 --- /dev/null +++ b/mycore_api/lib/api/odd_api.dart @@ -0,0 +1,173 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class OddApi { + OddApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Get odds for one country and one odd value maximum + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [double] oddRequest (required): + /// Odd Maximum value + Future oddGetAllWithHttpInfo(double oddRequest) async { + // Verify required params are set. + if (oddRequest == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: oddRequest'); + } + + final path = r'/api/odd/{oddRequest}' + .replaceAll('{' + 'oddRequest' + '}', oddRequest.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get odds for one country and one odd value maximum + /// + /// Parameters: + /// + /// * [double] oddRequest (required): + /// Odd Maximum value + Future> oddGetAll(double oddRequest) async { + final response = await oddGetAllWithHttpInfo(oddRequest); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Get odds for one country and one odd value maximum + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] id (required): + /// id of country, e.g = BE for Belgium + /// + /// * [double] oddRequest (required): + /// Odd Maximum value + Future oddGetForCountryWithHttpInfo(String id, double oddRequest) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + if (oddRequest == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: oddRequest'); + } + + final path = r'/api/odd/country/{id}/{oddRequest}' + .replaceAll('{' + 'id' + '}', id.toString()) + .replaceAll('{' + 'oddRequest' + '}', oddRequest.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get odds for one country and one odd value maximum + /// + /// Parameters: + /// + /// * [String] id (required): + /// id of country, e.g = BE for Belgium + /// + /// * [double] oddRequest (required): + /// Odd Maximum value + Future> oddGetForCountry(String id, double oddRequest) async { + final response = await oddGetForCountryWithHttpInfo(id, oddRequest); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } +} diff --git a/mycore_api/lib/api/provider_api.dart b/mycore_api/lib/api/provider_api.dart new file mode 100644 index 0000000..90f0751 --- /dev/null +++ b/mycore_api/lib/api/provider_api.dart @@ -0,0 +1,299 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class ProviderApi { + ProviderApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create a provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [ProviderDTO] providerDTO (required): + /// Provider to create + Future providerCreateWithHttpInfo(ProviderDTO providerDTO) async { + // Verify required params are set. + if (providerDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerDTO'); + } + + final path = r'/api/provider'; + + Object postBody = providerDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Create a provider + /// + /// Parameters: + /// + /// * [ProviderDTO] providerDTO (required): + /// Provider to create + Future providerCreate(ProviderDTO providerDTO) async { + final response = await providerCreateWithHttpInfo(providerDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'ProviderDTO') as ProviderDTO; + } + return Future.value(null); + } + + /// Delete a provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] providerId (required): + /// Id of provider to delete + Future providerDeleteWithHttpInfo(String providerId) async { + // Verify required params are set. + if (providerId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId'); + } + + final path = r'/api/provider/{providerId}' + .replaceAll('{' + 'providerId' + '}', providerId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete a provider + /// + /// Parameters: + /// + /// * [String] providerId (required): + /// Id of provider to delete + Future providerDelete(String providerId) async { + final response = await providerDeleteWithHttpInfo(providerId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Get all user providers + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + Future providerGetAllWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/provider/{userId}' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get all user providers + /// + /// Parameters: + /// + /// * [String] userId (required): + Future> providerGetAll(String userId) async { + final response = await providerGetAllWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Update a provider + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [ProviderDTO] providerDTO (required): + /// Provider to update + Future providerUpdateWithHttpInfo(ProviderDTO providerDTO) async { + // Verify required params are set. + if (providerDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: providerDTO'); + } + + final path = r'/api/provider'; + + Object postBody = providerDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Update a provider + /// + /// Parameters: + /// + /// * [ProviderDTO] providerDTO (required): + /// Provider to update + Future providerUpdate(ProviderDTO providerDTO) async { + final response = await providerUpdateWithHttpInfo(providerDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/room_api.dart b/mycore_api/lib/api/room_api.dart new file mode 100644 index 0000000..8e9ed90 --- /dev/null +++ b/mycore_api/lib/api/room_api.dart @@ -0,0 +1,534 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class RoomApi { + RoomApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create a room + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): + /// Room to create + Future roomCreateWithHttpInfo(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (roomCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: roomCreateOrUpdateDetailDTO'); + } + + final path = r'/api/room'; + + Object postBody = roomCreateOrUpdateDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Create a room + /// + /// Parameters: + /// + /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): + /// Room to create + Future roomCreate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { + final response = await roomCreateWithHttpInfo(roomCreateOrUpdateDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'RoomDetailDTO') as RoomDetailDTO; + } + return Future.value(null); + } + + /// Delete device from a room + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete from the room + /// + /// * [String] roomId (required): + /// Id of room + Future roomDeleteWithHttpInfo(String deviceId, String roomId) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + if (roomId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId'); + } + + final path = r'/api/room/{roomId}/device/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.toString()) + .replaceAll('{' + 'roomId' + '}', roomId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete device from a room + /// + /// Parameters: + /// + /// * [String] deviceId (required): + /// Id of device to delete from the room + /// + /// * [String] roomId (required): + /// Id of room + Future roomDelete(String deviceId, String roomId) async { + final response = await roomDeleteWithHttpInfo(deviceId, roomId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Delete a room + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] roomId (required): + /// Id of room + Future roomDelete2WithHttpInfo(String roomId) async { + // Verify required params are set. + if (roomId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId'); + } + + final path = r'/api/room/{roomId}' + .replaceAll('{' + 'roomId' + '}', roomId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete a room + /// + /// Parameters: + /// + /// * [String] roomId (required): + /// Id of room + Future roomDelete2(String roomId) async { + final response = await roomDelete2WithHttpInfo(roomId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Delete all room for a specified + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future roomDeleteAllForUserWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/room/user/{userId}' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Delete all room for a specified + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future roomDeleteAllForUser(String userId) async { + final response = await roomDeleteAllForUserWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Get all rooms for the specified user + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future roomGetAllWithHttpInfo(String userId) async { + // Verify required params are set. + if (userId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); + } + + final path = r'/api/room/{userId}' + .replaceAll('{' + 'userId' + '}', userId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get all rooms for the specified user + /// + /// Parameters: + /// + /// * [String] userId (required): + /// Id of user + Future> roomGetAll(String userId) async { + final response = await roomGetAllWithHttpInfo(userId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Get detail info of a specified room + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] roomId (required): + /// room id + /// + /// * [String] userId: + /// user id + Future roomGetDetailWithHttpInfo(String roomId, { String userId }) async { + // Verify required params are set. + if (roomId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId'); + } + + final path = r'/api/room/detail/{roomId}' + .replaceAll('{' + 'roomId' + '}', roomId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (userId != null) { + queryParams.addAll(_convertParametersForCollectionFormat('', 'userId', userId)); + } + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get detail info of a specified room + /// + /// Parameters: + /// + /// * [String] roomId (required): + /// room id + /// + /// * [String] userId: + /// user id + Future roomGetDetail(String roomId, { String userId }) async { + final response = await roomGetDetailWithHttpInfo(roomId, userId: userId ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'RoomDetailDTO') as RoomDetailDTO; + } + return Future.value(null); + } + + /// Update a room + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): + /// room to update + Future roomUpdateWithHttpInfo(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { + // Verify required params are set. + if (roomCreateOrUpdateDetailDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: roomCreateOrUpdateDetailDTO'); + } + + final path = r'/api/room'; + + Object postBody = roomCreateOrUpdateDetailDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Update a room + /// + /// Parameters: + /// + /// * [RoomCreateOrUpdateDetailDTO] roomCreateOrUpdateDetailDTO (required): + /// room to update + Future roomUpdate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async { + final response = await roomUpdateWithHttpInfo(roomCreateOrUpdateDetailDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'RoomCreateOrUpdateDetailDTO') as RoomCreateOrUpdateDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/screen_device_api.dart b/mycore_api/lib/api/screen_device_api.dart new file mode 100644 index 0000000..03b7854 --- /dev/null +++ b/mycore_api/lib/api/screen_device_api.dart @@ -0,0 +1,335 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class ScreenDeviceApi { + ScreenDeviceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/device/screen' operation and returns the [Response]. + /// Parameters: + /// + /// * [ScreenDevice] screenDevice (required): + Future screenDeviceCreateDeviceWithHttpInfo(ScreenDevice screenDevice) async { + // Verify required params are set. + if (screenDevice == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: screenDevice'); + } + + final path = r'/api/device/screen'; + + Object postBody = screenDevice; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [ScreenDevice] screenDevice (required): + Future screenDeviceCreateDevice(ScreenDevice screenDevice) async { + final response = await screenDeviceCreateDeviceWithHttpInfo(screenDevice); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/device/screen/{deviceId}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] deviceId (required): + Future screenDeviceDeleteDeviceWithHttpInfo(String deviceId) async { + // Verify required params are set. + if (deviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceId'); + } + + final path = r'/api/device/screen/{deviceId}' + .replaceAll('{' + 'deviceId' + '}', deviceId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] deviceId (required): + Future screenDeviceDeleteDevice(String deviceId) async { + final response = await screenDeviceDeleteDeviceWithHttpInfo(deviceId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Performs an HTTP 'GET /api/device/screen' operation and returns the [Response]. + Future screenDeviceGetAllScreenDevicesWithHttpInfo() async { + final path = r'/api/device/screen'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + Future> screenDeviceGetAllScreenDevices() async { + final response = await screenDeviceGetAllScreenDevicesWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Performs an HTTP 'GET /api/device/screen/{screenDeviceId}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] screenDeviceId (required): + /// Id of the screen device you want to get information + Future screenDeviceGetDeviceInfoWithHttpInfo(String screenDeviceId) async { + // Verify required params are set. + if (screenDeviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: screenDeviceId'); + } + + final path = r'/api/device/screen/{screenDeviceId}' + .replaceAll('{' + 'screenDeviceId' + '}', screenDeviceId.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] screenDeviceId (required): + /// Id of the screen device you want to get information + Future screenDeviceGetDeviceInfo(String screenDeviceId) async { + final response = await screenDeviceGetDeviceInfoWithHttpInfo(screenDeviceId); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'ScreenDevice') as ScreenDevice; + } + return Future.value(null); + } + + /// Performs an HTTP 'PUT /api/device/screen/{screenDeviceId}' operation and returns the [Response]. + /// Parameters: + /// + /// * [int] screenDeviceId (required): + /// + /// * [ScreenDevice] screenDevice (required): + Future screenDeviceUpdateDeviceWithHttpInfo(int screenDeviceId, ScreenDevice screenDevice) async { + // Verify required params are set. + if (screenDeviceId == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: screenDeviceId'); + } + if (screenDevice == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: screenDevice'); + } + + final path = r'/api/device/screen/{screenDeviceId}' + .replaceAll('{' + 'screenDeviceId' + '}', screenDeviceId.toString()); + + Object postBody = screenDevice; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [int] screenDeviceId (required): + /// + /// * [ScreenDevice] screenDevice (required): + Future screenDeviceUpdateDevice(int screenDeviceId, ScreenDevice screenDevice) async { + final response = await screenDeviceUpdateDeviceWithHttpInfo(screenDeviceId, screenDevice); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/token_api.dart b/mycore_api/lib/api/token_api.dart new file mode 100644 index 0000000..ac72635 --- /dev/null +++ b/mycore_api/lib/api/token_api.dart @@ -0,0 +1,143 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class TokenApi { + TokenApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/token' operation and returns the [Response]. + /// Parameters: + /// + /// * [LoginDTO] loginDTO (required): + Future tokenConnectUserWithHttpInfo(LoginDTO loginDTO) async { + // Verify required params are set. + if (loginDTO == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: loginDTO'); + } + + final path = r'/api/token'; + + Object postBody = loginDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [LoginDTO] loginDTO (required): + Future tokenConnectUser(LoginDTO loginDTO) async { + final response = await tokenConnectUserWithHttpInfo(loginDTO); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'UserInfo') as UserInfo; + } + return Future.value(null); + } + + /// Performs an HTTP 'POST /token' operation and returns the [Response]. + /// Parameters: + /// + /// * [User] user (required): + Future tokenCreateWithHttpInfo(User user) async { + // Verify required params are set. + if (user == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: user'); + } + + final path = r'/token'; + + Object postBody = user; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [User] user (required): + Future tokenCreate(User user) async { + final response = await tokenCreateWithHttpInfo(user); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/twitter_api.dart b/mycore_api/lib/api/twitter_api.dart new file mode 100644 index 0000000..426572c --- /dev/null +++ b/mycore_api/lib/api/twitter_api.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class TwitterApi { + TwitterApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /twitter' operation and returns the [Response]. + /// Parameters: + /// + /// * [TwitterAuthModel] twitterAuthModel (required): + Future twitterCreateWithHttpInfo(TwitterAuthModel twitterAuthModel) async { + // Verify required params are set. + if (twitterAuthModel == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: twitterAuthModel'); + } + + final path = r'/twitter'; + + Object postBody = twitterAuthModel; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [TwitterAuthModel] twitterAuthModel (required): + Future twitterCreate(TwitterAuthModel twitterAuthModel) async { + final response = await twitterCreateWithHttpInfo(twitterAuthModel); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/user_api.dart b/mycore_api/lib/api/user_api.dart new file mode 100644 index 0000000..9c01f91 --- /dev/null +++ b/mycore_api/lib/api/user_api.dart @@ -0,0 +1,333 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class UserApi { + UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'POST /api/user' operation and returns the [Response]. + /// Parameters: + /// + /// * [UserInfo] userInfo (required): + Future userCreateUserWithHttpInfo(UserInfo userInfo) async { + // Verify required params are set. + if (userInfo == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userInfo'); + } + + final path = r'/api/user'; + + Object postBody = userInfo; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [UserInfo] userInfo (required): + Future userCreateUser(UserInfo userInfo) async { + final response = await userCreateUserWithHttpInfo(userInfo); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'UserInfoDetailDTO') as UserInfoDetailDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'DELETE /api/user/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] id (required): + Future userDeleteUserWithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/user/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] id (required): + Future userDeleteUser(String id) async { + final response = await userDeleteUserWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Get a list of user + /// + /// Note: This method returns the HTTP [Response]. + Future userGetWithHttpInfo() async { + final path = r'/api/user'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get a list of user + Future userGet() async { + final response = await userGetWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; + } + return Future.value(null); + } + + /// Get a specific user + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] id (required): + /// id user + Future userGet2WithHttpInfo(String id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/user/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Get a specific user + /// + /// Parameters: + /// + /// * [String] id (required): + /// id user + Future userGet2(String id) async { + final response = await userGet2WithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'UserInfoDetailDTO') as UserInfoDetailDTO; + } + return Future.value(null); + } + + /// Performs an HTTP 'PUT /api/user' operation and returns the [Response]. + /// Parameters: + /// + /// * [UserInfo] userInfo (required): + Future userUpdateUserWithHttpInfo(UserInfo userInfo) async { + // Verify required params are set. + if (userInfo == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: userInfo'); + } + + final path = r'/api/user'; + + Object postBody = userInfo; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [UserInfo] userInfo (required): + Future userUpdateUser(UserInfo userInfo) async { + final response = await userUpdateUserWithHttpInfo(userInfo); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'UserInfoDetailDTO') as UserInfoDetailDTO; + } + return Future.value(null); + } +} diff --git a/mycore_api/lib/api/values_api.dart b/mycore_api/lib/api/values_api.dart new file mode 100644 index 0000000..1a6b1f1 --- /dev/null +++ b/mycore_api/lib/api/values_api.dart @@ -0,0 +1,315 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class ValuesApi { + ValuesApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'DELETE /api/test/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [int] id (required): + Future valuesDeleteWithHttpInfo(int id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/test/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [int] id (required): + Future valuesDelete(int id) async { + final response = await valuesDeleteWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + } + + /// Performs an HTTP 'GET /api/test/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [int] id (required): + Future valuesGetWithHttpInfo(int id) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + + final path = r'/api/test/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [int] id (required): + Future valuesGet(int id) async { + final response = await valuesGetWithHttpInfo(id); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; + } + return Future.value(null); + } + + /// It's a test ! :) + /// + /// Note: This method returns the HTTP [Response]. + Future valuesGetAllWithHttpInfo() async { + final path = r'/api/test'; + + Object postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = []; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// It's a test ! :) + Future> valuesGetAll() async { + final response = await valuesGetAllWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) { + return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) + .cast() + .toList(growable: false); + } + return Future>.value(null); + } + + /// Performs an HTTP 'POST /api/test' operation and returns the [Response]. + /// Parameters: + /// + /// * [String] body (required): + Future valuesPostWithHttpInfo(String body) async { + // Verify required params are set. + if (body == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: body'); + } + + final path = r'/api/test'; + + Object postBody = body; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [String] body (required): + Future valuesPost(String body) async { + final response = await valuesPostWithHttpInfo(body); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + } + + /// Performs an HTTP 'PUT /api/test/{id}' operation and returns the [Response]. + /// Parameters: + /// + /// * [int] id (required): + /// + /// * [String] body (required): + Future valuesPutWithHttpInfo(int id, String body) async { + // Verify required params are set. + if (id == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: id'); + } + if (body == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: body'); + } + + final path = r'/api/test/{id}' + .replaceAll('{' + 'id' + '}', id.toString()); + + Object postBody = body; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + final contentTypes = ['application/json']; + final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + final authNames = ['bearer']; + + if ( + nullableContentType != null && + nullableContentType.toLowerCase().startsWith('multipart/form-data') + ) { + bool hasFields = false; + final mp = MultipartRequest(null, null); + if (hasFields) { + postBody = mp; + } + } else { + } + + return await apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + nullableContentType, + authNames, + ); + } + + /// Parameters: + /// + /// * [int] id (required): + /// + /// * [String] body (required): + Future valuesPut(int id, String body) async { + final response = await valuesPutWithHttpInfo(id, body); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, _decodeBodyBytes(response)); + } + } +} diff --git a/mycore_api/lib/api_client.dart b/mycore_api/lib/api_client.dart new file mode 100644 index 0000000..5c1de36 --- /dev/null +++ b/mycore_api/lib/api_client.dart @@ -0,0 +1,330 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ApiClient { + ApiClient({this.basePath = 'http://192.168.31.140', deserializeDelegate}) { + // Setup authentications (key: authentication name, value: authentication). + _authentications[r'bearer'] = OAuth(accessToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZW1haWwuYmUiLCJuYmYiOjE2MTY3MDY1MzcsImV4cCI6MTYyMTg5MDUzNywiaWF0IjoxNjE2NzA2NTM3fQ.pY5XM2QqoIOGtnfYfvG8a5IxkmRPKDYsRGeBwMnVrfM"); + } + + final String basePath; + + var _client = Client(); + + /// Returns the current HTTP [Client] instance to use in this class. + /// + /// The return value is guaranteed to never be null. + Client get client => _client; + + /// Requests to use a new HTTP [Client] in this class. + /// + /// If the [newClient] is null, an [ArgumentError] is thrown. + set client(Client newClient) { + if (newClient == null) { + throw ArgumentError('New client instance cannot be null.'); + } + _client = newClient; + } + + final _defaultHeaderMap = {}; + final _authentications = {}; + + void addDefaultHeader(String key, String value) { + _defaultHeaderMap[key] = value; + } + + Map get defaultHeaderMap => _defaultHeaderMap; + + /// returns an unmodifiable view of the authentications, since none should be added + /// nor deleted + Map get authentications => + Map.unmodifiable(_authentications); + + T getAuthentication(String name) { + final authentication = _authentications[name]; + return authentication is T ? authentication : null; + } + + // We don’t use a Map for queryParams. + // If collectionFormat is 'multi', a key might appear multiple times. + Future invokeAPI( + String path, + String method, + Iterable queryParams, + Object body, + Map headerParams, + Map formParams, + String nullableContentType, + List authNames, + ) async { + _updateParamsForAuth(authNames, queryParams, headerParams); + + headerParams.addAll(_defaultHeaderMap); + + final urlEncodedQueryParams = queryParams + .where((param) => param.value != null) + .map((param) => '$param'); + + final queryString = urlEncodedQueryParams.isNotEmpty + ? '?${urlEncodedQueryParams.join('&')}' + : ''; + + final url = '$basePath$path$queryString'; + + if (nullableContentType != null) { + headerParams['Content-Type'] = nullableContentType; + } + + try { + // Special case for uploading a single file which isn’t a 'multipart/form-data'. + if ( + body is MultipartFile && (nullableContentType == null || + !nullableContentType.toLowerCase().startsWith('multipart/form-data')) + ) { + final request = StreamedRequest(method, Uri.parse(url)); + request.headers.addAll(headerParams); + request.contentLength = body.length; + body.finalize().listen( + request.sink.add, + onDone: request.sink.close, + onError: (error, trace) => request.sink.close(), + cancelOnError: true, + ); + final response = await _client.send(request); + return Response.fromStream(response); + } + + if (body is MultipartRequest) { + final request = MultipartRequest(method, Uri.parse(url)); + request.fields.addAll(body.fields); + request.files.addAll(body.files); + request.headers.addAll(body.headers); + request.headers.addAll(headerParams); + final response = await _client.send(request); + return Response.fromStream(response); + } + + final msgBody = nullableContentType == 'application/x-www-form-urlencoded' + ? formParams + : serialize(body); + final nullableHeaderParams = headerParams.isEmpty ? null : headerParams; + + switch(method) { + case 'POST': return await _client.post(url, headers: nullableHeaderParams, body: msgBody,); + case 'PUT': return await _client.put(url, headers: nullableHeaderParams, body: msgBody,); + case 'DELETE': return await _client.delete(url, headers: nullableHeaderParams,); + case 'PATCH': return await _client.patch(url, headers: nullableHeaderParams, body: msgBody,); + case 'HEAD': return await _client.head(url, headers: nullableHeaderParams,); + case 'GET': return await _client.get(url, headers: nullableHeaderParams,); + } + } on SocketException catch (e, trace) { + throw ApiException.withInner(HttpStatus.badRequest, 'Socket operation failed: $method $path', e, trace,); + } on TlsException catch (e, trace) { + throw ApiException.withInner(HttpStatus.badRequest, 'TLS/SSL communication failed: $method $path', e, trace,); + } on IOException catch (e, trace) { + throw ApiException.withInner(HttpStatus.badRequest, 'I/O operation failed: $method $path', e, trace,); + } on ClientException catch (e, trace) { + throw ApiException.withInner(HttpStatus.badRequest, 'HTTP connection failed: $method $path', e, trace,); + } on Exception catch (e, trace) { + throw ApiException.withInner(HttpStatus.badRequest, 'Exception occurred: $method $path', e, trace,); + } + + throw ApiException(HttpStatus.badRequest, 'Invalid HTTP operation: $method $path',); + } + + dynamic _deserialize(dynamic value, String targetType, {bool growable}) { + try { + switch (targetType) { + case 'String': + return '$value'; + case 'int': + return value is int ? value : int.parse('$value'); + case 'bool': + if (value is bool) { + return value; + } + final valueString = '$value'.toLowerCase(); + return valueString == 'true' || valueString == '1'; + break; + case 'double': + return value is double ? value : double.parse('$value'); + case 'Action': + return Action.fromJson(value); + case 'ActionType': + return ActionTypeTypeTransformer().decode(value); + + case 'Automation': + return Automation.fromJson(value); + case 'AutomationCreateOrUpdateDetailDTO': + return AutomationCreateOrUpdateDetailDTO.fromJson(value); + case 'AutomationCreateOrUpdateDetailDTOAllOf': + return AutomationCreateOrUpdateDetailDTOAllOf.fromJson(value); + case 'AutomationDTO': + return AutomationDTO.fromJson(value); + case 'AutomationDetailDTO': + return AutomationDetailDTO.fromJson(value); + case 'AutomationDetailDTOAllOf': + return AutomationDetailDTOAllOf.fromJson(value); + case 'AzureADAuthModel': + return AzureADAuthModel.fromJson(value); + case 'Book': + return Book.fromJson(value); + case 'Condition': + return Condition.fromJson(value); + case 'ConditionType': + return ConditionTypeTypeTransformer().decode(value); + + case 'ConditionValue': + return ConditionValueTypeTransformer().decode(value); + + case 'ConnectionStatus': + return ConnectionStatusTypeTransformer().decode(value); + + case 'Device': + return Device.fromJson(value); + case 'DeviceDetailDTO': + return DeviceDetailDTO.fromJson(value); + case 'DeviceDetailDTOAllOf': + return DeviceDetailDTOAllOf.fromJson(value); + case 'DeviceSummaryDTO': + return DeviceSummaryDTO.fromJson(value); + case 'DeviceType': + return DeviceTypeTypeTransformer().decode(value); + + case 'ElectricityProduction': + return ElectricityProduction.fromJson(value); + case 'FacebookAuthModel': + return FacebookAuthModel.fromJson(value); + case 'GoogleAuthModel': + return GoogleAuthModel.fromJson(value); + case 'Group': + return Group.fromJson(value); + case 'GroupCreateOrUpdateDetailDTO': + return GroupCreateOrUpdateDetailDTO.fromJson(value); + case 'GroupCreateOrUpdateDetailDTOAllOf': + return GroupCreateOrUpdateDetailDTOAllOf.fromJson(value); + case 'GroupDetailDTO': + return GroupDetailDTO.fromJson(value); + case 'GroupDetailDTOAllOf': + return GroupDetailDTOAllOf.fromJson(value); + case 'GroupSummaryDTO': + return GroupSummaryDTO.fromJson(value); + case 'LocationDTO': + return LocationDTO.fromJson(value); + case 'LoginDTO': + return LoginDTO.fromJson(value); + case 'MeansOfCommunication': + return MeansOfCommunicationTypeTransformer().decode(value); + + case 'MqttMessageDTO': + return MqttMessageDTO.fromJson(value); + case 'OddH2H': + return OddH2H.fromJson(value); + case 'OddNice': + return OddNice.fromJson(value); + case 'PanelMenuItem': + return PanelMenuItem.fromJson(value); + case 'PanelSection': + return PanelSection.fromJson(value); + case 'Provider': + return Provider.fromJson(value); + case 'ProviderDTO': + return ProviderDTO.fromJson(value); + case 'RoomCreateOrUpdateDetailDTO': + return RoomCreateOrUpdateDetailDTO.fromJson(value); + case 'RoomDetailDTO': + return RoomDetailDTO.fromJson(value); + case 'RoomSummaryDTO': + return RoomSummaryDTO.fromJson(value); + case 'ScreenConfiguration': + return ScreenConfiguration.fromJson(value); + case 'ScreenDevice': + return ScreenDevice.fromJson(value); + case 'SmartGardenMessage': + return SmartGardenMessage.fromJson(value); + case 'SmartPrinterMessage': + return SmartPrinterMessage.fromJson(value); + case 'State': + return StateAPI.fromJson(value); + case 'Trigger': + return Trigger.fromJson(value); + case 'TriggerType': + return TriggerTypeTypeTransformer().decode(value); + + case 'TwitterAuthModel': + return TwitterAuthModel.fromJson(value); + case 'User': + return User.fromJson(value); + case 'UserInfo': + return UserInfo.fromJson(value); + case 'UserInfoDetailDTO': + return UserInfoDetailDTO.fromJson(value); + case 'ViewBy': + return ViewByTypeTransformer().decode(value); + + case 'Widget': + return WidgetAPI.fromJson(value); + default: + Match match; + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + final newTargetType = match[1]; + return value + .map((v) => _deserialize(v, newTargetType, growable: growable)) + .toList(growable: true == growable); + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + final newTargetType = match[1]; + return value + .map((v) => _deserialize(v, newTargetType, growable: growable)) + .toSet(); + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + final newTargetType = match[1]; + return Map.fromIterables( + value.keys, + value.values.map((v) => _deserialize(v, newTargetType, growable: growable)), + ); + } + break; + } + } on Exception catch (e, stack) { + throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', e, stack,); + } + throw ApiException(HttpStatus.internalServerError, 'Could not find a suitable class for deserialization',); + } + + dynamic deserialize(String json, String targetType, {bool growable}) { + // Remove all spaces. Necessary for reg expressions as well. + targetType = targetType.replaceAll(' ', ''); + + return targetType == 'String' + ? json + : _deserialize(jsonDecode(json), targetType, growable: true == growable); + } + + String serialize(Object obj) => obj == null ? '' : json.encode(obj); + + /// Update query and header parameters based on authentication settings. + /// @param authNames The authentications to apply + void _updateParamsForAuth( + List authNames, + List queryParams, + Map headerParams, + ) { + authNames.forEach((authName) { + final auth = _authentications[authName]; + if (auth == null) { + throw ArgumentError('Authentication undefined: $authName'); + } + auth.applyToParams(queryParams, headerParams); + }); + } +} diff --git a/mycore_api/lib/api_exception.dart b/mycore_api/lib/api_exception.dart new file mode 100644 index 0000000..1537c97 --- /dev/null +++ b/mycore_api/lib/api_exception.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ApiException implements Exception { + ApiException(this.code, this.message); + + ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace); + + int code = 0; + String message; + Exception innerException; + StackTrace stackTrace; + + String toString() { + if (message == null) { + return 'ApiException'; + } + if (innerException == null) { + return 'ApiException $code: $message'; + } + return 'ApiException $code: $message (Inner exception: $innerException)\n\n$stackTrace'; + } +} diff --git a/mycore_api/lib/api_helper.dart b/mycore_api/lib/api_helper.dart new file mode 100644 index 0000000..23aae53 --- /dev/null +++ b/mycore_api/lib/api_helper.dart @@ -0,0 +1,95 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class QueryParam { + const QueryParam(this.name, this.value); + + final String name; + final String value; + + @override + String toString() => '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}'; +} + +// Ported from the Java version. +Iterable _convertParametersForCollectionFormat( + String collectionFormat, + String name, + dynamic value, +) { + final params = []; + + // preconditions + if (name != null && !name.isEmpty && value != null) { + if (value is List) { + // get the collection format, default: csv + collectionFormat = (collectionFormat == null || collectionFormat.isEmpty) + ? 'csv' + : collectionFormat; + + if (collectionFormat == 'multi') { + return value.map((v) => QueryParam(name, parameterToString(v))); + } + + final delimiter = _delimiters[collectionFormat] ?? ','; + + params.add(QueryParam(name, value.map((v) => parameterToString(v)).join(delimiter))); + } else { + params.add(QueryParam(name, parameterToString(value))); + } + } + + return params; +} + +/// Format the given parameter object into a [String]. +String parameterToString(dynamic value) { + if (value == null) { + return ''; + } + if (value is DateTime) { + return value.toUtc().toIso8601String(); + } + if (value is ActionType) { + return ActionTypeTypeTransformer().encode(value).toString(); + } + if (value is ConditionType) { + return ConditionTypeTypeTransformer().encode(value).toString(); + } + if (value is ConditionValue) { + return ConditionValueTypeTransformer().encode(value).toString(); + } + if (value is ConnectionStatus) { + return ConnectionStatusTypeTransformer().encode(value).toString(); + } + if (value is DeviceType) { + return DeviceTypeTypeTransformer().encode(value).toString(); + } + if (value is MeansOfCommunication) { + return MeansOfCommunicationTypeTransformer().encode(value).toString(); + } + if (value is TriggerType) { + return TriggerTypeTypeTransformer().encode(value).toString(); + } + if (value is ViewBy) { + return ViewByTypeTransformer().encode(value).toString(); + } + return value.toString(); +} + +/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' +/// content type. Otherwise, returns the decoded body as decoded by dart:http package. +String _decodeBodyBytes(Response response) { + final contentType = response.headers['content-type']; + return contentType != null && contentType.toLowerCase().startsWith('application/json') + ? response.bodyBytes == null ? null : utf8.decode(response.bodyBytes) + : response.body; +} diff --git a/mycore_api/lib/auth/api_key_auth.dart b/mycore_api/lib/auth/api_key_auth.dart new file mode 100644 index 0000000..41a4afd --- /dev/null +++ b/mycore_api/lib/auth/api_key_auth.dart @@ -0,0 +1,35 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ApiKeyAuth implements Authentication { + ApiKeyAuth(this.location, this.paramName); + + final String location; + final String paramName; + + String apiKeyPrefix; + String apiKey; + + @override + void applyToParams(List queryParams, Map headerParams) { + final value = apiKeyPrefix == null ? apiKey : '$apiKeyPrefix $apiKey'; + + if (location == 'query' && value != null) { + queryParams.add(QueryParam(paramName, value)); + } else if (location == 'header' && value != null) { + headerParams[paramName] = value; + } else if (location == 'cookie' && value != null) { + headerParams.update('Cookie', (String existingCookie) { + return '$existingCookie; $paramName=$value'; + }, ifAbsent: () => '$paramName=$value'); + } + } +} diff --git a/mycore_api/lib/auth/authentication.dart b/mycore_api/lib/auth/authentication.dart new file mode 100644 index 0000000..5ca198d --- /dev/null +++ b/mycore_api/lib/auth/authentication.dart @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +abstract class Authentication { + /// Apply authentication settings to header and query params. + void applyToParams(List queryParams, Map headerParams); +} diff --git a/mycore_api/lib/auth/http_basic_auth.dart b/mycore_api/lib/auth/http_basic_auth.dart new file mode 100644 index 0000000..6dc36a1 --- /dev/null +++ b/mycore_api/lib/auth/http_basic_auth.dart @@ -0,0 +1,21 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class HttpBasicAuth implements Authentication { + String username; + String password; + + @override + void applyToParams(List queryParams, Map headerParams) { + final credentials = (username ?? '') + ':' + (password ?? ''); + headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; + } +} diff --git a/mycore_api/lib/auth/http_bearer_auth.dart b/mycore_api/lib/auth/http_bearer_auth.dart new file mode 100644 index 0000000..a23b65f --- /dev/null +++ b/mycore_api/lib/auth/http_bearer_auth.dart @@ -0,0 +1,38 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +typedef HttpBearerAuthProvider = String Function(); + +class HttpBearerAuth implements Authentication { + HttpBearerAuth(); + + dynamic _accessToken; + + dynamic get accessToken => _accessToken; + + set accessToken(dynamic accessToken) { + if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { + throw ArgumentError('Type of Bearer accessToken should be a String or a String Function().'); + } + this._accessToken = accessToken; + } + + @override + void applyToParams(List queryParams, Map headerParams) { + if (_accessToken is String) { + headerParams['Authorization'] = 'Bearer $_accessToken'; + } else if (_accessToken is HttpBearerAuthProvider) { + headerParams['Authorization'] = 'Bearer ${_accessToken()}'; + } else { + throw ArgumentError('Type of Bearer accessToken should be a String or a String Function().'); + } + } +} diff --git a/mycore_api/lib/auth/oauth.dart b/mycore_api/lib/auth/oauth.dart new file mode 100644 index 0000000..c0463ad --- /dev/null +++ b/mycore_api/lib/auth/oauth.dart @@ -0,0 +1,23 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class OAuth implements Authentication { + OAuth({this.accessToken}); + + String accessToken; + + @override + void applyToParams(List queryParams, Map headerParams) { + if (accessToken != null) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/mycore_api/lib/model/action.dart b/mycore_api/lib/model/action.dart new file mode 100644 index 0000000..085280a --- /dev/null +++ b/mycore_api/lib/model/action.dart @@ -0,0 +1,116 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class Action { + /// Returns a new [Action] instance. + Action({ + this.groupId, + this.deviceId, + this.states, + this.rawRequest, + this.providerId, + this.type, + }); + + String groupId; + + String deviceId; + + List states; + + String rawRequest; + + String providerId; + + ActionType type; + + @override + bool operator ==(Object other) => identical(this, other) || other is Action && + other.groupId == groupId && + other.deviceId == deviceId && + other.states == states && + other.rawRequest == rawRequest && + other.providerId == providerId && + other.type == type; + + @override + int get hashCode => + (groupId == null ? 0 : groupId.hashCode) + + (deviceId == null ? 0 : deviceId.hashCode) + + (states == null ? 0 : states.hashCode) + + (rawRequest == null ? 0 : rawRequest.hashCode) + + (providerId == null ? 0 : providerId.hashCode) + + (type == null ? 0 : type.hashCode); + + @override + String toString() => 'Action[groupId=$groupId, deviceId=$deviceId, states=$states, rawRequest=$rawRequest, providerId=$providerId, type=$type]'; + + Map toJson() { + final json = {}; + if (groupId != null) { + json[r'groupId'] = groupId; + } + if (deviceId != null) { + json[r'deviceId'] = deviceId; + } + if (states != null) { + json[r'states'] = states; + } + if (rawRequest != null) { + json[r'rawRequest'] = rawRequest; + } + if (providerId != null) { + json[r'providerId'] = providerId; + } + if (type != null) { + json[r'type'] = type; + } + return json; + } + + /// Returns a new [Action] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Action fromJson(Map json) => json == null + ? null + : Action( + groupId: json[r'groupId'], + deviceId: json[r'deviceId'], + states: StateAPI.listFromJson(json[r'states']), + rawRequest: json[r'rawRequest'], + providerId: json[r'providerId'], + type: ActionType.fromJson(json[r'type']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Action.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = Action.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Action-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = Action.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/action_type.dart b/mycore_api/lib/model/action_type.dart new file mode 100644 index 0000000..33387c8 --- /dev/null +++ b/mycore_api/lib/model/action_type.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class ActionType { + /// Instantiate a new enum with the provided [value]. + const ActionType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const DELAY = ActionType._(r'DELAY'); + static const DEVICE = ActionType._(r'DEVICE'); + static const HTTP = ActionType._(r'HTTP'); + static const zIGBEE2MQTT = ActionType._(r'ZIGBEE2MQTT'); + static const MQTT = ActionType._(r'MQTT'); + static const GROUP = ActionType._(r'GROUP'); + + /// List of all possible values in this [enum][ActionType]. + static const values = [ + DELAY, + DEVICE, + HTTP, + zIGBEE2MQTT, + MQTT, + GROUP, + ]; + + static ActionType fromJson(dynamic value) => + ActionTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ActionType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ActionType] to String, +/// and [decode] dynamic data back to [ActionType]. +class ActionTypeTypeTransformer { + const ActionTypeTypeTransformer._(); + + factory ActionTypeTypeTransformer() => _instance ??= ActionTypeTypeTransformer._(); + + String encode(ActionType data) => data.value; + + /// Decodes a [dynamic value][data] to a ActionType. + /// + /// 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. + ActionType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'DELAY': return ActionType.DELAY; + case r'DEVICE': return ActionType.DEVICE; + case r'HTTP': return ActionType.HTTP; + case r'ZIGBEE2MQTT': return ActionType.zIGBEE2MQTT; + case r'MQTT': return ActionType.MQTT; + case r'GROUP': return ActionType.GROUP; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ActionTypeTypeTransformer] instance. + static ActionTypeTypeTransformer _instance; +} diff --git a/mycore_api/lib/model/automation.dart b/mycore_api/lib/model/automation.dart new file mode 100644 index 0000000..91bb5cd --- /dev/null +++ b/mycore_api/lib/model/automation.dart @@ -0,0 +1,149 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class Automation { + /// Returns a new [Automation] instance. + Automation({ + this.id, + this.userId, + this.name, + this.createdDate, + this.updatedDate, + this.triggers, + this.conditions, + this.actions, + this.devicesIds, + }); + + String id; + + String userId; + + String name; + + DateTime createdDate; + + DateTime updatedDate; + + List triggers; + + List conditions; + + List actions; + + List devicesIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is Automation && + other.id == id && + other.userId == userId && + other.name == name && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.triggers == triggers && + other.conditions == conditions && + other.actions == actions && + other.devicesIds == devicesIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (name == null ? 0 : name.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (triggers == null ? 0 : triggers.hashCode) + + (conditions == null ? 0 : conditions.hashCode) + + (actions == null ? 0 : actions.hashCode) + + (devicesIds == null ? 0 : devicesIds.hashCode); + + @override + String toString() => 'Automation[id=$id, userId=$userId, name=$name, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (name != null) { + json[r'name'] = name; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (conditions != null) { + json[r'conditions'] = conditions; + } + if (actions != null) { + json[r'actions'] = actions; + } + if (devicesIds != null) { + json[r'devicesIds'] = devicesIds; + } + return json; + } + + /// Returns a new [Automation] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Automation fromJson(Map json) => json == null + ? null + : Automation( + id: json[r'id'], + userId: json[r'userId'], + name: json[r'name'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + triggers: Trigger.listFromJson(json[r'triggers']), + conditions: Condition.listFromJson(json[r'conditions']), + actions: Action.listFromJson(json[r'actions']), + devicesIds: json[r'devicesIds'] == null + ? null + : (json[r'devicesIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Automation.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = Automation.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Automation-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = Automation.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/automation_create_or_update_detail_dto.dart b/mycore_api/lib/model/automation_create_or_update_detail_dto.dart new file mode 100644 index 0000000..32ff3a1 --- /dev/null +++ b/mycore_api/lib/model/automation_create_or_update_detail_dto.dart @@ -0,0 +1,149 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AutomationCreateOrUpdateDetailDTO { + /// Returns a new [AutomationCreateOrUpdateDetailDTO] instance. + AutomationCreateOrUpdateDetailDTO({ + this.id, + this.name, + this.userId, + this.createdDate, + this.updatedDate, + this.triggers, + this.conditions, + this.actions, + this.deviceIds, + }); + + String id; + + String name; + + String userId; + + DateTime createdDate; + + DateTime updatedDate; + + List triggers; + + List conditions; + + List actions; + + List deviceIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is AutomationCreateOrUpdateDetailDTO && + other.id == id && + other.name == name && + other.userId == userId && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.triggers == triggers && + other.conditions == conditions && + other.actions == actions && + other.deviceIds == deviceIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (triggers == null ? 0 : triggers.hashCode) + + (conditions == null ? 0 : conditions.hashCode) + + (actions == null ? 0 : actions.hashCode) + + (deviceIds == null ? 0 : deviceIds.hashCode); + + @override + String toString() => 'AutomationCreateOrUpdateDetailDTO[id=$id, name=$name, userId=$userId, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, conditions=$conditions, actions=$actions, deviceIds=$deviceIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (conditions != null) { + json[r'conditions'] = conditions; + } + if (actions != null) { + json[r'actions'] = actions; + } + if (deviceIds != null) { + json[r'deviceIds'] = deviceIds; + } + return json; + } + + /// Returns a new [AutomationCreateOrUpdateDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AutomationCreateOrUpdateDetailDTO fromJson(Map json) => json == null + ? null + : AutomationCreateOrUpdateDetailDTO( + id: json[r'id'], + name: json[r'name'], + userId: json[r'userId'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + triggers: Trigger.listFromJson(json[r'triggers']), + conditions: Condition.listFromJson(json[r'conditions']), + actions: Action.listFromJson(json[r'actions']), + deviceIds: json[r'deviceIds'] == null + ? null + : (json[r'deviceIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AutomationCreateOrUpdateDetailDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = AutomationCreateOrUpdateDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AutomationCreateOrUpdateDetailDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = AutomationCreateOrUpdateDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/automation_create_or_update_detail_dto_all_of.dart b/mycore_api/lib/model/automation_create_or_update_detail_dto_all_of.dart new file mode 100644 index 0000000..25450eb --- /dev/null +++ b/mycore_api/lib/model/automation_create_or_update_detail_dto_all_of.dart @@ -0,0 +1,100 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AutomationCreateOrUpdateDetailDTOAllOf { + /// Returns a new [AutomationCreateOrUpdateDetailDTOAllOf] instance. + AutomationCreateOrUpdateDetailDTOAllOf({ + this.triggers, + this.conditions, + this.actions, + this.deviceIds, + }); + + List triggers; + + List conditions; + + List actions; + + List deviceIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is AutomationCreateOrUpdateDetailDTOAllOf && + other.triggers == triggers && + other.conditions == conditions && + other.actions == actions && + other.deviceIds == deviceIds; + + @override + int get hashCode => + (triggers == null ? 0 : triggers.hashCode) + + (conditions == null ? 0 : conditions.hashCode) + + (actions == null ? 0 : actions.hashCode) + + (deviceIds == null ? 0 : deviceIds.hashCode); + + @override + String toString() => 'AutomationCreateOrUpdateDetailDTOAllOf[triggers=$triggers, conditions=$conditions, actions=$actions, deviceIds=$deviceIds]'; + + Map toJson() { + final json = {}; + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (conditions != null) { + json[r'conditions'] = conditions; + } + if (actions != null) { + json[r'actions'] = actions; + } + if (deviceIds != null) { + json[r'deviceIds'] = deviceIds; + } + return json; + } + + /// Returns a new [AutomationCreateOrUpdateDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AutomationCreateOrUpdateDetailDTOAllOf fromJson(Map json) => json == null + ? null + : AutomationCreateOrUpdateDetailDTOAllOf( + triggers: Trigger.listFromJson(json[r'triggers']), + conditions: Condition.listFromJson(json[r'conditions']), + actions: Action.listFromJson(json[r'actions']), + deviceIds: json[r'deviceIds'] == null + ? null + : (json[r'deviceIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AutomationCreateOrUpdateDetailDTOAllOf.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = AutomationCreateOrUpdateDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AutomationCreateOrUpdateDetailDTOAllOf-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = AutomationCreateOrUpdateDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/automation_detail_dto.dart b/mycore_api/lib/model/automation_detail_dto.dart new file mode 100644 index 0000000..e3f3f9d --- /dev/null +++ b/mycore_api/lib/model/automation_detail_dto.dart @@ -0,0 +1,149 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AutomationDetailDTO { + /// Returns a new [AutomationDetailDTO] instance. + AutomationDetailDTO({ + this.id, + this.name, + this.userId, + this.createdDate, + this.updatedDate, + this.triggers, + this.conditions, + this.actions, + this.devicesIds, + }); + + String id; + + String name; + + String userId; + + DateTime createdDate; + + DateTime updatedDate; + + List triggers; + + List conditions; + + List actions; + + List devicesIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is AutomationDetailDTO && + other.id == id && + other.name == name && + other.userId == userId && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.triggers == triggers && + other.conditions == conditions && + other.actions == actions && + other.devicesIds == devicesIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (triggers == null ? 0 : triggers.hashCode) + + (conditions == null ? 0 : conditions.hashCode) + + (actions == null ? 0 : actions.hashCode) + + (devicesIds == null ? 0 : devicesIds.hashCode); + + @override + String toString() => 'AutomationDetailDTO[id=$id, name=$name, userId=$userId, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (conditions != null) { + json[r'conditions'] = conditions; + } + if (actions != null) { + json[r'actions'] = actions; + } + if (devicesIds != null) { + json[r'devicesIds'] = devicesIds; + } + return json; + } + + /// Returns a new [AutomationDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AutomationDetailDTO fromJson(Map json) => json == null + ? null + : AutomationDetailDTO( + id: json[r'id'], + name: json[r'name'], + userId: json[r'userId'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + triggers: Trigger.listFromJson(json[r'triggers']), + conditions: Condition.listFromJson(json[r'conditions']), + actions: Action.listFromJson(json[r'actions']), + devicesIds: json[r'devicesIds'] == null + ? null + : (json[r'devicesIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AutomationDetailDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = AutomationDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AutomationDetailDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = AutomationDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/automation_detail_dto_all_of.dart b/mycore_api/lib/model/automation_detail_dto_all_of.dart new file mode 100644 index 0000000..155dea7 --- /dev/null +++ b/mycore_api/lib/model/automation_detail_dto_all_of.dart @@ -0,0 +1,100 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AutomationDetailDTOAllOf { + /// Returns a new [AutomationDetailDTOAllOf] instance. + AutomationDetailDTOAllOf({ + this.triggers, + this.conditions, + this.actions, + this.devicesIds, + }); + + List triggers; + + List conditions; + + List actions; + + List devicesIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is AutomationDetailDTOAllOf && + other.triggers == triggers && + other.conditions == conditions && + other.actions == actions && + other.devicesIds == devicesIds; + + @override + int get hashCode => + (triggers == null ? 0 : triggers.hashCode) + + (conditions == null ? 0 : conditions.hashCode) + + (actions == null ? 0 : actions.hashCode) + + (devicesIds == null ? 0 : devicesIds.hashCode); + + @override + String toString() => 'AutomationDetailDTOAllOf[triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds]'; + + Map toJson() { + final json = {}; + if (triggers != null) { + json[r'triggers'] = triggers; + } + if (conditions != null) { + json[r'conditions'] = conditions; + } + if (actions != null) { + json[r'actions'] = actions; + } + if (devicesIds != null) { + json[r'devicesIds'] = devicesIds; + } + return json; + } + + /// Returns a new [AutomationDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AutomationDetailDTOAllOf fromJson(Map json) => json == null + ? null + : AutomationDetailDTOAllOf( + triggers: Trigger.listFromJson(json[r'triggers']), + conditions: Condition.listFromJson(json[r'conditions']), + actions: Action.listFromJson(json[r'actions']), + devicesIds: json[r'devicesIds'] == null + ? null + : (json[r'devicesIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AutomationDetailDTOAllOf.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = AutomationDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AutomationDetailDTOAllOf-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = AutomationDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/automation_dto.dart b/mycore_api/lib/model/automation_dto.dart new file mode 100644 index 0000000..68bed66 --- /dev/null +++ b/mycore_api/lib/model/automation_dto.dart @@ -0,0 +1,111 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AutomationDTO { + /// Returns a new [AutomationDTO] instance. + AutomationDTO({ + this.id, + this.name, + this.userId, + this.createdDate, + this.updatedDate, + }); + + String id; + + String name; + + String userId; + + DateTime createdDate; + + DateTime updatedDate; + + @override + bool operator ==(Object other) => identical(this, other) || other is AutomationDTO && + other.id == id && + other.name == name && + other.userId == userId && + other.createdDate == createdDate && + other.updatedDate == updatedDate; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode); + + @override + String toString() => 'AutomationDTO[id=$id, name=$name, userId=$userId, createdDate=$createdDate, updatedDate=$updatedDate]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [AutomationDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AutomationDTO fromJson(Map json) => json == null + ? null + : AutomationDTO( + id: json[r'id'], + name: json[r'name'], + userId: json[r'userId'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AutomationDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = AutomationDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AutomationDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = AutomationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/azure_ad_auth_model.dart b/mycore_api/lib/model/azure_ad_auth_model.dart new file mode 100644 index 0000000..718d9cb --- /dev/null +++ b/mycore_api/lib/model/azure_ad_auth_model.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AzureADAuthModel { + /// Returns a new [AzureADAuthModel] instance. + AzureADAuthModel({ + this.apiKey, + }); + + String apiKey; + + @override + bool operator ==(Object other) => identical(this, other) || other is AzureADAuthModel && + other.apiKey == apiKey; + + @override + int get hashCode => + (apiKey == null ? 0 : apiKey.hashCode); + + @override + String toString() => 'AzureADAuthModel[apiKey=$apiKey]'; + + Map toJson() { + final json = {}; + if (apiKey != null) { + json[r'apiKey'] = apiKey; + } + return json; + } + + /// Returns a new [AzureADAuthModel] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static AzureADAuthModel fromJson(Map json) => json == null + ? null + : AzureADAuthModel( + apiKey: json[r'apiKey'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => AzureADAuthModel.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = AzureADAuthModel.fromJson(v)); + } + return map; + } + + // maps a json object with a list of AzureADAuthModel-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = AzureADAuthModel.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/book.dart b/mycore_api/lib/model/book.dart new file mode 100644 index 0000000..a36138b --- /dev/null +++ b/mycore_api/lib/model/book.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class Book { + /// Returns a new [Book] instance. + Book({ + this.id, + this.bookName, + this.price, + this.category, + this.author, + }); + + String id; + + String bookName; + + num price; + + String category; + + String author; + + @override + bool operator ==(Object other) => identical(this, other) || other is Book && + other.id == id && + other.bookName == bookName && + other.price == price && + other.category == category && + other.author == author; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (bookName == null ? 0 : bookName.hashCode) + + (price == null ? 0 : price.hashCode) + + (category == null ? 0 : category.hashCode) + + (author == null ? 0 : author.hashCode); + + @override + String toString() => 'Book[id=$id, bookName=$bookName, price=$price, category=$category, author=$author]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (bookName != null) { + json[r'bookName'] = bookName; + } + if (price != null) { + json[r'price'] = price; + } + if (category != null) { + json[r'category'] = category; + } + if (author != null) { + json[r'author'] = author; + } + return json; + } + + /// Returns a new [Book] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Book fromJson(Map json) => json == null + ? null + : Book( + id: json[r'id'], + bookName: json[r'bookName'], + price: json[r'price'] == null ? + null : + json[r'price'].toDouble(), + category: json[r'category'], + author: json[r'author'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Book.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = Book.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Book-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = Book.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/condition.dart b/mycore_api/lib/model/condition.dart new file mode 100644 index 0000000..8fdf70e --- /dev/null +++ b/mycore_api/lib/model/condition.dart @@ -0,0 +1,115 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class Condition { + /// Returns a new [Condition] instance. + Condition({ + this.deviceId, + this.state, + this.startTime, + this.endTime, + this.type, + this.value, + }); + + String deviceId; + + StateAPI state; + + String startTime; + + String endTime; + + ConditionType type; + + ConditionValue value; + + @override + bool operator ==(Object other) => identical(this, other) || other is Condition && + other.deviceId == deviceId && + other.state == state && + other.startTime == startTime && + other.endTime == endTime && + other.type == type && + other.value == value; + + @override + int get hashCode => + (deviceId == null ? 0 : deviceId.hashCode) + + (state == null ? 0 : state.hashCode) + + (startTime == null ? 0 : startTime.hashCode) + + (endTime == null ? 0 : endTime.hashCode) + + (type == null ? 0 : type.hashCode) + + (value == null ? 0 : value.hashCode); + + @override + String toString() => 'Condition[deviceId=$deviceId, state=$state, startTime=$startTime, endTime=$endTime, type=$type, value=$value]'; + + Map toJson() { + final json = {}; + if (deviceId != null) { + json[r'deviceId'] = deviceId; + } + if (state != null) { + json[r'state'] = state; + } + if (startTime != null) { + json[r'startTime'] = startTime; + } + if (endTime != null) { + json[r'endTime'] = endTime; + } + if (type != null) { + json[r'type'] = type; + } + if (value != null) { + json[r'value'] = value; + } + return json; + } + + /// Returns a new [Condition] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Condition fromJson(Map json) => json == null + ? null + : Condition( + deviceId: json[r'deviceId'], + startTime: json[r'startTime'], + endTime: json[r'endTime'], + type: ConditionType.fromJson(json[r'type']), + value: ConditionValue.fromJson(json[r'value']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Condition.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = Condition.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Condition-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = Condition.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/condition_type.dart b/mycore_api/lib/model/condition_type.dart new file mode 100644 index 0000000..f95d569 --- /dev/null +++ b/mycore_api/lib/model/condition_type.dart @@ -0,0 +1,76 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class ConditionType { + /// Instantiate a new enum with the provided [value]. + const ConditionType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const STATE = ConditionType._(r'STATE'); + static const TIME = ConditionType._(r'TIME'); + + /// List of all possible values in this [enum][ConditionType]. + static const values = [ + STATE, + TIME, + ]; + + static ConditionType fromJson(dynamic value) => + ConditionTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ConditionType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ConditionType] to String, +/// and [decode] dynamic data back to [ConditionType]. +class ConditionTypeTypeTransformer { + const ConditionTypeTypeTransformer._(); + + factory ConditionTypeTypeTransformer() => _instance ??= ConditionTypeTypeTransformer._(); + + String encode(ConditionType data) => data.value; + + /// Decodes a [dynamic value][data] to a ConditionType. + /// + /// 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. + ConditionType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'STATE': return ConditionType.STATE; + case r'TIME': return ConditionType.TIME; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ConditionTypeTypeTransformer] instance. + static ConditionTypeTypeTransformer _instance; +} diff --git a/mycore_api/lib/model/condition_value.dart b/mycore_api/lib/model/condition_value.dart new file mode 100644 index 0000000..aa7d9d2 --- /dev/null +++ b/mycore_api/lib/model/condition_value.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class ConditionValue { + /// Instantiate a new enum with the provided [value]. + const ConditionValue._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const EQUAL = ConditionValue._(r'EQUAL'); + static const NOT_EQUAL = ConditionValue._(r'NOT_EQUAL'); + static const BIGGER = ConditionValue._(r'BIGGER'); + static const BIGGEST = ConditionValue._(r'BIGGEST'); + static const SMALLER = ConditionValue._(r'SMALLER'); + static const SMALLEST = ConditionValue._(r'SMALLEST'); + + /// List of all possible values in this [enum][ConditionValue]. + static const values = [ + EQUAL, + NOT_EQUAL, + BIGGER, + BIGGEST, + SMALLER, + SMALLEST, + ]; + + static ConditionValue fromJson(dynamic value) => + ConditionValueTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ConditionValue.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ConditionValue] to String, +/// and [decode] dynamic data back to [ConditionValue]. +class ConditionValueTypeTransformer { + const ConditionValueTypeTransformer._(); + + factory ConditionValueTypeTransformer() => _instance ??= ConditionValueTypeTransformer._(); + + String encode(ConditionValue data) => data.value; + + /// Decodes a [dynamic value][data] to a ConditionValue. + /// + /// 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. + ConditionValue decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'EQUAL': return ConditionValue.EQUAL; + case r'NOT_EQUAL': return ConditionValue.NOT_EQUAL; + case r'BIGGER': return ConditionValue.BIGGER; + case r'BIGGEST': return ConditionValue.BIGGEST; + case r'SMALLER': return ConditionValue.SMALLER; + case r'SMALLEST': return ConditionValue.SMALLEST; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ConditionValueTypeTransformer] instance. + static ConditionValueTypeTransformer _instance; +} diff --git a/mycore_api/lib/model/connection_status.dart b/mycore_api/lib/model/connection_status.dart new file mode 100644 index 0000000..b690d09 --- /dev/null +++ b/mycore_api/lib/model/connection_status.dart @@ -0,0 +1,79 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class ConnectionStatus { + /// Instantiate a new enum with the provided [value]. + const ConnectionStatus._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const connected = ConnectionStatus._(r'Connected'); + static const disconnected = ConnectionStatus._(r'Disconnected'); + static const unknown = ConnectionStatus._(r'Unknown'); + + /// List of all possible values in this [enum][ConnectionStatus]. + static const values = [ + connected, + disconnected, + unknown, + ]; + + static ConnectionStatus fromJson(dynamic value) => + ConnectionStatusTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ConnectionStatus.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ConnectionStatus] to String, +/// and [decode] dynamic data back to [ConnectionStatus]. +class ConnectionStatusTypeTransformer { + const ConnectionStatusTypeTransformer._(); + + factory ConnectionStatusTypeTransformer() => _instance ??= ConnectionStatusTypeTransformer._(); + + String encode(ConnectionStatus data) => data.value; + + /// Decodes a [dynamic value][data] to a ConnectionStatus. + /// + /// 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. + ConnectionStatus decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'Connected': return ConnectionStatus.connected; + case r'Disconnected': return ConnectionStatus.disconnected; + case r'Unknown': return ConnectionStatus.unknown; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ConnectionStatusTypeTransformer] instance. + static ConnectionStatusTypeTransformer _instance; +} diff --git a/mycore_api/lib/model/device.dart b/mycore_api/lib/model/device.dart new file mode 100644 index 0000000..91ce1af --- /dev/null +++ b/mycore_api/lib/model/device.dart @@ -0,0 +1,305 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class Device { + /// Returns a new [Device] instance. + Device({ + this.id, + this.userId, + this.name, + this.description, + this.model, + this.port, + this.firmwareVersion, + this.hardwareVersion, + this.status, + this.type, + this.connectionStatus, + this.locationId, + this.meansOfCommunications, + this.createdDate, + this.updatedDate, + this.lastState, + this.lastStateDate, + this.ipAddress, + this.serviceIdentification, + this.battery, + this.batteryStatus, + this.providerId, + this.manufacturerName, + this.groupIds, + this.properties, + this.supportedOperations, + }); + + String id; + + String userId; + + String name; + + String description; + + String model; + + int port; + + String firmwareVersion; + + String hardwareVersion; + + bool status; + + DeviceType type; + + ConnectionStatus connectionStatus; + + String locationId; + + List meansOfCommunications; + + DateTime createdDate; + + DateTime updatedDate; + + String lastState; + + DateTime lastStateDate; + + String ipAddress; + + String serviceIdentification; + + bool battery; + + int batteryStatus; + + String providerId; + + String manufacturerName; + + List groupIds; + + Map properties; + + List supportedOperations; + + @override + bool operator ==(Object other) => identical(this, other) || other is Device && + other.id == id && + other.userId == userId && + other.name == name && + other.description == description && + other.model == model && + other.port == port && + other.firmwareVersion == firmwareVersion && + other.hardwareVersion == hardwareVersion && + other.status == status && + other.type == type && + other.connectionStatus == connectionStatus && + other.locationId == locationId && + other.meansOfCommunications == meansOfCommunications && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.lastState == lastState && + other.lastStateDate == lastStateDate && + other.ipAddress == ipAddress && + other.serviceIdentification == serviceIdentification && + other.battery == battery && + other.batteryStatus == batteryStatus && + other.providerId == providerId && + other.manufacturerName == manufacturerName && + other.groupIds == groupIds && + other.properties == properties && + other.supportedOperations == supportedOperations; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (name == null ? 0 : name.hashCode) + + (description == null ? 0 : description.hashCode) + + (model == null ? 0 : model.hashCode) + + (port == null ? 0 : port.hashCode) + + (firmwareVersion == null ? 0 : firmwareVersion.hashCode) + + (hardwareVersion == null ? 0 : hardwareVersion.hashCode) + + (status == null ? 0 : status.hashCode) + + (type == null ? 0 : type.hashCode) + + (connectionStatus == null ? 0 : connectionStatus.hashCode) + + (locationId == null ? 0 : locationId.hashCode) + + (meansOfCommunications == null ? 0 : meansOfCommunications.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (lastState == null ? 0 : lastState.hashCode) + + (lastStateDate == null ? 0 : lastStateDate.hashCode) + + (ipAddress == null ? 0 : ipAddress.hashCode) + + (serviceIdentification == null ? 0 : serviceIdentification.hashCode) + + (battery == null ? 0 : battery.hashCode) + + (batteryStatus == null ? 0 : batteryStatus.hashCode) + + (providerId == null ? 0 : providerId.hashCode) + + (manufacturerName == null ? 0 : manufacturerName.hashCode) + + (groupIds == null ? 0 : groupIds.hashCode) + + (properties == null ? 0 : properties.hashCode) + + (supportedOperations == null ? 0 : supportedOperations.hashCode); + + @override + String toString() => 'Device[id=$id, userId=$userId, name=$name, description=$description, model=$model, port=$port, firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, status=$status, type=$type, connectionStatus=$connectionStatus, locationId=$locationId, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastState=$lastState, lastStateDate=$lastStateDate, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, battery=$battery, batteryStatus=$batteryStatus, providerId=$providerId, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (name != null) { + json[r'name'] = name; + } + if (description != null) { + json[r'description'] = description; + } + if (model != null) { + json[r'model'] = model; + } + if (port != null) { + json[r'port'] = port; + } + if (firmwareVersion != null) { + json[r'firmwareVersion'] = firmwareVersion; + } + if (hardwareVersion != null) { + json[r'hardwareVersion'] = hardwareVersion; + } + if (status != null) { + json[r'status'] = status; + } + if (type != null) { + json[r'type'] = type; + } + if (connectionStatus != null) { + json[r'connectionStatus'] = connectionStatus; + } + if (locationId != null) { + json[r'locationId'] = locationId; + } + if (meansOfCommunications != null) { + json[r'meansOfCommunications'] = meansOfCommunications; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (lastState != null) { + json[r'lastState'] = lastState; + } + if (lastStateDate != null) { + json[r'lastStateDate'] = lastStateDate.toUtc().toIso8601String(); + } + if (ipAddress != null) { + json[r'ipAddress'] = ipAddress; + } + if (serviceIdentification != null) { + json[r'serviceIdentification'] = serviceIdentification; + } + if (battery != null) { + json[r'battery'] = battery; + } + if (batteryStatus != null) { + json[r'batteryStatus'] = batteryStatus; + } + if (providerId != null) { + json[r'providerId'] = providerId; + } + if (manufacturerName != null) { + json[r'manufacturerName'] = manufacturerName; + } + if (groupIds != null) { + json[r'groupIds'] = groupIds; + } + if (properties != null) { + json[r'properties'] = properties; + } + if (supportedOperations != null) { + json[r'supportedOperations'] = supportedOperations; + } + return json; + } + + /// Returns a new [Device] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Device fromJson(Map json) => json == null + ? null + : Device( + id: json[r'id'], + userId: json[r'userId'], + name: json[r'name'], + description: json[r'description'], + model: json[r'model'], + port: json[r'port'], + firmwareVersion: json[r'firmwareVersion'], + hardwareVersion: json[r'hardwareVersion'], + status: json[r'status'], + type: DeviceType.fromJson(json[r'type']), + connectionStatus: ConnectionStatus.fromJson(json[r'connectionStatus']), + locationId: json[r'locationId'], + meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']), + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + lastState: json[r'lastState'], + lastStateDate: json[r'lastStateDate'] == null + ? null + : DateTime.parse(json[r'lastStateDate']), + ipAddress: json[r'ipAddress'], + serviceIdentification: json[r'serviceIdentification'], + battery: json[r'battery'], + batteryStatus: json[r'batteryStatus'], + providerId: json[r'providerId'], + manufacturerName: json[r'manufacturerName'], + groupIds: json[r'groupIds'] == null + ? null + : (json[r'groupIds'] as List).cast(), + supportedOperations: json[r'supportedOperations'] == null + ? null + : (json[r'supportedOperations'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Device.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = Device.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Device-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = Device.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/device_detail_dto.dart b/mycore_api/lib/model/device_detail_dto.dart new file mode 100644 index 0000000..0f2a2da --- /dev/null +++ b/mycore_api/lib/model/device_detail_dto.dart @@ -0,0 +1,314 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class DeviceDetailDTO { + /// Returns a new [DeviceDetailDTO] instance. + DeviceDetailDTO({ + this.id, + this.userId, + this.description, + this.name, + this.model, + this.type, + this.status, + this.connectionStatus, + this.locationId, + this.providerId, + this.providerName, + this.lastStateDate, + this.battery, + this.batteryStatus, + this.firmwareVersion, + this.hardwareVersion, + this.port, + this.meansOfCommunications, + this.createdDate, + this.updatedDate, + this.lastState, + this.ipAddress, + this.serviceIdentification, + this.manufacturerName, + this.groupIds, + this.properties, + this.supportedOperations, + }); + + String id; + + String userId; + + String description; + + String name; + + String model; + + DeviceType type; + + bool status; + + ConnectionStatus connectionStatus; + + String locationId; + + String providerId; + + String providerName; + + DateTime lastStateDate; + + bool battery; + + int batteryStatus; + + String firmwareVersion; + + String hardwareVersion; + + int port; + + List meansOfCommunications; + + DateTime createdDate; + + DateTime updatedDate; + + String lastState; + + String ipAddress; + + String serviceIdentification; + + String manufacturerName; + + List groupIds; + + Map properties; + + List supportedOperations; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO && + other.id == id && + other.userId == userId && + other.description == description && + other.name == name && + other.model == model && + other.type == type && + other.status == status && + other.connectionStatus == connectionStatus && + other.locationId == locationId && + other.providerId == providerId && + other.providerName == providerName && + other.lastStateDate == lastStateDate && + other.battery == battery && + other.batteryStatus == batteryStatus && + other.firmwareVersion == firmwareVersion && + other.hardwareVersion == hardwareVersion && + other.port == port && + other.meansOfCommunications == meansOfCommunications && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.lastState == lastState && + other.ipAddress == ipAddress && + other.serviceIdentification == serviceIdentification && + other.manufacturerName == manufacturerName && + other.groupIds == groupIds && + other.properties == properties && + other.supportedOperations == supportedOperations; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (description == null ? 0 : description.hashCode) + + (name == null ? 0 : name.hashCode) + + (model == null ? 0 : model.hashCode) + + (type == null ? 0 : type.hashCode) + + (status == null ? 0 : status.hashCode) + + (connectionStatus == null ? 0 : connectionStatus.hashCode) + + (locationId == null ? 0 : locationId.hashCode) + + (providerId == null ? 0 : providerId.hashCode) + + (providerName == null ? 0 : providerName.hashCode) + + (lastStateDate == null ? 0 : lastStateDate.hashCode) + + (battery == null ? 0 : battery.hashCode) + + (batteryStatus == null ? 0 : batteryStatus.hashCode) + + (firmwareVersion == null ? 0 : firmwareVersion.hashCode) + + (hardwareVersion == null ? 0 : hardwareVersion.hashCode) + + (port == null ? 0 : port.hashCode) + + (meansOfCommunications == null ? 0 : meansOfCommunications.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (lastState == null ? 0 : lastState.hashCode) + + (ipAddress == null ? 0 : ipAddress.hashCode) + + (serviceIdentification == null ? 0 : serviceIdentification.hashCode) + + (manufacturerName == null ? 0 : manufacturerName.hashCode) + + (groupIds == null ? 0 : groupIds.hashCode) + + (properties == null ? 0 : properties.hashCode) + + (supportedOperations == null ? 0 : supportedOperations.hashCode); + + @override + String toString() => 'DeviceDetailDTO[id=$id, userId=$userId, description=$description, name=$name, model=$model, type=$type, status=$status, connectionStatus=$connectionStatus, locationId=$locationId, providerId=$providerId, providerName=$providerName, lastStateDate=$lastStateDate, battery=$battery, batteryStatus=$batteryStatus, firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (description != null) { + json[r'description'] = description; + } + if (name != null) { + json[r'name'] = name; + } + if (model != null) { + json[r'model'] = model; + } + if (type != null) { + json[r'type'] = type; + } + if (status != null) { + json[r'status'] = status; + } + if (connectionStatus != null) { + json[r'connectionStatus'] = connectionStatus; + } + if (locationId != null) { + json[r'locationId'] = locationId; + } + if (providerId != null) { + json[r'providerId'] = providerId; + } + if (providerName != null) { + json[r'providerName'] = providerName; + } + if (lastStateDate != null) { + json[r'lastStateDate'] = lastStateDate.toUtc().toIso8601String(); + } + if (battery != null) { + json[r'battery'] = battery; + } + if (batteryStatus != null) { + json[r'batteryStatus'] = batteryStatus; + } + if (firmwareVersion != null) { + json[r'firmwareVersion'] = firmwareVersion; + } + if (hardwareVersion != null) { + json[r'hardwareVersion'] = hardwareVersion; + } + if (port != null) { + json[r'port'] = port; + } + if (meansOfCommunications != null) { + json[r'meansOfCommunications'] = meansOfCommunications; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (lastState != null) { + json[r'lastState'] = lastState; + } + if (ipAddress != null) { + json[r'ipAddress'] = ipAddress; + } + if (serviceIdentification != null) { + json[r'serviceIdentification'] = serviceIdentification; + } + if (manufacturerName != null) { + json[r'manufacturerName'] = manufacturerName; + } + if (groupIds != null) { + json[r'groupIds'] = groupIds; + } + if (properties != null) { + json[r'properties'] = properties; + } + if (supportedOperations != null) { + json[r'supportedOperations'] = supportedOperations; + } + return json; + } + + /// Returns a new [DeviceDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static DeviceDetailDTO fromJson(Map json) => json == null + ? null + : DeviceDetailDTO( + id: json[r'id'], + userId: json[r'userId'], + description: json[r'description'], + name: json[r'name'], + model: json[r'model'], + type: DeviceType.fromJson(json[r'type']), + status: json[r'status'], + connectionStatus: ConnectionStatus.fromJson(json[r'connectionStatus']), + locationId: json[r'locationId'], + providerId: json[r'providerId'], + providerName: json[r'providerName'], + lastStateDate: json[r'lastStateDate'] == null + ? null + : DateTime.parse(json[r'lastStateDate']), + battery: json[r'battery'], + batteryStatus: json[r'batteryStatus'], + firmwareVersion: json[r'firmwareVersion'], + hardwareVersion: json[r'hardwareVersion'], + port: json[r'port'], + meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']), + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + lastState: json[r'lastState'], + ipAddress: json[r'ipAddress'], + serviceIdentification: json[r'serviceIdentification'], + manufacturerName: json[r'manufacturerName'], + groupIds: json[r'groupIds'] == null + ? null + : (json[r'groupIds'] as List).cast(), + supportedOperations: json[r'supportedOperations'] == null + ? null + : (json[r'supportedOperations'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => DeviceDetailDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of DeviceDetailDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = DeviceDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/device_detail_dto_all_of.dart b/mycore_api/lib/model/device_detail_dto_all_of.dart new file mode 100644 index 0000000..0dd57f2 --- /dev/null +++ b/mycore_api/lib/model/device_detail_dto_all_of.dart @@ -0,0 +1,186 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class DeviceDetailDTOAllOf { + /// Returns a new [DeviceDetailDTOAllOf] instance. + DeviceDetailDTOAllOf({ + this.firmwareVersion, + this.hardwareVersion, + this.port, + this.meansOfCommunications, + this.createdDate, + this.updatedDate, + this.lastState, + this.ipAddress, + this.serviceIdentification, + this.manufacturerName, + this.groupIds, + this.properties, + this.supportedOperations, + }); + + String firmwareVersion; + + String hardwareVersion; + + int port; + + List meansOfCommunications; + + DateTime createdDate; + + DateTime updatedDate; + + String lastState; + + String ipAddress; + + String serviceIdentification; + + String manufacturerName; + + List groupIds; + + Map properties; + + List supportedOperations; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTOAllOf && + other.firmwareVersion == firmwareVersion && + other.hardwareVersion == hardwareVersion && + other.port == port && + other.meansOfCommunications == meansOfCommunications && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.lastState == lastState && + other.ipAddress == ipAddress && + other.serviceIdentification == serviceIdentification && + other.manufacturerName == manufacturerName && + other.groupIds == groupIds && + other.properties == properties && + other.supportedOperations == supportedOperations; + + @override + int get hashCode => + (firmwareVersion == null ? 0 : firmwareVersion.hashCode) + + (hardwareVersion == null ? 0 : hardwareVersion.hashCode) + + (port == null ? 0 : port.hashCode) + + (meansOfCommunications == null ? 0 : meansOfCommunications.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (lastState == null ? 0 : lastState.hashCode) + + (ipAddress == null ? 0 : ipAddress.hashCode) + + (serviceIdentification == null ? 0 : serviceIdentification.hashCode) + + (manufacturerName == null ? 0 : manufacturerName.hashCode) + + (groupIds == null ? 0 : groupIds.hashCode) + + (properties == null ? 0 : properties.hashCode) + + (supportedOperations == null ? 0 : supportedOperations.hashCode); + + @override + String toString() => 'DeviceDetailDTOAllOf[firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations]'; + + Map toJson() { + final json = {}; + if (firmwareVersion != null) { + json[r'firmwareVersion'] = firmwareVersion; + } + if (hardwareVersion != null) { + json[r'hardwareVersion'] = hardwareVersion; + } + if (port != null) { + json[r'port'] = port; + } + if (meansOfCommunications != null) { + json[r'meansOfCommunications'] = meansOfCommunications; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (lastState != null) { + json[r'lastState'] = lastState; + } + if (ipAddress != null) { + json[r'ipAddress'] = ipAddress; + } + if (serviceIdentification != null) { + json[r'serviceIdentification'] = serviceIdentification; + } + if (manufacturerName != null) { + json[r'manufacturerName'] = manufacturerName; + } + if (groupIds != null) { + json[r'groupIds'] = groupIds; + } + if (properties != null) { + json[r'properties'] = properties; + } + if (supportedOperations != null) { + json[r'supportedOperations'] = supportedOperations; + } + return json; + } + + /// Returns a new [DeviceDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static DeviceDetailDTOAllOf fromJson(Map json) => json == null + ? null + : DeviceDetailDTOAllOf( + firmwareVersion: json[r'firmwareVersion'], + hardwareVersion: json[r'hardwareVersion'], + port: json[r'port'], + meansOfCommunications: MeansOfCommunication.listFromJson(json[r'meansOfCommunications']), + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + lastState: json[r'lastState'], + ipAddress: json[r'ipAddress'], + serviceIdentification: json[r'serviceIdentification'], + manufacturerName: json[r'manufacturerName'], + groupIds: json[r'groupIds'] == null + ? null + : (json[r'groupIds'] as List).cast(), + supportedOperations: json[r'supportedOperations'] == null + ? null + : (json[r'supportedOperations'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => DeviceDetailDTOAllOf.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of DeviceDetailDTOAllOf-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = DeviceDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/device_summary_dto.dart b/mycore_api/lib/model/device_summary_dto.dart new file mode 100644 index 0000000..a4d5739 --- /dev/null +++ b/mycore_api/lib/model/device_summary_dto.dart @@ -0,0 +1,190 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class DeviceSummaryDTO { + /// Returns a new [DeviceSummaryDTO] instance. + DeviceSummaryDTO({ + this.id, + this.userId, + this.description, + this.name, + this.model, + this.type, + this.status, + this.connectionStatus, + this.locationId, + this.providerId, + this.providerName, + this.lastStateDate, + this.battery, + this.batteryStatus, + }); + + String id; + + String userId; + + String description; + + String name; + + String model; + + DeviceType type; + + bool status; + + ConnectionStatus connectionStatus; + + String locationId; + + String providerId; + + String providerName; + + DateTime lastStateDate; + + bool battery; + + int batteryStatus; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeviceSummaryDTO && + other.id == id && + other.userId == userId && + other.description == description && + other.name == name && + other.model == model && + other.type == type && + other.status == status && + other.connectionStatus == connectionStatus && + other.locationId == locationId && + other.providerId == providerId && + other.providerName == providerName && + other.lastStateDate == lastStateDate && + other.battery == battery && + other.batteryStatus == batteryStatus; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (description == null ? 0 : description.hashCode) + + (name == null ? 0 : name.hashCode) + + (model == null ? 0 : model.hashCode) + + (type == null ? 0 : type.hashCode) + + (status == null ? 0 : status.hashCode) + + (connectionStatus == null ? 0 : connectionStatus.hashCode) + + (locationId == null ? 0 : locationId.hashCode) + + (providerId == null ? 0 : providerId.hashCode) + + (providerName == null ? 0 : providerName.hashCode) + + (lastStateDate == null ? 0 : lastStateDate.hashCode) + + (battery == null ? 0 : battery.hashCode) + + (batteryStatus == null ? 0 : batteryStatus.hashCode); + + @override + String toString() => 'DeviceSummaryDTO[id=$id, userId=$userId, description=$description, name=$name, model=$model, type=$type, status=$status, connectionStatus=$connectionStatus, locationId=$locationId, providerId=$providerId, providerName=$providerName, lastStateDate=$lastStateDate, battery=$battery, batteryStatus=$batteryStatus]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (description != null) { + json[r'description'] = description; + } + if (name != null) { + json[r'name'] = name; + } + if (model != null) { + json[r'model'] = model; + } + if (type != null) { + json[r'type'] = type; + } + if (status != null) { + json[r'status'] = status; + } + if (connectionStatus != null) { + json[r'connectionStatus'] = connectionStatus; + } + if (locationId != null) { + json[r'locationId'] = locationId; + } + if (providerId != null) { + json[r'providerId'] = providerId; + } + if (providerName != null) { + json[r'providerName'] = providerName; + } + if (lastStateDate != null) { + json[r'lastStateDate'] = lastStateDate.toUtc().toIso8601String(); + } + if (battery != null) { + json[r'battery'] = battery; + } + if (batteryStatus != null) { + json[r'batteryStatus'] = batteryStatus; + } + return json; + } + + /// Returns a new [DeviceSummaryDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static DeviceSummaryDTO fromJson(Map json) => json == null + ? null + : DeviceSummaryDTO( + id: json[r'id'], + userId: json[r'userId'], + description: json[r'description'], + name: json[r'name'], + model: json[r'model'], + type: DeviceType.fromJson(json[r'type']), + status: json[r'status'], + connectionStatus: ConnectionStatus.fromJson(json[r'connectionStatus']), + locationId: json[r'locationId'], + providerId: json[r'providerId'], + providerName: json[r'providerName'], + lastStateDate: json[r'lastStateDate'] == null + ? null + : DateTime.parse(json[r'lastStateDate']), + battery: json[r'battery'], + batteryStatus: json[r'batteryStatus'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => DeviceSummaryDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = DeviceSummaryDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of DeviceSummaryDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = DeviceSummaryDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/device_type.dart b/mycore_api/lib/model/device_type.dart new file mode 100644 index 0000000..46c5ca9 --- /dev/null +++ b/mycore_api/lib/model/device_type.dart @@ -0,0 +1,115 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class DeviceType { + /// Instantiate a new enum with the provided [value]. + const DeviceType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const sensor = DeviceType._(r'Sensor'); + static const actuator = DeviceType._(r'Actuator'); + static const camera = DeviceType._(r'Camera'); + static const switch_ = DeviceType._(r'Switch'); + static const light = DeviceType._(r'Light'); + static const sound = DeviceType._(r'Sound'); + static const plug = DeviceType._(r'Plug'); + static const multiplug = DeviceType._(r'Multiplug'); + static const thermostat = DeviceType._(r'Thermostat'); + static const valve = DeviceType._(r'Valve'); + static const door = DeviceType._(r'Door'); + static const environment = DeviceType._(r'Environment'); + static const motion = DeviceType._(r'Motion'); + static const gateway = DeviceType._(r'Gateway'); + static const unknown = DeviceType._(r'Unknown'); + + /// List of all possible values in this [enum][DeviceType]. + static const values = [ + sensor, + actuator, + camera, + switch_, + light, + sound, + plug, + multiplug, + thermostat, + valve, + door, + environment, + motion, + gateway, + unknown, + ]; + + static DeviceType fromJson(dynamic value) => + DeviceTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => DeviceType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [DeviceType] to String, +/// and [decode] dynamic data back to [DeviceType]. +class DeviceTypeTypeTransformer { + const DeviceTypeTypeTransformer._(); + + factory DeviceTypeTypeTransformer() => _instance ??= DeviceTypeTypeTransformer._(); + + String encode(DeviceType data) => data.value; + + /// Decodes a [dynamic value][data] to a DeviceType. + /// + /// 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. + DeviceType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'Sensor': return DeviceType.sensor; + case r'Actuator': return DeviceType.actuator; + case r'Camera': return DeviceType.camera; + case r'Switch': return DeviceType.switch_; + case r'Light': return DeviceType.light; + case r'Sound': return DeviceType.sound; + case r'Plug': return DeviceType.plug; + case r'Multiplug': return DeviceType.multiplug; + case r'Thermostat': return DeviceType.thermostat; + case r'Valve': return DeviceType.valve; + case r'Door': return DeviceType.door; + case r'Environment': return DeviceType.environment; + case r'Motion': return DeviceType.motion; + case r'Gateway': return DeviceType.gateway; + case r'Unknown': return DeviceType.unknown; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [DeviceTypeTypeTransformer] instance. + static DeviceTypeTypeTransformer _instance; +} diff --git a/mycore_api/lib/model/electricity_production.dart b/mycore_api/lib/model/electricity_production.dart new file mode 100644 index 0000000..020518a --- /dev/null +++ b/mycore_api/lib/model/electricity_production.dart @@ -0,0 +1,118 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ElectricityProduction { + /// Returns a new [ElectricityProduction] instance. + ElectricityProduction({ + this.id, + this.deviceId, + this.userId, + this.watt, + this.ampere, + this.timestamp, + }); + + String id; + + String deviceId; + + String userId; + + double watt; + + double ampere; + + DateTime timestamp; + + @override + bool operator ==(Object other) => identical(this, other) || other is ElectricityProduction && + other.id == id && + other.deviceId == deviceId && + other.userId == userId && + other.watt == watt && + other.ampere == ampere && + other.timestamp == timestamp; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (deviceId == null ? 0 : deviceId.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (watt == null ? 0 : watt.hashCode) + + (ampere == null ? 0 : ampere.hashCode) + + (timestamp == null ? 0 : timestamp.hashCode); + + @override + String toString() => 'ElectricityProduction[id=$id, deviceId=$deviceId, userId=$userId, watt=$watt, ampere=$ampere, timestamp=$timestamp]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (deviceId != null) { + json[r'deviceId'] = deviceId; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (watt != null) { + json[r'watt'] = watt; + } + if (ampere != null) { + json[r'ampere'] = ampere; + } + if (timestamp != null) { + json[r'timestamp'] = timestamp.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [ElectricityProduction] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ElectricityProduction fromJson(Map json) => json == null + ? null + : ElectricityProduction( + id: json[r'id'], + deviceId: json[r'deviceId'], + userId: json[r'userId'], + watt: json[r'watt'], + ampere: json[r'ampere'], + timestamp: json[r'timestamp'] == null + ? null + : DateTime.parse(json[r'timestamp']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ElectricityProduction.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ElectricityProduction.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ElectricityProduction-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ElectricityProduction.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/facebook_auth_model.dart b/mycore_api/lib/model/facebook_auth_model.dart new file mode 100644 index 0000000..f4b35f2 --- /dev/null +++ b/mycore_api/lib/model/facebook_auth_model.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class FacebookAuthModel { + /// Returns a new [FacebookAuthModel] instance. + FacebookAuthModel({ + this.userAccessToken, + }); + + String userAccessToken; + + @override + bool operator ==(Object other) => identical(this, other) || other is FacebookAuthModel && + other.userAccessToken == userAccessToken; + + @override + int get hashCode => + (userAccessToken == null ? 0 : userAccessToken.hashCode); + + @override + String toString() => 'FacebookAuthModel[userAccessToken=$userAccessToken]'; + + Map toJson() { + final json = {}; + if (userAccessToken != null) { + json[r'userAccessToken'] = userAccessToken; + } + return json; + } + + /// Returns a new [FacebookAuthModel] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static FacebookAuthModel fromJson(Map json) => json == null + ? null + : FacebookAuthModel( + userAccessToken: json[r'userAccessToken'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => FacebookAuthModel.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = FacebookAuthModel.fromJson(v)); + } + return map; + } + + // maps a json object with a list of FacebookAuthModel-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = FacebookAuthModel.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/google_auth_model.dart b/mycore_api/lib/model/google_auth_model.dart new file mode 100644 index 0000000..3f55cfa --- /dev/null +++ b/mycore_api/lib/model/google_auth_model.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class GoogleAuthModel { + /// Returns a new [GoogleAuthModel] instance. + GoogleAuthModel({ + this.authorizationCode, + this.apiKey, + }); + + String authorizationCode; + + String apiKey; + + @override + bool operator ==(Object other) => identical(this, other) || other is GoogleAuthModel && + other.authorizationCode == authorizationCode && + other.apiKey == apiKey; + + @override + int get hashCode => + (authorizationCode == null ? 0 : authorizationCode.hashCode) + + (apiKey == null ? 0 : apiKey.hashCode); + + @override + String toString() => 'GoogleAuthModel[authorizationCode=$authorizationCode, apiKey=$apiKey]'; + + Map toJson() { + final json = {}; + if (authorizationCode != null) { + json[r'authorizationCode'] = authorizationCode; + } + if (apiKey != null) { + json[r'apiKey'] = apiKey; + } + return json; + } + + /// Returns a new [GoogleAuthModel] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GoogleAuthModel fromJson(Map json) => json == null + ? null + : GoogleAuthModel( + authorizationCode: json[r'authorizationCode'], + apiKey: json[r'apiKey'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GoogleAuthModel.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = GoogleAuthModel.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GoogleAuthModel-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = GoogleAuthModel.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/group.dart b/mycore_api/lib/model/group.dart new file mode 100644 index 0000000..954b2b0 --- /dev/null +++ b/mycore_api/lib/model/group.dart @@ -0,0 +1,149 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class Group { + /// Returns a new [Group] instance. + Group({ + this.id, + this.userId, + this.name, + this.type, + this.serviceIdentification, + this.isAlarm, + this.createdDate, + this.updatedDate, + this.devicesIds, + }); + + String id; + + String userId; + + String name; + + String type; + + int serviceIdentification; + + bool isAlarm; + + DateTime createdDate; + + DateTime updatedDate; + + List devicesIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is Group && + other.id == id && + other.userId == userId && + other.name == name && + other.type == type && + other.serviceIdentification == serviceIdentification && + other.isAlarm == isAlarm && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.devicesIds == devicesIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (serviceIdentification == null ? 0 : serviceIdentification.hashCode) + + (isAlarm == null ? 0 : isAlarm.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (devicesIds == null ? 0 : devicesIds.hashCode); + + @override + String toString() => 'Group[id=$id, userId=$userId, name=$name, type=$type, serviceIdentification=$serviceIdentification, isAlarm=$isAlarm, createdDate=$createdDate, updatedDate=$updatedDate, devicesIds=$devicesIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (serviceIdentification != null) { + json[r'serviceIdentification'] = serviceIdentification; + } + if (isAlarm != null) { + json[r'isAlarm'] = isAlarm; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (devicesIds != null) { + json[r'devicesIds'] = devicesIds; + } + return json; + } + + /// Returns a new [Group] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Group fromJson(Map json) => json == null + ? null + : Group( + id: json[r'id'], + userId: json[r'userId'], + name: json[r'name'], + type: json[r'type'], + serviceIdentification: json[r'serviceIdentification'], + isAlarm: json[r'isAlarm'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + devicesIds: json[r'devicesIds'] == null + ? null + : (json[r'devicesIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Group.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = Group.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Group-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = Group.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/group_create_or_update_detail_dto.dart b/mycore_api/lib/model/group_create_or_update_detail_dto.dart new file mode 100644 index 0000000..34b4dbf --- /dev/null +++ b/mycore_api/lib/model/group_create_or_update_detail_dto.dart @@ -0,0 +1,118 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class GroupCreateOrUpdateDetailDTO { + /// Returns a new [GroupCreateOrUpdateDetailDTO] instance. + GroupCreateOrUpdateDetailDTO({ + this.id, + this.userId, + this.name, + this.type, + this.isAlarm, + this.deviceIds, + }); + + String id; + + String userId; + + String name; + + String type; + + bool isAlarm; + + List deviceIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is GroupCreateOrUpdateDetailDTO && + other.id == id && + other.userId == userId && + other.name == name && + other.type == type && + other.isAlarm == isAlarm && + other.deviceIds == deviceIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (isAlarm == null ? 0 : isAlarm.hashCode) + + (deviceIds == null ? 0 : deviceIds.hashCode); + + @override + String toString() => 'GroupCreateOrUpdateDetailDTO[id=$id, userId=$userId, name=$name, type=$type, isAlarm=$isAlarm, deviceIds=$deviceIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (isAlarm != null) { + json[r'isAlarm'] = isAlarm; + } + if (deviceIds != null) { + json[r'deviceIds'] = deviceIds; + } + return json; + } + + /// Returns a new [GroupCreateOrUpdateDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GroupCreateOrUpdateDetailDTO fromJson(Map json) => json == null + ? null + : GroupCreateOrUpdateDetailDTO( + id: json[r'id'], + userId: json[r'userId'], + name: json[r'name'], + type: json[r'type'], + isAlarm: json[r'isAlarm'], + deviceIds: json[r'deviceIds'] == null + ? null + : (json[r'deviceIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GroupCreateOrUpdateDetailDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = GroupCreateOrUpdateDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GroupCreateOrUpdateDetailDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = GroupCreateOrUpdateDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/group_create_or_update_detail_dto_all_of.dart b/mycore_api/lib/model/group_create_or_update_detail_dto_all_of.dart new file mode 100644 index 0000000..e1cf089 --- /dev/null +++ b/mycore_api/lib/model/group_create_or_update_detail_dto_all_of.dart @@ -0,0 +1,73 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class GroupCreateOrUpdateDetailDTOAllOf { + /// Returns a new [GroupCreateOrUpdateDetailDTOAllOf] instance. + GroupCreateOrUpdateDetailDTOAllOf({ + this.deviceIds, + }); + + List deviceIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is GroupCreateOrUpdateDetailDTOAllOf && + other.deviceIds == deviceIds; + + @override + int get hashCode => + (deviceIds == null ? 0 : deviceIds.hashCode); + + @override + String toString() => 'GroupCreateOrUpdateDetailDTOAllOf[deviceIds=$deviceIds]'; + + Map toJson() { + final json = {}; + if (deviceIds != null) { + json[r'deviceIds'] = deviceIds; + } + return json; + } + + /// Returns a new [GroupCreateOrUpdateDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GroupCreateOrUpdateDetailDTOAllOf fromJson(Map json) => json == null + ? null + : GroupCreateOrUpdateDetailDTOAllOf( + deviceIds: json[r'deviceIds'] == null + ? null + : (json[r'deviceIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GroupCreateOrUpdateDetailDTOAllOf.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = GroupCreateOrUpdateDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GroupCreateOrUpdateDetailDTOAllOf-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = GroupCreateOrUpdateDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/group_detail_dto.dart b/mycore_api/lib/model/group_detail_dto.dart new file mode 100644 index 0000000..369c171 --- /dev/null +++ b/mycore_api/lib/model/group_detail_dto.dart @@ -0,0 +1,138 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class GroupDetailDTO { + /// Returns a new [GroupDetailDTO] instance. + GroupDetailDTO({ + this.id, + this.userId, + this.name, + this.type, + this.isAlarm, + this.createdDate, + this.updatedDate, + this.devices, + }); + + String id; + + String userId; + + String name; + + String type; + + bool isAlarm; + + DateTime createdDate; + + DateTime updatedDate; + + List devices; + + @override + bool operator ==(Object other) => identical(this, other) || other is GroupDetailDTO && + other.id == id && + other.userId == userId && + other.name == name && + other.type == type && + other.isAlarm == isAlarm && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.devices == devices; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (isAlarm == null ? 0 : isAlarm.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (devices == null ? 0 : devices.hashCode); + + @override + String toString() => 'GroupDetailDTO[id=$id, userId=$userId, name=$name, type=$type, isAlarm=$isAlarm, createdDate=$createdDate, updatedDate=$updatedDate, devices=$devices]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (isAlarm != null) { + json[r'isAlarm'] = isAlarm; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (devices != null) { + json[r'devices'] = devices; + } + return json; + } + + /// Returns a new [GroupDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GroupDetailDTO fromJson(Map json) => json == null + ? null + : GroupDetailDTO( + id: json[r'id'], + userId: json[r'userId'], + name: json[r'name'], + type: json[r'type'], + isAlarm: json[r'isAlarm'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + devices: DeviceDetailDTO.listFromJson(json[r'devices']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GroupDetailDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = GroupDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GroupDetailDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = GroupDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/group_detail_dto_all_of.dart b/mycore_api/lib/model/group_detail_dto_all_of.dart new file mode 100644 index 0000000..1b10d52 --- /dev/null +++ b/mycore_api/lib/model/group_detail_dto_all_of.dart @@ -0,0 +1,93 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class GroupDetailDTOAllOf { + /// Returns a new [GroupDetailDTOAllOf] instance. + GroupDetailDTOAllOf({ + this.createdDate, + this.updatedDate, + this.devices, + }); + + DateTime createdDate; + + DateTime updatedDate; + + List devices; + + @override + bool operator ==(Object other) => identical(this, other) || other is GroupDetailDTOAllOf && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.devices == devices; + + @override + int get hashCode => + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (devices == null ? 0 : devices.hashCode); + + @override + String toString() => 'GroupDetailDTOAllOf[createdDate=$createdDate, updatedDate=$updatedDate, devices=$devices]'; + + Map toJson() { + final json = {}; + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (devices != null) { + json[r'devices'] = devices; + } + return json; + } + + /// Returns a new [GroupDetailDTOAllOf] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GroupDetailDTOAllOf fromJson(Map json) => json == null + ? null + : GroupDetailDTOAllOf( + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + devices: DeviceDetailDTO.listFromJson(json[r'devices']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GroupDetailDTOAllOf.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = GroupDetailDTOAllOf.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GroupDetailDTOAllOf-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = GroupDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/group_summary_dto.dart b/mycore_api/lib/model/group_summary_dto.dart new file mode 100644 index 0000000..9e74a23 --- /dev/null +++ b/mycore_api/lib/model/group_summary_dto.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class GroupSummaryDTO { + /// Returns a new [GroupSummaryDTO] instance. + GroupSummaryDTO({ + this.id, + this.userId, + this.name, + this.type, + this.isAlarm, + }); + + String id; + + String userId; + + String name; + + String type; + + bool isAlarm; + + @override + bool operator ==(Object other) => identical(this, other) || other is GroupSummaryDTO && + other.id == id && + other.userId == userId && + other.name == name && + other.type == type && + other.isAlarm == isAlarm; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (isAlarm == null ? 0 : isAlarm.hashCode); + + @override + String toString() => 'GroupSummaryDTO[id=$id, userId=$userId, name=$name, type=$type, isAlarm=$isAlarm]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (isAlarm != null) { + json[r'isAlarm'] = isAlarm; + } + return json; + } + + /// Returns a new [GroupSummaryDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static GroupSummaryDTO fromJson(Map json) => json == null + ? null + : GroupSummaryDTO( + id: json[r'id'], + userId: json[r'userId'], + name: json[r'name'], + type: json[r'type'], + isAlarm: json[r'isAlarm'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => GroupSummaryDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = GroupSummaryDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of GroupSummaryDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = GroupSummaryDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/location_dto.dart b/mycore_api/lib/model/location_dto.dart new file mode 100644 index 0000000..6fe83a7 --- /dev/null +++ b/mycore_api/lib/model/location_dto.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class LocationDTO { + /// Returns a new [LocationDTO] instance. + LocationDTO({ + this.id, + this.name, + }); + + String id; + + String name; + + @override + bool operator ==(Object other) => identical(this, other) || other is LocationDTO && + other.id == id && + other.name == name; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode); + + @override + String toString() => 'LocationDTO[id=$id, name=$name]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + return json; + } + + /// Returns a new [LocationDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static LocationDTO fromJson(Map json) => json == null + ? null + : LocationDTO( + id: json[r'id'], + name: json[r'name'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => LocationDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = LocationDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of LocationDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = LocationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/login_dto.dart b/mycore_api/lib/model/login_dto.dart new file mode 100644 index 0000000..ff0bed5 --- /dev/null +++ b/mycore_api/lib/model/login_dto.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class LoginDTO { + /// Returns a new [LoginDTO] instance. + LoginDTO({ + this.email, + this.password, + }); + + String email; + + String password; + + @override + bool operator ==(Object other) => identical(this, other) || other is LoginDTO && + other.email == email && + other.password == password; + + @override + int get hashCode => + (email == null ? 0 : email.hashCode) + + (password == null ? 0 : password.hashCode); + + @override + String toString() => 'LoginDTO[email=$email, password=$password]'; + + Map toJson() { + final json = {}; + if (email != null) { + json[r'email'] = email; + } + if (password != null) { + json[r'password'] = password; + } + return json; + } + + /// Returns a new [LoginDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static LoginDTO fromJson(Map json) => json == null + ? null + : LoginDTO( + email: json[r'email'], + password: json[r'password'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => LoginDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = LoginDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of LoginDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = LoginDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/means_of_communication.dart b/mycore_api/lib/model/means_of_communication.dart new file mode 100644 index 0000000..b5ea770 --- /dev/null +++ b/mycore_api/lib/model/means_of_communication.dart @@ -0,0 +1,82 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class MeansOfCommunication { + /// Instantiate a new enum with the provided [value]. + const MeansOfCommunication._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const wifi = MeansOfCommunication._(r'Wifi'); + static const bluetooth = MeansOfCommunication._(r'Bluetooth'); + static const zigbee = MeansOfCommunication._(r'Zigbee'); + static const zwave = MeansOfCommunication._(r'Zwave'); + + /// List of all possible values in this [enum][MeansOfCommunication]. + static const values = [ + wifi, + bluetooth, + zigbee, + zwave, + ]; + + static MeansOfCommunication fromJson(dynamic value) => + MeansOfCommunicationTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => MeansOfCommunication.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [MeansOfCommunication] to String, +/// and [decode] dynamic data back to [MeansOfCommunication]. +class MeansOfCommunicationTypeTransformer { + const MeansOfCommunicationTypeTransformer._(); + + factory MeansOfCommunicationTypeTransformer() => _instance ??= MeansOfCommunicationTypeTransformer._(); + + String encode(MeansOfCommunication data) => data.value; + + /// Decodes a [dynamic value][data] to a MeansOfCommunication. + /// + /// 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. + MeansOfCommunication decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'Wifi': return MeansOfCommunication.wifi; + case r'Bluetooth': return MeansOfCommunication.bluetooth; + case r'Zigbee': return MeansOfCommunication.zigbee; + case r'Zwave': return MeansOfCommunication.zwave; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [MeansOfCommunicationTypeTransformer] instance. + static MeansOfCommunicationTypeTransformer _instance; +} diff --git a/mycore_api/lib/model/mqtt_message_dto.dart b/mycore_api/lib/model/mqtt_message_dto.dart new file mode 100644 index 0000000..e76235d --- /dev/null +++ b/mycore_api/lib/model/mqtt_message_dto.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class MqttMessageDTO { + /// Returns a new [MqttMessageDTO] instance. + MqttMessageDTO({ + this.topic, + this.message, + this.online, + }); + + String topic; + + String message; + + bool online; + + @override + bool operator ==(Object other) => identical(this, other) || other is MqttMessageDTO && + other.topic == topic && + other.message == message && + other.online == online; + + @override + int get hashCode => + (topic == null ? 0 : topic.hashCode) + + (message == null ? 0 : message.hashCode) + + (online == null ? 0 : online.hashCode); + + @override + String toString() => 'MqttMessageDTO[topic=$topic, message=$message, online=$online]'; + + Map toJson() { + final json = {}; + if (topic != null) { + json[r'topic'] = topic; + } + if (message != null) { + json[r'message'] = message; + } + if (online != null) { + json[r'online'] = online; + } + return json; + } + + /// Returns a new [MqttMessageDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static MqttMessageDTO fromJson(Map json) => json == null + ? null + : MqttMessageDTO( + topic: json[r'topic'], + message: json[r'message'], + online: json[r'online'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => MqttMessageDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = MqttMessageDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of MqttMessageDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = MqttMessageDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/odd_h2_h.dart b/mycore_api/lib/model/odd_h2_h.dart new file mode 100644 index 0000000..944f420 --- /dev/null +++ b/mycore_api/lib/model/odd_h2_h.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class OddH2H { + /// Returns a new [OddH2H] instance. + OddH2H({ + this.homeOdd, + this.drawOdd, + this.visitOdd, + }); + + double homeOdd; + + double drawOdd; + + double visitOdd; + + @override + bool operator ==(Object other) => identical(this, other) || other is OddH2H && + other.homeOdd == homeOdd && + other.drawOdd == drawOdd && + other.visitOdd == visitOdd; + + @override + int get hashCode => + (homeOdd == null ? 0 : homeOdd.hashCode) + + (drawOdd == null ? 0 : drawOdd.hashCode) + + (visitOdd == null ? 0 : visitOdd.hashCode); + + @override + String toString() => 'OddH2H[homeOdd=$homeOdd, drawOdd=$drawOdd, visitOdd=$visitOdd]'; + + Map toJson() { + final json = {}; + if (homeOdd != null) { + json[r'homeOdd'] = homeOdd; + } + if (drawOdd != null) { + json[r'drawOdd'] = drawOdd; + } + if (visitOdd != null) { + json[r'visitOdd'] = visitOdd; + } + return json; + } + + /// Returns a new [OddH2H] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static OddH2H fromJson(Map json) => json == null + ? null + : OddH2H( + homeOdd: json[r'homeOdd'], + drawOdd: json[r'drawOdd'], + visitOdd: json[r'visitOdd'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => OddH2H.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = OddH2H.fromJson(v)); + } + return map; + } + + // maps a json object with a list of OddH2H-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = OddH2H.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/odd_nice.dart b/mycore_api/lib/model/odd_nice.dart new file mode 100644 index 0000000..91ccc7c --- /dev/null +++ b/mycore_api/lib/model/odd_nice.dart @@ -0,0 +1,91 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class OddNice { + /// Returns a new [OddNice] instance. + OddNice({ + this.teams, + this.commenceTime, + this.homeTeam, + }); + + List teams; + + int commenceTime; + + String homeTeam; + + @override + bool operator ==(Object other) => identical(this, other) || other is OddNice && + other.teams == teams && + other.commenceTime == commenceTime && + other.homeTeam == homeTeam; + + @override + int get hashCode => + (teams == null ? 0 : teams.hashCode) + + (commenceTime == null ? 0 : commenceTime.hashCode) + + (homeTeam == null ? 0 : homeTeam.hashCode); + + @override + String toString() => 'OddNice[teams=$teams, commenceTime=$commenceTime, homeTeam=$homeTeam]'; + + Map toJson() { + final json = {}; + if (teams != null) { + json[r'teams'] = teams; + } + if (commenceTime != null) { + json[r'commence_time'] = commenceTime; + } + if (homeTeam != null) { + json[r'home_team'] = homeTeam; + } + return json; + } + + /// Returns a new [OddNice] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static OddNice fromJson(Map json) => json == null + ? null + : OddNice( + teams: json[r'teams'] == null + ? null + : (json[r'teams'] as List).cast(), + commenceTime: json[r'commence_time'], + homeTeam: json[r'home_team'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => OddNice.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = OddNice.fromJson(v)); + } + return map; + } + + // maps a json object with a list of OddNice-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = OddNice.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/panel_menu_item.dart b/mycore_api/lib/model/panel_menu_item.dart new file mode 100644 index 0000000..83f9c42 --- /dev/null +++ b/mycore_api/lib/model/panel_menu_item.dart @@ -0,0 +1,125 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PanelMenuItem { + /// Returns a new [PanelMenuItem] instance. + PanelMenuItem({ + this.label, + this.route, + this.icon, + this.color, + this.badgeValue, + this.badgeType, + this.children, + }); + + String label; + + String route; + + String icon; + + String color; + + int badgeValue; + + String badgeType; + + List children; + + @override + bool operator ==(Object other) => identical(this, other) || other is PanelMenuItem && + other.label == label && + other.route == route && + other.icon == icon && + other.color == color && + other.badgeValue == badgeValue && + other.badgeType == badgeType && + other.children == children; + + @override + int get hashCode => + (label == null ? 0 : label.hashCode) + + (route == null ? 0 : route.hashCode) + + (icon == null ? 0 : icon.hashCode) + + (color == null ? 0 : color.hashCode) + + (badgeValue == null ? 0 : badgeValue.hashCode) + + (badgeType == null ? 0 : badgeType.hashCode) + + (children == null ? 0 : children.hashCode); + + @override + String toString() => 'PanelMenuItem[label=$label, route=$route, icon=$icon, color=$color, badgeValue=$badgeValue, badgeType=$badgeType, children=$children]'; + + Map toJson() { + final json = {}; + if (label != null) { + json[r'label'] = label; + } + if (route != null) { + json[r'route'] = route; + } + if (icon != null) { + json[r'icon'] = icon; + } + if (color != null) { + json[r'color'] = color; + } + if (badgeValue != null) { + json[r'badgeValue'] = badgeValue; + } + if (badgeType != null) { + json[r'badgeType'] = badgeType; + } + if (children != null) { + json[r'children'] = children; + } + return json; + } + + /// Returns a new [PanelMenuItem] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static PanelMenuItem fromJson(Map json) => json == null + ? null + : PanelMenuItem( + label: json[r'label'], + route: json[r'route'], + icon: json[r'icon'], + color: json[r'color'], + badgeValue: json[r'badgeValue'], + badgeType: json[r'badgeType'], + children: PanelMenuItem.listFromJson(json[r'children']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => PanelMenuItem.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = PanelMenuItem.fromJson(v)); + } + return map; + } + + // maps a json object with a list of PanelMenuItem-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = PanelMenuItem.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/panel_section.dart b/mycore_api/lib/model/panel_section.dart new file mode 100644 index 0000000..e612c49 --- /dev/null +++ b/mycore_api/lib/model/panel_section.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PanelSection { + /// Returns a new [PanelSection] instance. + PanelSection({ + this.label, + this.icon, + this.color, + this.defaultRoute, + this.children, + }); + + String label; + + String icon; + + String color; + + String defaultRoute; + + List children; + + @override + bool operator ==(Object other) => identical(this, other) || other is PanelSection && + other.label == label && + other.icon == icon && + other.color == color && + other.defaultRoute == defaultRoute && + other.children == children; + + @override + int get hashCode => + (label == null ? 0 : label.hashCode) + + (icon == null ? 0 : icon.hashCode) + + (color == null ? 0 : color.hashCode) + + (defaultRoute == null ? 0 : defaultRoute.hashCode) + + (children == null ? 0 : children.hashCode); + + @override + String toString() => 'PanelSection[label=$label, icon=$icon, color=$color, defaultRoute=$defaultRoute, children=$children]'; + + Map toJson() { + final json = {}; + if (label != null) { + json[r'label'] = label; + } + if (icon != null) { + json[r'icon'] = icon; + } + if (color != null) { + json[r'color'] = color; + } + if (defaultRoute != null) { + json[r'defaultRoute'] = defaultRoute; + } + if (children != null) { + json[r'children'] = children; + } + return json; + } + + /// Returns a new [PanelSection] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static PanelSection fromJson(Map json) => json == null + ? null + : PanelSection( + label: json[r'label'], + icon: json[r'icon'], + color: json[r'color'], + defaultRoute: json[r'defaultRoute'], + children: PanelMenuItem.listFromJson(json[r'children']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => PanelSection.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = PanelSection.fromJson(v)); + } + return map; + } + + // maps a json object with a list of PanelSection-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = PanelSection.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/provider.dart b/mycore_api/lib/model/provider.dart new file mode 100644 index 0000000..78e5a70 --- /dev/null +++ b/mycore_api/lib/model/provider.dart @@ -0,0 +1,152 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class Provider { + /// Returns a new [Provider] instance. + Provider({ + this.id, + this.userId, + this.name, + this.type, + this.username, + this.password, + this.endpoint, + this.apiKey, + this.value, + this.active, + }); + + String id; + + String userId; + + String name; + + String type; + + String username; + + String password; + + String endpoint; + + String apiKey; + + String value; + + bool active; + + @override + bool operator ==(Object other) => identical(this, other) || other is Provider && + other.id == id && + other.userId == userId && + other.name == name && + other.type == type && + other.username == username && + other.password == password && + other.endpoint == endpoint && + other.apiKey == apiKey && + other.value == value && + other.active == active; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (username == null ? 0 : username.hashCode) + + (password == null ? 0 : password.hashCode) + + (endpoint == null ? 0 : endpoint.hashCode) + + (apiKey == null ? 0 : apiKey.hashCode) + + (value == null ? 0 : value.hashCode) + + (active == null ? 0 : active.hashCode); + + @override + String toString() => 'Provider[id=$id, userId=$userId, name=$name, type=$type, username=$username, password=$password, endpoint=$endpoint, apiKey=$apiKey, value=$value, active=$active]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (username != null) { + json[r'username'] = username; + } + if (password != null) { + json[r'password'] = password; + } + if (endpoint != null) { + json[r'endpoint'] = endpoint; + } + if (apiKey != null) { + json[r'apiKey'] = apiKey; + } + if (value != null) { + json[r'value'] = value; + } + if (active != null) { + json[r'active'] = active; + } + return json; + } + + /// Returns a new [Provider] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Provider fromJson(Map json) => json == null + ? null + : Provider( + id: json[r'id'], + userId: json[r'userId'], + name: json[r'name'], + type: json[r'type'], + username: json[r'username'], + password: json[r'password'], + endpoint: json[r'endpoint'], + apiKey: json[r'apiKey'], + value: json[r'value'], + active: json[r'active'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Provider.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = Provider.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Provider-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = Provider.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/provider_dto.dart b/mycore_api/lib/model/provider_dto.dart new file mode 100644 index 0000000..1a2b874 --- /dev/null +++ b/mycore_api/lib/model/provider_dto.dart @@ -0,0 +1,143 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ProviderDTO { + /// Returns a new [ProviderDTO] instance. + ProviderDTO({ + this.id, + this.name, + this.type, + this.userId, + this.endpoint, + this.username, + this.password, + this.apiKey, + this.active, + }); + + String id; + + String name; + + String type; + + String userId; + + String endpoint; + + String username; + + String password; + + String apiKey; + + bool active; + + @override + bool operator ==(Object other) => identical(this, other) || other is ProviderDTO && + other.id == id && + other.name == name && + other.type == type && + other.userId == userId && + other.endpoint == endpoint && + other.username == username && + other.password == password && + other.apiKey == apiKey && + other.active == active; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (endpoint == null ? 0 : endpoint.hashCode) + + (username == null ? 0 : username.hashCode) + + (password == null ? 0 : password.hashCode) + + (apiKey == null ? 0 : apiKey.hashCode) + + (active == null ? 0 : active.hashCode); + + @override + String toString() => 'ProviderDTO[id=$id, name=$name, type=$type, userId=$userId, endpoint=$endpoint, username=$username, password=$password, apiKey=$apiKey, active=$active]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (endpoint != null) { + json[r'endpoint'] = endpoint; + } + if (username != null) { + json[r'username'] = username; + } + if (password != null) { + json[r'password'] = password; + } + if (apiKey != null) { + json[r'apiKey'] = apiKey; + } + if (active != null) { + json[r'active'] = active; + } + return json; + } + + /// Returns a new [ProviderDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ProviderDTO fromJson(Map json) => json == null + ? null + : ProviderDTO( + id: json[r'id'], + name: json[r'name'], + type: json[r'type'], + userId: json[r'userId'], + endpoint: json[r'endpoint'], + username: json[r'username'], + password: json[r'password'], + apiKey: json[r'apiKey'], + active: json[r'active'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ProviderDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ProviderDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ProviderDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ProviderDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/room_create_or_update_detail_dto.dart b/mycore_api/lib/model/room_create_or_update_detail_dto.dart new file mode 100644 index 0000000..eb9ba8f --- /dev/null +++ b/mycore_api/lib/model/room_create_or_update_detail_dto.dart @@ -0,0 +1,100 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class RoomCreateOrUpdateDetailDTO { + /// Returns a new [RoomCreateOrUpdateDetailDTO] instance. + RoomCreateOrUpdateDetailDTO({ + this.id, + this.userId, + this.name, + this.deviceIds, + }); + + String id; + + String userId; + + String name; + + List deviceIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is RoomCreateOrUpdateDetailDTO && + other.id == id && + other.userId == userId && + other.name == name && + other.deviceIds == deviceIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (name == null ? 0 : name.hashCode) + + (deviceIds == null ? 0 : deviceIds.hashCode); + + @override + String toString() => 'RoomCreateOrUpdateDetailDTO[id=$id, userId=$userId, name=$name, deviceIds=$deviceIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (name != null) { + json[r'name'] = name; + } + if (deviceIds != null) { + json[r'deviceIds'] = deviceIds; + } + return json; + } + + /// Returns a new [RoomCreateOrUpdateDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static RoomCreateOrUpdateDetailDTO fromJson(Map json) => json == null + ? null + : RoomCreateOrUpdateDetailDTO( + id: json[r'id'], + userId: json[r'userId'], + name: json[r'name'], + deviceIds: json[r'deviceIds'] == null + ? null + : (json[r'deviceIds'] as List).cast(), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => RoomCreateOrUpdateDetailDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = RoomCreateOrUpdateDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of RoomCreateOrUpdateDetailDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = RoomCreateOrUpdateDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/room_detail_dto.dart b/mycore_api/lib/model/room_detail_dto.dart new file mode 100644 index 0000000..e42cd0e --- /dev/null +++ b/mycore_api/lib/model/room_detail_dto.dart @@ -0,0 +1,120 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class RoomDetailDTO { + /// Returns a new [RoomDetailDTO] instance. + RoomDetailDTO({ + this.id, + this.userId, + this.name, + this.createdDate, + this.updatedDate, + this.devices, + }); + + String id; + + String userId; + + String name; + + DateTime createdDate; + + DateTime updatedDate; + + List devices; + + @override + bool operator ==(Object other) => identical(this, other) || other is RoomDetailDTO && + other.id == id && + other.userId == userId && + other.name == name && + other.createdDate == createdDate && + other.updatedDate == updatedDate && + other.devices == devices; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (name == null ? 0 : name.hashCode) + + (createdDate == null ? 0 : createdDate.hashCode) + + (updatedDate == null ? 0 : updatedDate.hashCode) + + (devices == null ? 0 : devices.hashCode); + + @override + String toString() => 'RoomDetailDTO[id=$id, userId=$userId, name=$name, createdDate=$createdDate, updatedDate=$updatedDate, devices=$devices]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (name != null) { + json[r'name'] = name; + } + if (createdDate != null) { + json[r'createdDate'] = createdDate.toUtc().toIso8601String(); + } + if (updatedDate != null) { + json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); + } + if (devices != null) { + json[r'devices'] = devices; + } + return json; + } + + /// Returns a new [RoomDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static RoomDetailDTO fromJson(Map json) => json == null + ? null + : RoomDetailDTO( + id: json[r'id'], + userId: json[r'userId'], + name: json[r'name'], + createdDate: json[r'createdDate'] == null + ? null + : DateTime.parse(json[r'createdDate']), + updatedDate: json[r'updatedDate'] == null + ? null + : DateTime.parse(json[r'updatedDate']), + devices: DeviceDetailDTO.listFromJson(json[r'devices']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => RoomDetailDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = RoomDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of RoomDetailDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = RoomDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/room_summary_dto.dart b/mycore_api/lib/model/room_summary_dto.dart new file mode 100644 index 0000000..62f25c9 --- /dev/null +++ b/mycore_api/lib/model/room_summary_dto.dart @@ -0,0 +1,89 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class RoomSummaryDTO { + /// Returns a new [RoomSummaryDTO] instance. + RoomSummaryDTO({ + this.id, + this.userId, + this.name, + }); + + String id; + + String userId; + + String name; + + @override + bool operator ==(Object other) => identical(this, other) || other is RoomSummaryDTO && + other.id == id && + other.userId == userId && + other.name == name; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (userId == null ? 0 : userId.hashCode) + + (name == null ? 0 : name.hashCode); + + @override + String toString() => 'RoomSummaryDTO[id=$id, userId=$userId, name=$name]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (userId != null) { + json[r'userId'] = userId; + } + if (name != null) { + json[r'name'] = name; + } + return json; + } + + /// Returns a new [RoomSummaryDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static RoomSummaryDTO fromJson(Map json) => json == null + ? null + : RoomSummaryDTO( + id: json[r'id'], + userId: json[r'userId'], + name: json[r'name'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => RoomSummaryDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = RoomSummaryDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of RoomSummaryDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = RoomSummaryDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/screen_configuration.dart b/mycore_api/lib/model/screen_configuration.dart new file mode 100644 index 0000000..cfa6aee --- /dev/null +++ b/mycore_api/lib/model/screen_configuration.dart @@ -0,0 +1,116 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ScreenConfiguration { + /// Returns a new [ScreenConfiguration] instance. + ScreenConfiguration({ + this.id, + this.name, + this.type, + this.widgets, + this.height, + this.width, + }); + + String id; + + String name; + + String type; + + List widgets; + + int height; + + int width; + + @override + bool operator ==(Object other) => identical(this, other) || other is ScreenConfiguration && + other.id == id && + other.name == name && + other.type == type && + other.widgets == widgets && + other.height == height && + other.width == width; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (widgets == null ? 0 : widgets.hashCode) + + (height == null ? 0 : height.hashCode) + + (width == null ? 0 : width.hashCode); + + @override + String toString() => 'ScreenConfiguration[id=$id, name=$name, type=$type, widgets=$widgets, height=$height, width=$width]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (widgets != null) { + json[r'widgets'] = widgets; + } + if (height != null) { + json[r'height'] = height; + } + if (width != null) { + json[r'width'] = width; + } + return json; + } + + /// Returns a new [ScreenConfiguration] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ScreenConfiguration fromJson(Map json) => json == null + ? null + : ScreenConfiguration( + id: json[r'id'], + name: json[r'name'], + type: json[r'type'], + widgets: WidgetAPI.listFromJson(json[r'widgets']), + height: json[r'height'], + width: json[r'width'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ScreenConfiguration.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ScreenConfiguration.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ScreenConfiguration-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ScreenConfiguration.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/screen_device.dart b/mycore_api/lib/model/screen_device.dart new file mode 100644 index 0000000..9ed497a --- /dev/null +++ b/mycore_api/lib/model/screen_device.dart @@ -0,0 +1,125 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ScreenDevice { + /// Returns a new [ScreenDevice] instance. + ScreenDevice({ + this.id, + this.name, + this.type, + this.location, + this.locationExplanation, + this.height, + this.width, + }); + + String id; + + String name; + + String type; + + String location; + + String locationExplanation; + + int height; + + int width; + + @override + bool operator ==(Object other) => identical(this, other) || other is ScreenDevice && + other.id == id && + other.name == name && + other.type == type && + other.location == location && + other.locationExplanation == locationExplanation && + other.height == height && + other.width == width; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (type == null ? 0 : type.hashCode) + + (location == null ? 0 : location.hashCode) + + (locationExplanation == null ? 0 : locationExplanation.hashCode) + + (height == null ? 0 : height.hashCode) + + (width == null ? 0 : width.hashCode); + + @override + String toString() => 'ScreenDevice[id=$id, name=$name, type=$type, location=$location, locationExplanation=$locationExplanation, height=$height, width=$width]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (type != null) { + json[r'type'] = type; + } + if (location != null) { + json[r'location'] = location; + } + if (locationExplanation != null) { + json[r'locationExplanation'] = locationExplanation; + } + if (height != null) { + json[r'height'] = height; + } + if (width != null) { + json[r'width'] = width; + } + return json; + } + + /// Returns a new [ScreenDevice] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static ScreenDevice fromJson(Map json) => json == null + ? null + : ScreenDevice( + id: json[r'id'], + name: json[r'name'], + type: json[r'type'], + location: json[r'location'], + locationExplanation: json[r'locationExplanation'], + height: json[r'height'], + width: json[r'width'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => ScreenDevice.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = ScreenDevice.fromJson(v)); + } + return map; + } + + // maps a json object with a list of ScreenDevice-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = ScreenDevice.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/smart_garden_message.dart b/mycore_api/lib/model/smart_garden_message.dart new file mode 100644 index 0000000..342aa1b --- /dev/null +++ b/mycore_api/lib/model/smart_garden_message.dart @@ -0,0 +1,134 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class SmartGardenMessage { + /// Returns a new [SmartGardenMessage] instance. + SmartGardenMessage({ + this.id, + this.type, + this.time, + this.temperature, + this.pressure, + this.humidity, + this.water, + this.light, + }); + + String id; + + String type; + + String time; + + double temperature; + + double pressure; + + double humidity; + + int water; + + int light; + + @override + bool operator ==(Object other) => identical(this, other) || other is SmartGardenMessage && + other.id == id && + other.type == type && + other.time == time && + other.temperature == temperature && + other.pressure == pressure && + other.humidity == humidity && + other.water == water && + other.light == light; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (type == null ? 0 : type.hashCode) + + (time == null ? 0 : time.hashCode) + + (temperature == null ? 0 : temperature.hashCode) + + (pressure == null ? 0 : pressure.hashCode) + + (humidity == null ? 0 : humidity.hashCode) + + (water == null ? 0 : water.hashCode) + + (light == null ? 0 : light.hashCode); + + @override + String toString() => 'SmartGardenMessage[id=$id, type=$type, time=$time, temperature=$temperature, pressure=$pressure, humidity=$humidity, water=$water, light=$light]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (type != null) { + json[r'type'] = type; + } + if (time != null) { + json[r'time'] = time; + } + if (temperature != null) { + json[r'temperature'] = temperature; + } + if (pressure != null) { + json[r'pressure'] = pressure; + } + if (humidity != null) { + json[r'humidity'] = humidity; + } + if (water != null) { + json[r'water'] = water; + } + if (light != null) { + json[r'light'] = light; + } + return json; + } + + /// Returns a new [SmartGardenMessage] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static SmartGardenMessage fromJson(Map json) => json == null + ? null + : SmartGardenMessage( + id: json[r'id'], + type: json[r'type'], + time: json[r'time'], + temperature: json[r'temperature'], + pressure: json[r'pressure'], + humidity: json[r'humidity'], + water: json[r'water'], + light: json[r'light'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => SmartGardenMessage.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = SmartGardenMessage.fromJson(v)); + } + return map; + } + + // maps a json object with a list of SmartGardenMessage-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = SmartGardenMessage.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/smart_printer_message.dart b/mycore_api/lib/model/smart_printer_message.dart new file mode 100644 index 0000000..49a04c7 --- /dev/null +++ b/mycore_api/lib/model/smart_printer_message.dart @@ -0,0 +1,116 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class SmartPrinterMessage { + /// Returns a new [SmartPrinterMessage] instance. + SmartPrinterMessage({ + this.id, + this.type, + this.time, + this.temperature, + this.pressure, + this.smoke, + }); + + String id; + + String type; + + String time; + + double temperature; + + double pressure; + + int smoke; + + @override + bool operator ==(Object other) => identical(this, other) || other is SmartPrinterMessage && + other.id == id && + other.type == type && + other.time == time && + other.temperature == temperature && + other.pressure == pressure && + other.smoke == smoke; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (type == null ? 0 : type.hashCode) + + (time == null ? 0 : time.hashCode) + + (temperature == null ? 0 : temperature.hashCode) + + (pressure == null ? 0 : pressure.hashCode) + + (smoke == null ? 0 : smoke.hashCode); + + @override + String toString() => 'SmartPrinterMessage[id=$id, type=$type, time=$time, temperature=$temperature, pressure=$pressure, smoke=$smoke]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (type != null) { + json[r'type'] = type; + } + if (time != null) { + json[r'time'] = time; + } + if (temperature != null) { + json[r'temperature'] = temperature; + } + if (pressure != null) { + json[r'pressure'] = pressure; + } + if (smoke != null) { + json[r'smoke'] = smoke; + } + return json; + } + + /// Returns a new [SmartPrinterMessage] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static SmartPrinterMessage fromJson(Map json) => json == null + ? null + : SmartPrinterMessage( + id: json[r'id'], + type: json[r'type'], + time: json[r'time'], + temperature: json[r'temperature'], + pressure: json[r'pressure'], + smoke: json[r'smoke'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => SmartPrinterMessage.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = SmartPrinterMessage.fromJson(v)); + } + return map; + } + + // maps a json object with a list of SmartPrinterMessage-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = SmartPrinterMessage.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/state.dart b/mycore_api/lib/model/state.dart new file mode 100644 index 0000000..28f7ce9 --- /dev/null +++ b/mycore_api/lib/model/state.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class StateAPI { + /// Returns a new [State] instance. + StateAPI({ + this.name, + this.value, + }); + + String name; + + String value; + + @override + bool operator ==(Object other) => identical(this, other) || other is StateAPI && + other.name == name && + other.value == value; + + @override + int get hashCode => + (name == null ? 0 : name.hashCode) + + (value == null ? 0 : value.hashCode); + + @override + String toString() => 'State[name=$name, value=$value]'; + + Map toJson() { + final json = {}; + if (name != null) { + json[r'name'] = name; + } + if (value != null) { + json[r'value'] = value; + } + return json; + } + + /// Returns a new [State] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static StateAPI fromJson(Map json) => json == null + ? null + : StateAPI( + name: json[r'name'], + value: json[r'value'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => StateAPI.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = StateAPI.fromJson(v)); + } + return map; + } + + // maps a json object with a list of State-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = StateAPI.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/trigger.dart b/mycore_api/lib/model/trigger.dart new file mode 100644 index 0000000..d471689 --- /dev/null +++ b/mycore_api/lib/model/trigger.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class Trigger { + /// Returns a new [Trigger] instance. + Trigger({ + this.providerId, + this.deviceId, + this.stateName, + this.stateValue, + this.type, + }); + + String providerId; + + String deviceId; + + String stateName; + + String stateValue; + + TriggerType type; + + @override + bool operator ==(Object other) => identical(this, other) || other is Trigger && + other.providerId == providerId && + other.deviceId == deviceId && + other.stateName == stateName && + other.stateValue == stateValue && + other.type == type; + + @override + int get hashCode => + (providerId == null ? 0 : providerId.hashCode) + + (deviceId == null ? 0 : deviceId.hashCode) + + (stateName == null ? 0 : stateName.hashCode) + + (stateValue == null ? 0 : stateValue.hashCode) + + (type == null ? 0 : type.hashCode); + + @override + String toString() => 'Trigger[providerId=$providerId, deviceId=$deviceId, stateName=$stateName, stateValue=$stateValue, type=$type]'; + + Map toJson() { + final json = {}; + if (providerId != null) { + json[r'providerId'] = providerId; + } + if (deviceId != null) { + json[r'deviceId'] = deviceId; + } + if (stateName != null) { + json[r'stateName'] = stateName; + } + if (stateValue != null) { + json[r'stateValue'] = stateValue; + } + if (type != null) { + json[r'type'] = type; + } + return json; + } + + /// Returns a new [Trigger] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static Trigger fromJson(Map json) => json == null + ? null + : Trigger( + providerId: json[r'providerId'], + deviceId: json[r'deviceId'], + stateName: json[r'stateName'], + stateValue: json[r'stateValue'], + type: TriggerType.fromJson(json[r'type']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => Trigger.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = Trigger.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Trigger-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = Trigger.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/trigger_type.dart b/mycore_api/lib/model/trigger_type.dart new file mode 100644 index 0000000..b2e9bac --- /dev/null +++ b/mycore_api/lib/model/trigger_type.dart @@ -0,0 +1,79 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class TriggerType { + /// Instantiate a new enum with the provided [value]. + const TriggerType._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const MQTT = TriggerType._(r'MQTT'); + static const WEB = TriggerType._(r'WEB'); + static const TIME = TriggerType._(r'TIME'); + + /// List of all possible values in this [enum][TriggerType]. + static const values = [ + MQTT, + WEB, + TIME, + ]; + + static TriggerType fromJson(dynamic value) => + TriggerTypeTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => TriggerType.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [TriggerType] to String, +/// and [decode] dynamic data back to [TriggerType]. +class TriggerTypeTypeTransformer { + const TriggerTypeTypeTransformer._(); + + factory TriggerTypeTypeTransformer() => _instance ??= TriggerTypeTypeTransformer._(); + + String encode(TriggerType data) => data.value; + + /// Decodes a [dynamic value][data] to a TriggerType. + /// + /// 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. + TriggerType decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'MQTT': return TriggerType.MQTT; + case r'WEB': return TriggerType.WEB; + case r'TIME': return TriggerType.TIME; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [TriggerTypeTypeTransformer] instance. + static TriggerTypeTypeTransformer _instance; +} diff --git a/mycore_api/lib/model/twitter_auth_model.dart b/mycore_api/lib/model/twitter_auth_model.dart new file mode 100644 index 0000000..c9c8c76 --- /dev/null +++ b/mycore_api/lib/model/twitter_auth_model.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class TwitterAuthModel { + /// Returns a new [TwitterAuthModel] instance. + TwitterAuthModel({ + this.apiKey, + }); + + String apiKey; + + @override + bool operator ==(Object other) => identical(this, other) || other is TwitterAuthModel && + other.apiKey == apiKey; + + @override + int get hashCode => + (apiKey == null ? 0 : apiKey.hashCode); + + @override + String toString() => 'TwitterAuthModel[apiKey=$apiKey]'; + + Map toJson() { + final json = {}; + if (apiKey != null) { + json[r'apiKey'] = apiKey; + } + return json; + } + + /// Returns a new [TwitterAuthModel] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static TwitterAuthModel fromJson(Map json) => json == null + ? null + : TwitterAuthModel( + apiKey: json[r'apiKey'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => TwitterAuthModel.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = TwitterAuthModel.fromJson(v)); + } + return map; + } + + // maps a json object with a list of TwitterAuthModel-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = TwitterAuthModel.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/user.dart b/mycore_api/lib/model/user.dart new file mode 100644 index 0000000..5a7e287 --- /dev/null +++ b/mycore_api/lib/model/user.dart @@ -0,0 +1,80 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class User { + /// Returns a new [User] instance. + User({ + this.id, + this.password, + }); + + String id; + + String password; + + @override + bool operator ==(Object other) => identical(this, other) || other is User && + other.id == id && + other.password == password; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (password == null ? 0 : password.hashCode); + + @override + String toString() => 'User[id=$id, password=$password]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (password != null) { + json[r'password'] = password; + } + return json; + } + + /// Returns a new [User] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static User fromJson(Map json) => json == null + ? null + : User( + id: json[r'id'], + password: json[r'password'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => User.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = User.fromJson(v)); + } + return map; + } + + // maps a json object with a list of User-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = User.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/user_info.dart b/mycore_api/lib/model/user_info.dart new file mode 100644 index 0000000..7c1beb6 --- /dev/null +++ b/mycore_api/lib/model/user_info.dart @@ -0,0 +1,264 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class UserInfo { + /// Returns a new [UserInfo] instance. + UserInfo({ + this.id, + this.role, + this.email, + this.password, + this.firstName, + this.lastName, + this.token, + this.birthday, + this.dateCreation, + this.address, + this.city, + this.state, + this.country, + this.language, + this.timeZone, + this.postalCode, + this.automations, + this.devices, + this.providers, + this.groups, + this.screenConfigurationIds, + this.deviceIds, + }); + + String id; + + String role; + + String email; + + String password; + + String firstName; + + String lastName; + + String token; + + DateTime birthday; + + DateTime dateCreation; + + String address; + + String city; + + String state; + + String country; + + String language; + + String timeZone; + + int postalCode; + + List automations; + + List devices; + + List providers; + + List groups; + + List screenConfigurationIds; + + List deviceIds; + + @override + bool operator ==(Object other) => identical(this, other) || other is UserInfo && + other.id == id && + other.role == role && + other.email == email && + other.password == password && + other.firstName == firstName && + other.lastName == lastName && + other.token == token && + other.birthday == birthday && + other.dateCreation == dateCreation && + other.address == address && + other.city == city && + other.state == state && + other.country == country && + other.language == language && + other.timeZone == timeZone && + other.postalCode == postalCode && + other.automations == automations && + other.devices == devices && + other.providers == providers && + other.groups == groups && + other.screenConfigurationIds == screenConfigurationIds && + other.deviceIds == deviceIds; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (role == null ? 0 : role.hashCode) + + (email == null ? 0 : email.hashCode) + + (password == null ? 0 : password.hashCode) + + (firstName == null ? 0 : firstName.hashCode) + + (lastName == null ? 0 : lastName.hashCode) + + (token == null ? 0 : token.hashCode) + + (birthday == null ? 0 : birthday.hashCode) + + (dateCreation == null ? 0 : dateCreation.hashCode) + + (address == null ? 0 : address.hashCode) + + (city == null ? 0 : city.hashCode) + + (state == null ? 0 : state.hashCode) + + (country == null ? 0 : country.hashCode) + + (language == null ? 0 : language.hashCode) + + (timeZone == null ? 0 : timeZone.hashCode) + + (postalCode == null ? 0 : postalCode.hashCode) + + (automations == null ? 0 : automations.hashCode) + + (devices == null ? 0 : devices.hashCode) + + (providers == null ? 0 : providers.hashCode) + + (groups == null ? 0 : groups.hashCode) + + (screenConfigurationIds == null ? 0 : screenConfigurationIds.hashCode) + + (deviceIds == null ? 0 : deviceIds.hashCode); + + @override + String toString() => 'UserInfo[id=$id, role=$role, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, birthday=$birthday, dateCreation=$dateCreation, address=$address, city=$city, state=$state, country=$country, language=$language, timeZone=$timeZone, postalCode=$postalCode, automations=$automations, devices=$devices, providers=$providers, groups=$groups, screenConfigurationIds=$screenConfigurationIds, deviceIds=$deviceIds]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (role != null) { + json[r'role'] = role; + } + if (email != null) { + json[r'email'] = email; + } + if (password != null) { + json[r'password'] = password; + } + if (firstName != null) { + json[r'firstName'] = firstName; + } + if (lastName != null) { + json[r'lastName'] = lastName; + } + if (token != null) { + json[r'token'] = token; + } + if (birthday != null) { + json[r'birthday'] = birthday.toUtc().toIso8601String(); + } + if (dateCreation != null) { + json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); + } + if (address != null) { + json[r'address'] = address; + } + if (city != null) { + json[r'city'] = city; + } + if (state != null) { + json[r'state'] = state; + } + if (country != null) { + json[r'country'] = country; + } + if (language != null) { + json[r'language'] = language; + } + if (timeZone != null) { + json[r'timeZone'] = timeZone; + } + if (postalCode != null) { + json[r'postalCode'] = postalCode; + } + if (automations != null) { + json[r'automations'] = automations; + } + if (devices != null) { + json[r'devices'] = devices; + } + if (providers != null) { + json[r'providers'] = providers; + } + if (groups != null) { + json[r'groups'] = groups; + } + if (screenConfigurationIds != null) { + json[r'screenConfigurationIds'] = screenConfigurationIds; + } + if (deviceIds != null) { + json[r'deviceIds'] = deviceIds; + } + return json; + } + + /// Returns a new [UserInfo] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static UserInfo fromJson(Map json) => json == null + ? null + : UserInfo( + id: json[r'id'], + role: json[r'role'], + email: json[r'email'], + password: json[r'password'], + firstName: json[r'firstName'], + lastName: json[r'lastName'], + token: json[r'token'], + birthday: json[r'birthday'] == null + ? null + : DateTime.parse(json[r'birthday']), + dateCreation: json[r'dateCreation'] == null + ? null + : DateTime.parse(json[r'dateCreation']), + address: json[r'address'], + city: json[r'city'], + state: json[r'state'], + country: json[r'country'], + language: json[r'language'], + timeZone: json[r'timeZone'], + postalCode: json[r'postalCode'], + automations: Automation.listFromJson(json[r'automations']), + devices: Device.listFromJson(json[r'devices']), + providers: Provider.listFromJson(json[r'providers']), + groups: Group.listFromJson(json[r'groups']), + screenConfigurationIds: ScreenConfiguration.listFromJson(json[r'screenConfigurationIds']), + deviceIds: ScreenDevice.listFromJson(json[r'deviceIds']), + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => UserInfo.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = UserInfo.fromJson(v)); + } + return map; + } + + // maps a json object with a list of UserInfo-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = UserInfo.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/user_info_detail_dto.dart b/mycore_api/lib/model/user_info_detail_dto.dart new file mode 100644 index 0000000..2d7640b --- /dev/null +++ b/mycore_api/lib/model/user_info_detail_dto.dart @@ -0,0 +1,98 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class UserInfoDetailDTO { + /// Returns a new [UserInfoDetailDTO] instance. + UserInfoDetailDTO({ + this.id, + this.email, + this.firstName, + this.lastName, + }); + + String id; + + String email; + + String firstName; + + String lastName; + + @override + bool operator ==(Object other) => identical(this, other) || other is UserInfoDetailDTO && + other.id == id && + other.email == email && + other.firstName == firstName && + other.lastName == lastName; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (email == null ? 0 : email.hashCode) + + (firstName == null ? 0 : firstName.hashCode) + + (lastName == null ? 0 : lastName.hashCode); + + @override + String toString() => 'UserInfoDetailDTO[id=$id, email=$email, firstName=$firstName, lastName=$lastName]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (email != null) { + json[r'email'] = email; + } + if (firstName != null) { + json[r'firstName'] = firstName; + } + if (lastName != null) { + json[r'lastName'] = lastName; + } + return json; + } + + /// Returns a new [UserInfoDetailDTO] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static UserInfoDetailDTO fromJson(Map json) => json == null + ? null + : UserInfoDetailDTO( + id: json[r'id'], + email: json[r'email'], + firstName: json[r'firstName'], + lastName: json[r'lastName'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => UserInfoDetailDTO.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = UserInfoDetailDTO.fromJson(v)); + } + return map; + } + + // maps a json object with a list of UserInfoDetailDTO-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = UserInfoDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/lib/model/view_by.dart b/mycore_api/lib/model/view_by.dart new file mode 100644 index 0000000..f61f4cc --- /dev/null +++ b/mycore_api/lib/model/view_by.dart @@ -0,0 +1,79 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + + +class ViewBy { + /// Instantiate a new enum with the provided [value]. + const ViewBy._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const year = ViewBy._(r'Year'); + static const month = ViewBy._(r'Month'); + static const day = ViewBy._(r'Day'); + + /// List of all possible values in this [enum][ViewBy]. + static const values = [ + year, + month, + day, + ]; + + static ViewBy fromJson(dynamic value) => + ViewByTypeTransformer().decode(value); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json + .map((value) => ViewBy.fromJson(value)) + .toList(growable: true == growable); +} + +/// Transformation class that can [encode] an instance of [ViewBy] to String, +/// and [decode] dynamic data back to [ViewBy]. +class ViewByTypeTransformer { + const ViewByTypeTransformer._(); + + factory ViewByTypeTransformer() => _instance ??= ViewByTypeTransformer._(); + + String encode(ViewBy data) => data.value; + + /// Decodes a [dynamic value][data] to a ViewBy. + /// + /// 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. + ViewBy decode(dynamic data, {bool allowNull}) { + switch (data) { + case r'Year': return ViewBy.year; + case r'Month': return ViewBy.month; + case r'Day': return ViewBy.day; + default: + if (allowNull == false) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + return null; + } + + /// Singleton [ViewByTypeTransformer] instance. + static ViewByTypeTransformer _instance; +} diff --git a/mycore_api/lib/model/widget.dart b/mycore_api/lib/model/widget.dart new file mode 100644 index 0000000..f78812e --- /dev/null +++ b/mycore_api/lib/model/widget.dart @@ -0,0 +1,179 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class WidgetAPI { + /// Returns a new [Widget] instance. + WidgetAPI({ + this.id, + this.name, + this.displayName, + this.type, + this.activated, + this.form, + this.font, + this.color, + this.size, + this.width, + this.height, + this.positionX, + this.positionY, + }); + + String id; + + String name; + + String displayName; + + String type; + + bool activated; + + String form; + + String font; + + String color; + + String size; + + int width; + + int height; + + int positionX; + + int positionY; + + @override + bool operator ==(Object other) => identical(this, other) || other is WidgetAPI && + other.id == id && + other.name == name && + other.displayName == displayName && + other.type == type && + other.activated == activated && + other.form == form && + other.font == font && + other.color == color && + other.size == size && + other.width == width && + other.height == height && + other.positionX == positionX && + other.positionY == positionY; + + @override + int get hashCode => + (id == null ? 0 : id.hashCode) + + (name == null ? 0 : name.hashCode) + + (displayName == null ? 0 : displayName.hashCode) + + (type == null ? 0 : type.hashCode) + + (activated == null ? 0 : activated.hashCode) + + (form == null ? 0 : form.hashCode) + + (font == null ? 0 : font.hashCode) + + (color == null ? 0 : color.hashCode) + + (size == null ? 0 : size.hashCode) + + (width == null ? 0 : width.hashCode) + + (height == null ? 0 : height.hashCode) + + (positionX == null ? 0 : positionX.hashCode) + + (positionY == null ? 0 : positionY.hashCode); + + @override + String toString() => 'Widget[id=$id, name=$name, displayName=$displayName, type=$type, activated=$activated, form=$form, font=$font, color=$color, size=$size, width=$width, height=$height, positionX=$positionX, positionY=$positionY]'; + + Map toJson() { + final json = {}; + if (id != null) { + json[r'id'] = id; + } + if (name != null) { + json[r'name'] = name; + } + if (displayName != null) { + json[r'displayName'] = displayName; + } + if (type != null) { + json[r'type'] = type; + } + if (activated != null) { + json[r'activated'] = activated; + } + if (form != null) { + json[r'form'] = form; + } + if (font != null) { + json[r'font'] = font; + } + if (color != null) { + json[r'color'] = color; + } + if (size != null) { + json[r'size'] = size; + } + if (width != null) { + json[r'width'] = width; + } + if (height != null) { + json[r'height'] = height; + } + if (positionX != null) { + json[r'positionX'] = positionX; + } + if (positionY != null) { + json[r'positionY'] = positionY; + } + return json; + } + + /// Returns a new [Widget] instance and imports its values from + /// [json] if it's non-null, null if [json] is null. + static WidgetAPI fromJson(Map json) => json == null + ? null + : WidgetAPI( + id: json[r'id'], + name: json[r'name'], + displayName: json[r'displayName'], + type: json[r'type'], + activated: json[r'activated'], + form: json[r'form'], + font: json[r'font'], + color: json[r'color'], + size: json[r'size'], + width: json[r'width'], + height: json[r'height'], + positionX: json[r'positionX'], + positionY: json[r'positionY'], + ); + + static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => + json == null || json.isEmpty + ? true == emptyIsNull ? null : [] + : json.map((v) => WidgetAPI.fromJson(v)).toList(growable: true == growable); + + static Map mapFromJson(Map json) { + final map = {}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) => map[key] = WidgetAPI.fromJson(v)); + } + return map; + } + + // maps a json object with a list of Widget-objects as value to a dart map + static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { + final map = >{}; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic v) { + map[key] = WidgetAPI.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); + }); + } + return map; + } +} + diff --git a/mycore_api/openapi-dart-generator-4.2.jar b/mycore_api/openapi-dart-generator-4.2.jar new file mode 100644 index 0000000..327d008 Binary files /dev/null and b/mycore_api/openapi-dart-generator-4.2.jar differ diff --git a/mycore_api/openapi-generator-cli-5.1.0.jar b/mycore_api/openapi-generator-cli-5.1.0.jar new file mode 100644 index 0000000..693779b Binary files /dev/null and b/mycore_api/openapi-generator-cli-5.1.0.jar differ diff --git a/mycore_api/pubspec.yaml b/mycore_api/pubspec.yaml new file mode 100644 index 0000000..2a260d4 --- /dev/null +++ b/mycore_api/pubspec.yaml @@ -0,0 +1,20 @@ +# +# AUTO-GENERATED FILE, DO NOT MODIFY! +# + +name: 'mycoreapi' +version: '1.0.0' +description: 'OpenAPI API client' +authors: + - 'Author ' +homepage: 'homepage' +environment: + sdk: '>=2.0.0 <3.0.0' +dependencies: + http: '>=0.12.0 <0.13.0' + intl: '^0.16.1' + meta: '^1.1.8' + +dev_dependencies: + test: '>=1.3.0 <1.16.0' + diff --git a/mycore_api/swagger.yaml b/mycore_api/swagger.yaml new file mode 100644 index 0000000..b6e83e3 --- /dev/null +++ b/mycore_api/swagger.yaml @@ -0,0 +1,3021 @@ +x-generator: NSwag v13.9.2.0 (NJsonSchema v10.3.1.0 (Newtonsoft.Json v12.0.0.0)) +openapi: 3.0.0 +info: + title: MyCore Service + description: API description + version: Version Pre-Alpha +servers: + - url: 'http://192.168.31.140' +paths: + /api/books: + get: + tags: + - Books + operationId: Books_GetAll + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Book' + security: + - bearer: [] + post: + tags: + - Books + operationId: Books_Create + requestBody: + x-name: book + content: + application/json: + schema: + $ref: '#/components/schemas/Book' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Book' + security: + - bearer: [] + '/api/books/{id}': + get: + tags: + - Books + operationId: Books_Get + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/Book' + security: + - bearer: [] + put: + tags: + - Books + operationId: Books_Update + parameters: + - name: id + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + requestBody: + x-name: bookIn + content: + application/json: + schema: + $ref: '#/components/schemas/Book' + required: true + x-position: 2 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + delete: + tags: + - Books + operationId: Books_Delete + 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/device/{userId}': + get: + tags: + - Device + summary: Get all devices summary + operationId: Device_GetAll + parameters: + - name: userId + in: path + required: true + description: Id of user + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceSummaryDTO' + security: + - bearer: [] + '/api/device/detail/{deviceId}': + get: + tags: + - Device + summary: Get a specific device info + operationId: Device_GetDetail + parameters: + - name: deviceId + in: path + required: true + description: id of device + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + security: + - bearer: [] + '/api/device/{userId}/type/{type}': + get: + tags: + - Device + summary: Get list of devices from a type + operationId: Device_GetDevicesByType + parameters: + - name: userId + in: path + required: true + description: user Id + schema: + type: string + nullable: true + x-position: 1 + - name: type + in: path + required: true + description: device type + schema: + $ref: '#/components/schemas/DeviceType' + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDetailDTO' + security: + - bearer: [] + /api/device: + post: + tags: + - Device + summary: Create a device + operationId: Device_Create + requestBody: + x-name: deviceDetailDTO + description: Device to create + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + security: + - bearer: [] + '/api/device/{userId}/fromProvider/{providerId}': + post: + tags: + - Device + summary: Create devices from provider + operationId: Device_CreateDevicesFromProvider + parameters: + - name: userId + in: path + required: true + description: User Id + schema: + type: string + nullable: true + x-position: 1 + - name: providerId + in: path + required: true + description: Id of Provider + schema: + type: string + nullable: true + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDetailDTO' + security: + - bearer: [] + get: + tags: + - Device + summary: Get devices from provider + operationId: Device_GetDevicesFromProvider + parameters: + - name: userId + in: path + required: true + description: User Id + schema: + type: string + nullable: true + x-position: 1 + - name: providerId + in: path + required: true + description: Id of Provider + schema: + type: string + nullable: true + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDetailDTO' + security: + - bearer: [] + delete: + tags: + - Device + summary: Delete devices from provider + operationId: Device_DeleteDevicesFromProvider + parameters: + - name: userId + in: path + required: true + description: User Id + schema: + type: string + nullable: true + x-position: 1 + - name: providerId + in: path + required: true + description: Id of Provider + schema: + type: string + nullable: true + x-position: 2 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/device/zigbee2Mqtt/{userId}': + get: + tags: + - Device + summary: Get all zigbee2Mqtt devices + operationId: Device_GetDevicesFromZigbee2Mqtt + parameters: + - name: userId + in: path + required: true + description: User Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceDetailDTO' + security: + - bearer: [] + '/api/device/{deviceId}': + put: + tags: + - Device + summary: Update a device + operationId: Device_Update + parameters: + - name: deviceId + in: path + required: true + schema: + type: string + x-position: 2 + requestBody: + x-name: deviceDetailDTO + description: Device to update + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + security: + - bearer: [] + delete: + tags: + - Device + summary: Delete a device + operationId: Device_Delete + parameters: + - name: deviceId + in: path + required: true + description: Id of device to delete + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/device/user/{userId}': + delete: + tags: + - Device + summary: Delete all device for a specified + operationId: Device_DeleteAllForUser + parameters: + - name: userId + in: path + required: true + description: Id of user + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + /api/energy/electricity: + get: + tags: + - Energy + summary: Get summary production of Kwh/Year + operationId: Energy_GetElectricityProduction + parameters: + - name: userId + in: query + schema: + type: string + nullable: true + x-position: 1 + - name: viewBy + in: query + schema: + $ref: '#/components/schemas/ViewBy' + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ElectricityProduction' + security: + - bearer: [] + '/api/iot/smartprinter/{idDevice}': + get: + tags: + - IOT + summary: Retrieve all SmartPrinterMessage + operationId: IOT_GetSmartPrinterMessages + parameters: + - name: id + in: query + description: Id of the smart printer message + schema: + type: integer + format: int32 + x-position: 1 + - name: idDevice + in: path + required: true + schema: + type: string + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SmartPrinterMessage' + security: + - bearer: [] + post: + tags: + - IOT + summary: It's the method to post data from mqtt broker to Database (Thanks Rpi!) + operationId: IOT_PostToDBPrinter + parameters: + - name: idDevice + in: path + required: true + description: Id of the device to upload to DB + schema: + type: integer + format: int32 + x-position: 1 + requestBody: + x-name: content + description: Content that will be uploaded + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SmartPrinterMessage' + required: true + x-position: 2 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/iot/smartgarden/{idDevice}': + post: + tags: + - IOT + summary: It's the method to post data from mqtt broker to Database (Thanks Rpi!) + operationId: IOT_PostToDBSmartGarden + parameters: + - name: idDevice + in: path + required: true + schema: + type: integer + format: int32 + x-position: 1 + requestBody: + x-name: content + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SmartGardenMessage' + required: true + x-position: 2 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/odd/country/{id}/{oddRequest}': + get: + tags: + - Odd + summary: Get odds for one country and one odd value maximum + operationId: Odd_GetForCountry + parameters: + - name: id + in: path + required: true + description: 'id of country, e.g = BE for Belgium' + schema: + type: string + nullable: true + x-position: 1 + - name: oddRequest + in: path + required: true + description: Odd Maximum value + schema: + type: number + format: double + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/OddNice' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + '/api/odd/{oddRequest}': + get: + tags: + - Odd + summary: Get odds for one country and one odd value maximum + operationId: Odd_GetAll + parameters: + - name: oddRequest + in: path + required: true + description: Odd Maximum value + schema: + type: number + format: double + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/OddNice' + '404': + description: '' + content: + application/json: + schema: + type: string + '500': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + '/api/provider/{userId}': + get: + tags: + - Provider + summary: 'Get all user providers ' + operationId: Provider_GetAll + parameters: + - name: userId + in: path + required: true + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProviderDTO' + security: + - bearer: [] + /api/provider: + post: + tags: + - Provider + summary: Create a provider + operationId: Provider_Create + requestBody: + x-name: providerDTO + description: Provider to create + content: + application/json: + schema: + $ref: '#/components/schemas/ProviderDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ProviderDTO' + security: + - bearer: [] + put: + tags: + - Provider + summary: Update a provider + operationId: Provider_Update + requestBody: + x-name: providerDTO + description: Provider to update + content: + application/json: + schema: + $ref: '#/components/schemas/ProviderDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceDetailDTO' + security: + - bearer: [] + '/api/provider/{providerId}': + delete: + tags: + - Provider + summary: Delete a provider + operationId: Provider_Delete + parameters: + - name: providerId + in: path + required: true + description: Id of provider to delete + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + /api/device/screen: + get: + tags: + - ScreenDevice + operationId: ScreenDevice_GetAllScreenDevices + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ScreenDevice' + security: + - bearer: [] + post: + tags: + - ScreenDevice + operationId: ScreenDevice_CreateDevice + requestBody: + x-name: screenDevice + content: + application/json: + schema: + $ref: '#/components/schemas/ScreenDevice' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/device/screen/{screenDeviceId}': + get: + tags: + - ScreenDevice + operationId: ScreenDevice_GetDeviceInfo + parameters: + - name: screenDeviceId + in: path + required: true + description: Id of the screen device you want to get information + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ScreenDevice' + security: + - bearer: [] + put: + tags: + - ScreenDevice + operationId: ScreenDevice_UpdateDevice + parameters: + - name: screenDeviceId + in: path + required: true + schema: + type: integer + format: int32 + x-position: 1 + requestBody: + x-name: screenDevice + content: + application/json: + schema: + $ref: '#/components/schemas/ScreenDevice' + required: true + x-position: 2 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/device/screen/{deviceId}': + delete: + tags: + - ScreenDevice + operationId: ScreenDevice_DeleteDevice + parameters: + - name: deviceId + 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/mqtt: + post: + tags: + - MQTT + summary: Publish mqtt test + operationId: MQTT_PublishMessage + requestBody: + x-name: mqttMessageDTO + description: Message to send + content: + application/json: + schema: + $ref: '#/components/schemas/MqttMessageDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: boolean + security: + - bearer: [] + /api/layout/panelSection: + get: + tags: + - Layout + summary: 'It''s a test ! :) ' + operationId: Layout_Get + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PanelSection' + /api/token: + post: + tags: + - Token + operationId: Token_ConnectUser + requestBody: + x-name: loginDTO + content: + application/json: + schema: + $ref: '#/components/schemas/LoginDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfo' + /api/user: + get: + tags: + - User + summary: 'Get a list of user ' + operationId: User_Get + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + post: + tags: + - User + operationId: User_CreateUser + requestBody: + x-name: newUser + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfo' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfoDetailDTO' + put: + tags: + - User + operationId: User_UpdateUser + requestBody: + x-name: updatedUser + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfo' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfoDetailDTO' + security: + - bearer: [] + '/api/user/{id}': + get: + tags: + - User + summary: 'Get a specific user ' + operationId: User_Get2 + parameters: + - name: id + in: path + required: true + description: id user + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfoDetailDTO' + security: + - bearer: [] + delete: + tags: + - User + operationId: User_DeleteUser + 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/test: + get: + tags: + - Values + summary: 'It''s a test ! :) ' + operationId: Values_GetAll + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + type: string + post: + tags: + - Values + operationId: Values_Post + requestBody: + x-name: value + content: + application/json: + schema: + type: string + required: true + x-position: 1 + responses: + '200': + description: '' + security: + - bearer: [] + '/api/test/{id}': + get: + tags: + - Values + operationId: Values_Get + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: string + security: + - bearer: [] + put: + tags: + - Values + operationId: Values_Put + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + x-position: 1 + requestBody: + x-name: value + content: + application/json: + schema: + type: string + required: true + x-position: 2 + responses: + '200': + description: '' + security: + - bearer: [] + delete: + tags: + - Values + operationId: Values_Delete + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + x-position: 1 + responses: + '200': + description: '' + security: + - bearer: [] + /api/Authentication/Token: + post: + tags: + - Authentication + summary: Authenticate with form parameters (used by Swagger test client) + operationId: Authentication_AuthenticateWithForm + requestBody: + content: + multipart/form-data: + schema: + properties: + grant_type: + type: string + nullable: true + username: + type: string + nullable: true + password: + type: string + nullable: true + client_id: + type: string + nullable: true + client_secret: + type: string + nullable: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/LoginDTO' + '401': + description: Invalid credentials + content: + application/json: + schema: + type: string + '500': + description: Error + content: + application/json: + schema: + type: string + /api/Authentication/Authenticate: + post: + tags: + - Authentication + summary: Authenticate with Json parameters (used by most clients) + operationId: Authentication_AuthenticateWithJson + requestBody: + x-name: login + description: Login DTO + content: + application/json: + schema: + $ref: '#/components/schemas/LoginDTO' + required: true + x-position: 1 + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/LoginDTO' + '401': + description: Invalid credentials + content: + application/json: + schema: + type: string + '500': + description: Error + content: + application/json: + schema: + type: string + '/api/automation/{userId}': + get: + tags: + - Automation + summary: Get all automations for the specified user + operationId: Automation_GetAll + parameters: + - name: userId + in: path + required: true + description: Id of user + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RoomSummaryDTO' + security: + - bearer: [] + '/api/automation/detail/{automationId}': + get: + tags: + - Automation + summary: Get detail info of a specified automation + operationId: Automation_GetDetail + parameters: + - name: automationId + in: path + required: true + description: automation id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationDetailDTO' + security: + - bearer: [] + /api/automation: + post: + tags: + - Automation + operationId: Automation_Create + requestBody: + x-name: automationCreateOrUpdateDetail + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationDTO' + security: + - bearer: [] + put: + tags: + - Automation + summary: Update an automation + operationId: Automation_Update + requestBody: + x-name: automationCreateOrUpdateDetail + description: automation to update + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationCreateOrUpdateDetailDTO' + security: + - bearer: [] + '/api/automation/{automationId}': + delete: + tags: + - Automation + summary: Delete an automation + operationId: Automation_Delete + parameters: + - name: automationId + in: path + required: true + description: Id of automation to delete + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/automation/user/{userId}': + delete: + tags: + - Automation + summary: Delete all automation for a specified + operationId: Automation_DeleteAllForUser + parameters: + - name: userId + in: path + required: true + description: Id of user + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/group/{userId}': + get: + tags: + - Group + summary: Get all groups for the specified user + operationId: Group_GetAll + parameters: + - name: userId + in: path + required: true + description: Id of user + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GroupSummaryDTO' + security: + - bearer: [] + '/api/group/detail/{groupId}': + get: + tags: + - Group + summary: Get detail info of a specified group + operationId: Group_GetDetail + parameters: + - name: userId + in: query + description: user id + schema: + type: string + nullable: true + x-position: 1 + - name: groupId + in: path + required: true + description: groupid + schema: + type: string + nullable: true + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GroupDetailDTO' + security: + - bearer: [] + '/api/group/{userId}/type/{type}': + get: + tags: + - Group + summary: Get list of group from a type + operationId: Group_GetGroupsByType + parameters: + - name: userId + in: path + required: true + description: user Id + schema: + type: string + nullable: true + x-position: 1 + - name: type + in: path + required: true + description: group type + schema: + type: string + nullable: true + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GroupSummaryDTO' + security: + - bearer: [] + /api/group: + post: + tags: + - Group + summary: Create a group + operationId: Group_Create + requestBody: + x-name: groupCreateOrUpdateDetail + description: Group to create + content: + application/json: + schema: + $ref: '#/components/schemas/GroupCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GroupDetailDTO' + security: + - bearer: [] + put: + tags: + - Group + summary: Update a group + operationId: Group_Update + requestBody: + x-name: groupCreateOrUpdateDetail + description: group to update + content: + application/json: + schema: + $ref: '#/components/schemas/GroupCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GroupCreateOrUpdateDetailDTO' + security: + - bearer: [] + '/api/group/{userId}/fromZigbee': + post: + tags: + - Group + summary: Create groups from provider + operationId: Group_CreateDevicesFromZigbee2Mqtt + parameters: + - name: userId + in: path + required: true + description: User Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GroupDetailDTO' + security: + - bearer: [] + '/api/group/{groupId}/device/{deviceId}': + delete: + tags: + - Group + summary: Delete device from a group + operationId: Group_Delete + parameters: + - name: deviceId + in: path + required: true + description: Id of device to delete from the group + schema: + type: string + nullable: true + x-position: 1 + - name: groupId + in: path + required: true + description: 'Id of group ' + schema: + type: string + nullable: true + x-position: 2 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/group/{groupId}': + delete: + tags: + - Group + summary: Delete a group + operationId: Group_Delete2 + parameters: + - name: groupId + in: path + required: true + description: 'Id of group ' + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/group/zigbee2Mqtt/{userId}': + get: + tags: + - Group + summary: Get all zigbee2Mqtt groups + operationId: Group_GetGroupsFromZigbee2Mqtt + parameters: + - name: userId + in: path + required: true + description: User Id + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GroupDetailDTO' + security: + - bearer: [] + '/api/group/user/{userId}': + delete: + tags: + - Group + summary: Delete all group for a specified + operationId: Group_DeleteAllForUser + parameters: + - name: userId + in: path + required: true + description: Id of user + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/room/{userId}': + get: + tags: + - Room + summary: Get all rooms for the specified user + operationId: Room_GetAll + parameters: + - name: userId + in: path + required: true + description: Id of user + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RoomSummaryDTO' + security: + - bearer: [] + '/api/room/detail/{roomId}': + get: + tags: + - Room + summary: Get detail info of a specified room + operationId: Room_GetDetail + parameters: + - name: userId + in: query + description: user id + schema: + type: string + nullable: true + x-position: 1 + - name: roomId + in: path + required: true + description: room id + schema: + type: string + nullable: true + x-position: 2 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/RoomDetailDTO' + security: + - bearer: [] + /api/room: + post: + tags: + - Room + summary: Create a room + operationId: Room_Create + requestBody: + x-name: roomCreateOrUpdateDetail + description: Room to create + content: + application/json: + schema: + $ref: '#/components/schemas/RoomCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/RoomDetailDTO' + security: + - bearer: [] + put: + tags: + - Room + summary: Update a room + operationId: Room_Update + requestBody: + x-name: roomCreateOrUpdateDetail + description: room to update + content: + application/json: + schema: + $ref: '#/components/schemas/RoomCreateOrUpdateDetailDTO' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/RoomCreateOrUpdateDetailDTO' + security: + - bearer: [] + '/api/room/{roomId}/device/{deviceId}': + delete: + tags: + - Room + summary: Delete device from a room + operationId: Room_Delete + parameters: + - name: deviceId + in: path + required: true + description: Id of device to delete from the room + schema: + type: string + nullable: true + x-position: 1 + - name: roomId + in: path + required: true + description: 'Id of room ' + schema: + type: string + nullable: true + x-position: 2 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/room/{roomId}': + delete: + tags: + - Room + summary: Delete a room + operationId: Room_Delete2 + parameters: + - name: roomId + in: path + required: true + description: 'Id of room ' + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + '/api/room/user/{userId}': + delete: + tags: + - Room + summary: Delete all room for a specified + operationId: Room_DeleteAllForUser + parameters: + - name: userId + in: path + required: true + description: Id of user + schema: + type: string + nullable: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + security: + - bearer: [] + /azure: + post: + tags: + - Azure + operationId: Azure_Create + requestBody: + x-name: user + content: + application/json: + schema: + $ref: '#/components/schemas/AzureADAuthModel' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + /facebook: + post: + tags: + - Facebook + operationId: Facebook_Create + requestBody: + x-name: user + content: + application/json: + schema: + $ref: '#/components/schemas/FacebookAuthModel' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + /google: + post: + tags: + - Google + operationId: Google_Create + requestBody: + x-name: user + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleAuthModel' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + /token: + post: + tags: + - Token + operationId: Token_Create + requestBody: + x-name: user + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary + /twitter: + post: + tags: + - Twitter + operationId: Twitter_Create + requestBody: + x-name: user + content: + application/json: + schema: + $ref: '#/components/schemas/TwitterAuthModel' + required: true + x-position: 1 + responses: + '200': + description: '' + content: + application/octet-stream: + schema: + type: string + format: binary +components: + schemas: + Book: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + bookName: + type: string + nullable: true + price: + type: number + format: decimal + category: + type: string + nullable: true + author: + type: string + nullable: true + DeviceSummaryDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + userId: + type: string + nullable: true + description: + type: string + nullable: true + name: + type: string + nullable: true + model: + type: string + nullable: true + type: + $ref: '#/components/schemas/DeviceType' + status: + type: boolean + connectionStatus: + $ref: '#/components/schemas/ConnectionStatus' + locationId: + type: string + nullable: true + providerId: + type: string + nullable: true + providerName: + type: string + nullable: true + location: + nullable: true + oneOf: + - $ref: '#/components/schemas/LocationDTO' + lastStateDate: + type: string + format: date-time + battery: + type: boolean + batteryStatus: + type: integer + format: int32 + DeviceType: + type: string + description: '' + x-enumNames: + - Sensor + - Actuator + - Camera + - Switch + - Light + - Sound + - Plug + - Multiplug + - Thermostat + - Valve + - Door + - Environment + - Motion + - Gateway + - Unknown + enum: + - Sensor + - Actuator + - Camera + - Switch + - Light + - Sound + - Plug + - Multiplug + - Thermostat + - Valve + - Door + - Environment + - Motion + - Gateway + - Unknown + ConnectionStatus: + type: string + description: '' + x-enumNames: + - Connected + - Disconnected + - Unknown + enum: + - Connected + - Disconnected + - Unknown + LocationDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + DeviceDetailDTO: + allOf: + - $ref: '#/components/schemas/DeviceSummaryDTO' + - type: object + additionalProperties: false + properties: + firmwareVersion: + type: string + nullable: true + hardwareVersion: + type: string + nullable: true + port: + type: integer + format: int32 + meansOfCommunications: + type: array + nullable: true + items: + $ref: '#/components/schemas/MeansOfCommunication' + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + lastState: + type: string + nullable: true + ipAddress: + type: string + nullable: true + serviceIdentification: + type: string + nullable: true + manufacturerName: + type: string + nullable: true + groupIds: + type: array + nullable: true + items: + type: string + properties: + type: object + nullable: true + additionalProperties: {} + supportedOperations: + type: array + nullable: true + items: + type: string + MeansOfCommunication: + type: string + description: '' + x-enumNames: + - Wifi + - Bluetooth + - Zigbee + - Zwave + enum: + - Wifi + - Bluetooth + - Zigbee + - Zwave + ElectricityProduction: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + deviceId: + type: string + nullable: true + userId: + type: string + nullable: true + watt: + type: number + format: double + ampere: + type: number + format: double + timestamp: + type: string + format: date-time + ViewBy: + type: string + description: '' + x-enumNames: + - Year + - Month + - Day + enum: + - Year + - Month + - Day + SmartPrinterMessage: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + type: + type: string + nullable: true + time: + type: string + nullable: true + temperature: + type: number + format: double + pressure: + type: number + format: double + smoke: + type: integer + format: int32 + SmartGardenMessage: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + type: + type: string + nullable: true + time: + type: string + nullable: true + temperature: + type: number + format: double + pressure: + type: number + format: double + humidity: + type: number + format: double + water: + type: integer + format: int32 + light: + type: integer + format: int32 + OddNice: + type: object + additionalProperties: false + properties: + teams: + type: array + nullable: true + items: + type: string + commence_time: + type: integer + format: int32 + home_team: + type: string + nullable: true + odds: + nullable: true + oneOf: + - $ref: '#/components/schemas/OddH2H' + OddH2H: + type: object + additionalProperties: false + properties: + homeOdd: + type: number + format: double + drawOdd: + type: number + format: double + visitOdd: + type: number + format: double + ProviderDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + type: + type: string + nullable: true + userId: + type: string + nullable: true + endpoint: + type: string + nullable: true + username: + type: string + nullable: true + password: + type: string + nullable: true + apiKey: + type: string + nullable: true + active: + type: boolean + ScreenDevice: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + type: + type: string + nullable: true + location: + type: string + nullable: true + locationExplanation: + type: string + nullable: true + height: + type: integer + format: int32 + width: + type: integer + format: int32 + MqttMessageDTO: + type: object + additionalProperties: false + properties: + topic: + type: string + nullable: true + message: + type: string + nullable: true + online: + type: boolean + PanelSection: + type: object + additionalProperties: false + properties: + label: + type: string + nullable: true + icon: + type: string + nullable: true + color: + type: string + nullable: true + defaultRoute: + type: string + nullable: true + children: + type: array + nullable: true + items: + $ref: '#/components/schemas/PanelMenuItem' + PanelMenuItem: + type: object + additionalProperties: false + properties: + label: + type: string + nullable: true + route: + type: string + nullable: true + icon: + type: string + nullable: true + color: + type: string + nullable: true + badgeValue: + type: integer + format: int32 + badgeType: + type: string + nullable: true + children: + type: array + nullable: true + items: + $ref: '#/components/schemas/PanelMenuItem' + UserInfo: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + role: + type: string + nullable: true + email: + type: string + nullable: true + password: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + token: + type: string + nullable: true + birthday: + type: string + format: date-time + dateCreation: + type: string + format: date-time + address: + type: string + nullable: true + city: + type: string + nullable: true + state: + type: string + nullable: true + country: + type: string + nullable: true + language: + type: string + nullable: true + timeZone: + type: string + nullable: true + postalCode: + type: integer + format: int32 + automations: + type: array + nullable: true + items: + $ref: '#/components/schemas/Automation' + devices: + type: array + nullable: true + items: + $ref: '#/components/schemas/Device' + providers: + type: array + nullable: true + items: + $ref: '#/components/schemas/Provider' + groups: + type: array + nullable: true + items: + $ref: '#/components/schemas/Group' + screenConfigurationIds: + type: array + nullable: true + items: + $ref: '#/components/schemas/ScreenConfiguration' + deviceIds: + type: array + nullable: true + items: + $ref: '#/components/schemas/ScreenDevice' + Automation: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + userId: + type: string + nullable: true + name: + type: string + nullable: true + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + triggers: + type: array + nullable: true + items: + $ref: '#/components/schemas/Trigger' + conditions: + type: array + nullable: true + items: + $ref: '#/components/schemas/Condition' + actions: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + devicesIds: + type: array + nullable: true + items: + type: string + Trigger: + type: object + additionalProperties: false + properties: + providerId: + type: string + nullable: true + deviceId: + type: string + nullable: true + stateName: + type: string + nullable: true + stateValue: + type: string + nullable: true + type: + $ref: '#/components/schemas/TriggerType' + TriggerType: + type: string + description: '' + x-enumNames: + - MQTT + - WEB + - TIME + enum: + - MQTT + - WEB + - TIME + Condition: + type: object + additionalProperties: false + properties: + deviceId: + type: string + nullable: true + state: + nullable: true + oneOf: + - $ref: '#/components/schemas/State' + startTime: + type: string + nullable: true + endTime: + type: string + nullable: true + type: + $ref: '#/components/schemas/ConditionType' + value: + $ref: '#/components/schemas/ConditionValue' + State: + type: object + additionalProperties: false + properties: + name: + type: string + nullable: true + value: + type: string + nullable: true + ConditionType: + type: string + description: '' + x-enumNames: + - STATE + - TIME + enum: + - STATE + - TIME + ConditionValue: + type: string + description: '' + x-enumNames: + - EQUAL + - NOT_EQUAL + - BIGGER + - BIGGEST + - SMALLER + - SMALLEST + enum: + - EQUAL + - NOT_EQUAL + - BIGGER + - BIGGEST + - SMALLER + - SMALLEST + Action: + type: object + additionalProperties: false + properties: + groupId: + type: string + nullable: true + deviceId: + type: string + nullable: true + states: + type: array + nullable: true + items: + $ref: '#/components/schemas/State' + rawRequest: + type: string + nullable: true + providerId: + type: string + nullable: true + type: + $ref: '#/components/schemas/ActionType' + ActionType: + type: string + description: '' + x-enumNames: + - DELAY + - DEVICE + - HTTP + - ZIGBEE2MQTT + - MQTT + - GROUP + enum: + - DELAY + - DEVICE + - HTTP + - ZIGBEE2MQTT + - MQTT + - GROUP + Device: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + userId: + type: string + nullable: true + name: + type: string + nullable: true + description: + type: string + nullable: true + model: + type: string + nullable: true + port: + type: integer + format: int32 + firmwareVersion: + type: string + nullable: true + hardwareVersion: + type: string + nullable: true + status: + type: boolean + type: + $ref: '#/components/schemas/DeviceType' + connectionStatus: + $ref: '#/components/schemas/ConnectionStatus' + locationId: + type: string + nullable: true + meansOfCommunications: + type: array + nullable: true + items: + $ref: '#/components/schemas/MeansOfCommunication' + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + lastState: + type: string + nullable: true + lastStateDate: + type: string + format: date-time + ipAddress: + type: string + nullable: true + serviceIdentification: + type: string + nullable: true + battery: + type: boolean + batteryStatus: + type: integer + format: int32 + providerId: + type: string + nullable: true + manufacturerName: + type: string + nullable: true + groupIds: + type: array + nullable: true + items: + type: string + properties: + type: object + nullable: true + additionalProperties: {} + supportedOperations: + type: array + nullable: true + items: + type: string + Provider: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + userId: + type: string + nullable: true + name: + type: string + nullable: true + type: + type: string + nullable: true + username: + type: string + nullable: true + password: + type: string + nullable: true + endpoint: + type: string + nullable: true + apiKey: + type: string + nullable: true + value: + type: string + nullable: true + active: + type: boolean + Group: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + userId: + type: string + nullable: true + name: + type: string + nullable: true + type: + type: string + nullable: true + serviceIdentification: + type: integer + format: int32 + isAlarm: + type: boolean + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + devicesIds: + type: array + nullable: true + items: + type: string + ScreenConfiguration: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + type: + type: string + nullable: true + widgets: + type: array + nullable: true + items: + $ref: '#/components/schemas/Widget' + height: + type: integer + format: int32 + width: + type: integer + format: int32 + Widget: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + displayName: + type: string + nullable: true + type: + type: string + nullable: true + activated: + type: boolean + form: + type: string + nullable: true + font: + type: string + nullable: true + color: + type: string + nullable: true + size: + type: string + nullable: true + width: + type: integer + format: int32 + height: + type: integer + format: int32 + positionX: + type: integer + format: int32 + positionY: + type: integer + format: int32 + LoginDTO: + type: object + additionalProperties: false + properties: + email: + type: string + nullable: true + password: + type: string + nullable: true + UserInfoDetailDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + email: + type: string + nullable: true + firstName: + type: string + nullable: true + lastName: + type: string + nullable: true + RoomSummaryDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + userId: + type: string + nullable: true + name: + type: string + nullable: true + AutomationDetailDTO: + allOf: + - $ref: '#/components/schemas/AutomationDTO' + - type: object + additionalProperties: false + properties: + triggers: + type: array + nullable: true + items: + $ref: '#/components/schemas/Trigger' + conditions: + type: array + nullable: true + items: + $ref: '#/components/schemas/Condition' + actions: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + devicesIds: + type: array + nullable: true + items: + type: string + AutomationDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + name: + type: string + nullable: true + userId: + type: string + nullable: true + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + AutomationCreateOrUpdateDetailDTO: + allOf: + - $ref: '#/components/schemas/AutomationDTO' + - type: object + additionalProperties: false + properties: + triggers: + type: array + nullable: true + items: + $ref: '#/components/schemas/Trigger' + conditions: + type: array + nullable: true + items: + $ref: '#/components/schemas/Condition' + actions: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + deviceIds: + type: array + nullable: true + items: + type: string + GroupSummaryDTO: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + userId: + type: string + nullable: true + name: + type: string + nullable: true + type: + type: string + nullable: true + isAlarm: + type: boolean + GroupDetailDTO: + allOf: + - $ref: '#/components/schemas/GroupSummaryDTO' + - type: object + additionalProperties: false + properties: + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + devices: + type: array + nullable: true + items: + $ref: '#/components/schemas/DeviceDetailDTO' + GroupCreateOrUpdateDetailDTO: + allOf: + - $ref: '#/components/schemas/GroupSummaryDTO' + - type: object + additionalProperties: false + properties: + deviceIds: + type: array + nullable: true + items: + type: string + RoomDetailDTO: + allOf: + - $ref: '#/components/schemas/RoomSummaryDTO' + - type: object + additionalProperties: false + properties: + createdDate: + type: string + format: date-time + updatedDate: + type: string + format: date-time + devices: + type: array + nullable: true + items: + $ref: '#/components/schemas/DeviceDetailDTO' + RoomCreateOrUpdateDetailDTO: + allOf: + - $ref: '#/components/schemas/RoomSummaryDTO' + - type: object + additionalProperties: false + properties: + deviceIds: + type: array + nullable: true + items: + type: string + AzureADAuthModel: + type: object + additionalProperties: false + properties: + apiKey: + type: string + nullable: true + FacebookAuthModel: + type: object + additionalProperties: false + properties: + userAccessToken: + type: string + nullable: true + GoogleAuthModel: + type: object + additionalProperties: false + properties: + authorizationCode: + type: string + nullable: true + apiKey: + type: string + nullable: true + User: + type: object + additionalProperties: false + properties: + id: + type: string + nullable: true + password: + type: string + nullable: true + TwitterAuthModel: + type: object + additionalProperties: false + properties: + apiKey: + type: string + nullable: true + securitySchemes: + bearer: + type: oauth2 + description: MyCore Authentication + flows: + password: + authorizationUrl: /authentication/Token + tokenUrl: /api/authentication/Token + scopes: + MyCore-api: MyCore WebAPI +security: + - bearer: [] +tags: + - name: Authentication + description: Authentication management diff --git a/mycore_api/test/action_test.dart b/mycore_api/test/action_test.dart new file mode 100644 index 0000000..f3e6914 --- /dev/null +++ b/mycore_api/test/action_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Action +void main() { + final instance = Action(); + + group('test Action', () { + // String groupId + test('to test the property `groupId`', () async { + // TODO + }); + + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // List states (default value: const []) + test('to test the property `states`', () async { + // TODO + }); + + // String rawRequest + test('to test the property `rawRequest`', () async { + // TODO + }); + + // String providerId + test('to test the property `providerId`', () async { + // TODO + }); + + // ActionType type + test('to test the property `type`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/action_type_test.dart b/mycore_api/test/action_type_test.dart new file mode 100644 index 0000000..f0c08c3 --- /dev/null +++ b/mycore_api/test/action_type_test.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ActionType +void main() { + + group('test ActionType', () { + + }); + +} diff --git a/mycore_api/test/authentication_api_test.dart b/mycore_api/test/authentication_api_test.dart new file mode 100644 index 0000000..ff8de62 --- /dev/null +++ b/mycore_api/test/authentication_api_test.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for AuthenticationApi +void main() { + final instance = AuthenticationApi(); + + group('tests for AuthenticationApi', () { + // Authenticate with form parameters (used by Swagger test client) + // + //Future authenticationAuthenticateWithForm({ String grantType, String username, String password, String clientId, String clientSecret }) async + test('test authenticationAuthenticateWithForm', () async { + // TODO + }); + + // Authenticate with Json parameters (used by most clients) + // + //Future authenticationAuthenticateWithJson(LoginDTO loginDTO) async + test('test authenticationAuthenticateWithJson', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/automation_api_test.dart b/mycore_api/test/automation_api_test.dart new file mode 100644 index 0000000..cef701b --- /dev/null +++ b/mycore_api/test/automation_api_test.dart @@ -0,0 +1,60 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for AutomationApi +void main() { + final instance = AutomationApi(); + + group('tests for AutomationApi', () { + //Future automationCreate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async + test('test automationCreate', () async { + // TODO + }); + + // Delete an automation + // + //Future automationDelete(String automationId) async + test('test automationDelete', () async { + // TODO + }); + + // Delete all automation for a specified + // + //Future automationDeleteAllForUser(String userId) async + test('test automationDeleteAllForUser', () async { + // TODO + }); + + // Get all automations for the specified user + // + //Future> automationGetAll(String userId) async + test('test automationGetAll', () async { + // TODO + }); + + // Get detail info of a specified automation + // + //Future automationGetDetail(String automationId) async + test('test automationGetDetail', () async { + // TODO + }); + + // Update an automation + // + //Future automationUpdate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async + test('test automationUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/automation_create_or_update_detail_dto_all_of_test.dart b/mycore_api/test/automation_create_or_update_detail_dto_all_of_test.dart new file mode 100644 index 0000000..a24303f --- /dev/null +++ b/mycore_api/test/automation_create_or_update_detail_dto_all_of_test.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AutomationCreateOrUpdateDetailDTOAllOf +void main() { + final instance = AutomationCreateOrUpdateDetailDTOAllOf(); + + group('test AutomationCreateOrUpdateDetailDTOAllOf', () { + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List conditions (default value: const []) + test('to test the property `conditions`', () async { + // TODO + }); + + // List actions (default value: const []) + test('to test the property `actions`', () async { + // TODO + }); + + // List deviceIds (default value: const []) + test('to test the property `deviceIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/automation_create_or_update_detail_dto_test.dart b/mycore_api/test/automation_create_or_update_detail_dto_test.dart new file mode 100644 index 0000000..5f01d0e --- /dev/null +++ b/mycore_api/test/automation_create_or_update_detail_dto_test.dart @@ -0,0 +1,66 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AutomationCreateOrUpdateDetailDTO +void main() { + final instance = AutomationCreateOrUpdateDetailDTO(); + + group('test AutomationCreateOrUpdateDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List conditions (default value: const []) + test('to test the property `conditions`', () async { + // TODO + }); + + // List actions (default value: const []) + test('to test the property `actions`', () async { + // TODO + }); + + // List deviceIds (default value: const []) + test('to test the property `deviceIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/automation_detail_dto_all_of_test.dart b/mycore_api/test/automation_detail_dto_all_of_test.dart new file mode 100644 index 0000000..cd53513 --- /dev/null +++ b/mycore_api/test/automation_detail_dto_all_of_test.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AutomationDetailDTOAllOf +void main() { + final instance = AutomationDetailDTOAllOf(); + + group('test AutomationDetailDTOAllOf', () { + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List conditions (default value: const []) + test('to test the property `conditions`', () async { + // TODO + }); + + // List actions (default value: const []) + test('to test the property `actions`', () async { + // TODO + }); + + // List devicesIds (default value: const []) + test('to test the property `devicesIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/automation_detail_dto_test.dart b/mycore_api/test/automation_detail_dto_test.dart new file mode 100644 index 0000000..d5efa73 --- /dev/null +++ b/mycore_api/test/automation_detail_dto_test.dart @@ -0,0 +1,66 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AutomationDetailDTO +void main() { + final instance = AutomationDetailDTO(); + + group('test AutomationDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List conditions (default value: const []) + test('to test the property `conditions`', () async { + // TODO + }); + + // List actions (default value: const []) + test('to test the property `actions`', () async { + // TODO + }); + + // List devicesIds (default value: const []) + test('to test the property `devicesIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/automation_dto_test.dart b/mycore_api/test/automation_dto_test.dart new file mode 100644 index 0000000..c3230e5 --- /dev/null +++ b/mycore_api/test/automation_dto_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AutomationDTO +void main() { + final instance = AutomationDTO(); + + group('test AutomationDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/automation_test.dart b/mycore_api/test/automation_test.dart new file mode 100644 index 0000000..1ea7cc9 --- /dev/null +++ b/mycore_api/test/automation_test.dart @@ -0,0 +1,66 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Automation +void main() { + final instance = Automation(); + + group('test Automation', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List triggers (default value: const []) + test('to test the property `triggers`', () async { + // TODO + }); + + // List conditions (default value: const []) + test('to test the property `conditions`', () async { + // TODO + }); + + // List actions (default value: const []) + test('to test the property `actions`', () async { + // TODO + }); + + // List devicesIds (default value: const []) + test('to test the property `devicesIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/azure_ad_auth_model_test.dart b/mycore_api/test/azure_ad_auth_model_test.dart new file mode 100644 index 0000000..61e3f1d --- /dev/null +++ b/mycore_api/test/azure_ad_auth_model_test.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for AzureADAuthModel +void main() { + final instance = AzureADAuthModel(); + + group('test AzureADAuthModel', () { + // String apiKey + test('to test the property `apiKey`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/azure_api_test.dart b/mycore_api/test/azure_api_test.dart new file mode 100644 index 0000000..06fb54d --- /dev/null +++ b/mycore_api/test/azure_api_test.dart @@ -0,0 +1,25 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for AzureApi +void main() { + final instance = AzureApi(); + + group('tests for AzureApi', () { + //Future azureCreate(AzureADAuthModel azureADAuthModel) async + test('test azureCreate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/book_test.dart b/mycore_api/test/book_test.dart new file mode 100644 index 0000000..5099f95 --- /dev/null +++ b/mycore_api/test/book_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Book +void main() { + final instance = Book(); + + group('test Book', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String bookName + test('to test the property `bookName`', () async { + // TODO + }); + + // num price + test('to test the property `price`', () async { + // TODO + }); + + // String category + test('to test the property `category`', () async { + // TODO + }); + + // String author + test('to test the property `author`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/books_api_test.dart b/mycore_api/test/books_api_test.dart new file mode 100644 index 0000000..53ddc9a --- /dev/null +++ b/mycore_api/test/books_api_test.dart @@ -0,0 +1,45 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for BooksApi +void main() { + final instance = BooksApi(); + + group('tests for BooksApi', () { + //Future booksCreate(Book book) async + test('test booksCreate', () async { + // TODO + }); + + //Future booksDelete(String id) async + test('test booksDelete', () async { + // TODO + }); + + //Future booksGet(String id) async + test('test booksGet', () async { + // TODO + }); + + //Future> booksGetAll() async + test('test booksGetAll', () async { + // TODO + }); + + //Future booksUpdate(String id, Book book) async + test('test booksUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/condition_test.dart b/mycore_api/test/condition_test.dart new file mode 100644 index 0000000..82ae0fb --- /dev/null +++ b/mycore_api/test/condition_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Condition +void main() { + final instance = Condition(); + + group('test Condition', () { + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // OneOfState state + test('to test the property `state`', () async { + // TODO + }); + + // String startTime + test('to test the property `startTime`', () async { + // TODO + }); + + // String endTime + test('to test the property `endTime`', () async { + // TODO + }); + + // ConditionType type + test('to test the property `type`', () async { + // TODO + }); + + // ConditionValue value + test('to test the property `value`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/condition_type_test.dart b/mycore_api/test/condition_type_test.dart new file mode 100644 index 0000000..acdff11 --- /dev/null +++ b/mycore_api/test/condition_type_test.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ConditionType +void main() { + + group('test ConditionType', () { + + }); + +} diff --git a/mycore_api/test/condition_value_test.dart b/mycore_api/test/condition_value_test.dart new file mode 100644 index 0000000..efb3270 --- /dev/null +++ b/mycore_api/test/condition_value_test.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ConditionValue +void main() { + + group('test ConditionValue', () { + + }); + +} diff --git a/mycore_api/test/connection_status_test.dart b/mycore_api/test/connection_status_test.dart new file mode 100644 index 0000000..b5e0825 --- /dev/null +++ b/mycore_api/test/connection_status_test.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ConnectionStatus +void main() { + + group('test ConnectionStatus', () { + + }); + +} diff --git a/mycore_api/test/device_api_test.dart b/mycore_api/test/device_api_test.dart new file mode 100644 index 0000000..7f0c599 --- /dev/null +++ b/mycore_api/test/device_api_test.dart @@ -0,0 +1,97 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for DeviceApi +void main() { + final instance = DeviceApi(); + + group('tests for DeviceApi', () { + // Create a device + // + //Future deviceCreate(DeviceDetailDTO deviceDetailDTO) async + test('test deviceCreate', () async { + // TODO + }); + + // Create devices from provider + // + //Future> deviceCreateDevicesFromProvider(String userId, String providerId) async + test('test deviceCreateDevicesFromProvider', () async { + // TODO + }); + + // Delete a device + // + //Future deviceDelete(String deviceId) async + test('test deviceDelete', () async { + // TODO + }); + + // Delete all device for a specified + // + //Future deviceDeleteAllForUser(String userId) async + test('test deviceDeleteAllForUser', () async { + // TODO + }); + + // Delete devices from provider + // + //Future deviceDeleteDevicesFromProvider(String userId, String providerId) async + test('test deviceDeleteDevicesFromProvider', () async { + // TODO + }); + + // Get all devices summary + // + //Future> deviceGetAll(String userId) async + test('test deviceGetAll', () async { + // TODO + }); + + // Get a specific device info + // + //Future deviceGetDetail(String deviceId) async + test('test deviceGetDetail', () async { + // TODO + }); + + // Get list of devices from a type + // + //Future> deviceGetDevicesByType(String userId, DeviceType type) async + test('test deviceGetDevicesByType', () async { + // TODO + }); + + // Get devices from provider + // + //Future> deviceGetDevicesFromProvider(String userId, String providerId) async + test('test deviceGetDevicesFromProvider', () async { + // TODO + }); + + // Get all zigbee2Mqtt devices + // + //Future> deviceGetDevicesFromZigbee2Mqtt(String userId) async + test('test deviceGetDevicesFromZigbee2Mqtt', () async { + // TODO + }); + + // Update a device + // + //Future deviceUpdate(String deviceId, DeviceDetailDTO deviceDetailDTO) async + test('test deviceUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/device_detail_dto_all_of_test.dart b/mycore_api/test/device_detail_dto_all_of_test.dart new file mode 100644 index 0000000..0f33460 --- /dev/null +++ b/mycore_api/test/device_detail_dto_all_of_test.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceDetailDTOAllOf +void main() { + final instance = DeviceDetailDTOAllOf(); + + group('test DeviceDetailDTOAllOf', () { + // String firmwareVersion + test('to test the property `firmwareVersion`', () async { + // TODO + }); + + // String hardwareVersion + test('to test the property `hardwareVersion`', () async { + // TODO + }); + + // int port + test('to test the property `port`', () async { + // TODO + }); + + // List meansOfCommunications (default value: const []) + test('to test the property `meansOfCommunications`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // String lastState + test('to test the property `lastState`', () async { + // TODO + }); + + // String ipAddress + test('to test the property `ipAddress`', () async { + // TODO + }); + + // String serviceIdentification + test('to test the property `serviceIdentification`', () async { + // TODO + }); + + // String manufacturerName + test('to test the property `manufacturerName`', () async { + // TODO + }); + + // List groupIds (default value: const []) + test('to test the property `groupIds`', () async { + // TODO + }); + + // Map properties (default value: const {}) + test('to test the property `properties`', () async { + // TODO + }); + + // List supportedOperations (default value: const []) + test('to test the property `supportedOperations`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/device_detail_dto_test.dart b/mycore_api/test/device_detail_dto_test.dart new file mode 100644 index 0000000..6e6d788 --- /dev/null +++ b/mycore_api/test/device_detail_dto_test.dart @@ -0,0 +1,161 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceDetailDTO +void main() { + final instance = DeviceDetailDTO(); + + group('test DeviceDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String description + test('to test the property `description`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String model + test('to test the property `model`', () async { + // TODO + }); + + // DeviceType type + test('to test the property `type`', () async { + // TODO + }); + + // bool status + test('to test the property `status`', () async { + // TODO + }); + + // ConnectionStatus connectionStatus + test('to test the property `connectionStatus`', () async { + // TODO + }); + + // String locationId + test('to test the property `locationId`', () async { + // TODO + }); + + // String providerId + test('to test the property `providerId`', () async { + // TODO + }); + + // String providerName + test('to test the property `providerName`', () async { + // TODO + }); + + // OneOfLocationDTO location + test('to test the property `location`', () async { + // TODO + }); + + // DateTime lastStateDate + test('to test the property `lastStateDate`', () async { + // TODO + }); + + // bool battery + test('to test the property `battery`', () async { + // TODO + }); + + // int batteryStatus + test('to test the property `batteryStatus`', () async { + // TODO + }); + + // String firmwareVersion + test('to test the property `firmwareVersion`', () async { + // TODO + }); + + // String hardwareVersion + test('to test the property `hardwareVersion`', () async { + // TODO + }); + + // int port + test('to test the property `port`', () async { + // TODO + }); + + // List meansOfCommunications (default value: const []) + test('to test the property `meansOfCommunications`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // String lastState + test('to test the property `lastState`', () async { + // TODO + }); + + // String ipAddress + test('to test the property `ipAddress`', () async { + // TODO + }); + + // String serviceIdentification + test('to test the property `serviceIdentification`', () async { + // TODO + }); + + // String manufacturerName + test('to test the property `manufacturerName`', () async { + // TODO + }); + + // List groupIds (default value: const []) + test('to test the property `groupIds`', () async { + // TODO + }); + + // Map properties (default value: const {}) + test('to test the property `properties`', () async { + // TODO + }); + + // List supportedOperations (default value: const []) + test('to test the property `supportedOperations`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/device_summary_dto_test.dart b/mycore_api/test/device_summary_dto_test.dart new file mode 100644 index 0000000..fd43725 --- /dev/null +++ b/mycore_api/test/device_summary_dto_test.dart @@ -0,0 +1,96 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceSummaryDTO +void main() { + final instance = DeviceSummaryDTO(); + + group('test DeviceSummaryDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String description + test('to test the property `description`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String model + test('to test the property `model`', () async { + // TODO + }); + + // DeviceType type + test('to test the property `type`', () async { + // TODO + }); + + // bool status + test('to test the property `status`', () async { + // TODO + }); + + // ConnectionStatus connectionStatus + test('to test the property `connectionStatus`', () async { + // TODO + }); + + // String locationId + test('to test the property `locationId`', () async { + // TODO + }); + + // String providerId + test('to test the property `providerId`', () async { + // TODO + }); + + // String providerName + test('to test the property `providerName`', () async { + // TODO + }); + + // OneOfLocationDTO location + test('to test the property `location`', () async { + // TODO + }); + + // DateTime lastStateDate + test('to test the property `lastStateDate`', () async { + // TODO + }); + + // bool battery + test('to test the property `battery`', () async { + // TODO + }); + + // int batteryStatus + test('to test the property `batteryStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/device_test.dart b/mycore_api/test/device_test.dart new file mode 100644 index 0000000..f8ae7f2 --- /dev/null +++ b/mycore_api/test/device_test.dart @@ -0,0 +1,151 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Device +void main() { + final instance = Device(); + + group('test Device', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String description + test('to test the property `description`', () async { + // TODO + }); + + // String model + test('to test the property `model`', () async { + // TODO + }); + + // int port + test('to test the property `port`', () async { + // TODO + }); + + // String firmwareVersion + test('to test the property `firmwareVersion`', () async { + // TODO + }); + + // String hardwareVersion + test('to test the property `hardwareVersion`', () async { + // TODO + }); + + // bool status + test('to test the property `status`', () async { + // TODO + }); + + // DeviceType type + test('to test the property `type`', () async { + // TODO + }); + + // ConnectionStatus connectionStatus + test('to test the property `connectionStatus`', () async { + // TODO + }); + + // String locationId + test('to test the property `locationId`', () async { + // TODO + }); + + // List meansOfCommunications (default value: const []) + test('to test the property `meansOfCommunications`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // String lastState + test('to test the property `lastState`', () async { + // TODO + }); + + // DateTime lastStateDate + test('to test the property `lastStateDate`', () async { + // TODO + }); + + // String ipAddress + test('to test the property `ipAddress`', () async { + // TODO + }); + + // String serviceIdentification + test('to test the property `serviceIdentification`', () async { + // TODO + }); + + // bool battery + test('to test the property `battery`', () async { + // TODO + }); + + // int batteryStatus + test('to test the property `batteryStatus`', () async { + // TODO + }); + + // String providerId + test('to test the property `providerId`', () async { + // TODO + }); + + // String manufacturerName + test('to test the property `manufacturerName`', () async { + // TODO + }); + + // List groupIds (default value: const []) + test('to test the property `groupIds`', () async { + // TODO + }); + + // Map properties (default value: const {}) + test('to test the property `properties`', () async { + // TODO + }); + + // List supportedOperations (default value: const []) + test('to test the property `supportedOperations`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/device_type_test.dart b/mycore_api/test/device_type_test.dart new file mode 100644 index 0000000..ad3d2e4 --- /dev/null +++ b/mycore_api/test/device_type_test.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for DeviceType +void main() { + + group('test DeviceType', () { + + }); + +} diff --git a/mycore_api/test/electricity_production_test.dart b/mycore_api/test/electricity_production_test.dart new file mode 100644 index 0000000..e366f6e --- /dev/null +++ b/mycore_api/test/electricity_production_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ElectricityProduction +void main() { + final instance = ElectricityProduction(); + + group('test ElectricityProduction', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // double watt + test('to test the property `watt`', () async { + // TODO + }); + + // double ampere + test('to test the property `ampere`', () async { + // TODO + }); + + // DateTime timestamp + test('to test the property `timestamp`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/energy_api_test.dart b/mycore_api/test/energy_api_test.dart new file mode 100644 index 0000000..3b3e5ad --- /dev/null +++ b/mycore_api/test/energy_api_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for EnergyApi +void main() { + final instance = EnergyApi(); + + group('tests for EnergyApi', () { + // Get summary production of Kwh/Year + // + //Future> energyGetElectricityProduction({ String userId, ViewBy viewBy }) async + test('test energyGetElectricityProduction', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/facebook_api_test.dart b/mycore_api/test/facebook_api_test.dart new file mode 100644 index 0000000..5c125fb --- /dev/null +++ b/mycore_api/test/facebook_api_test.dart @@ -0,0 +1,25 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for FacebookApi +void main() { + final instance = FacebookApi(); + + group('tests for FacebookApi', () { + //Future facebookCreate(FacebookAuthModel facebookAuthModel) async + test('test facebookCreate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/facebook_auth_model_test.dart b/mycore_api/test/facebook_auth_model_test.dart new file mode 100644 index 0000000..052e505 --- /dev/null +++ b/mycore_api/test/facebook_auth_model_test.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for FacebookAuthModel +void main() { + final instance = FacebookAuthModel(); + + group('test FacebookAuthModel', () { + // String userAccessToken + test('to test the property `userAccessToken`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/google_api_test.dart b/mycore_api/test/google_api_test.dart new file mode 100644 index 0000000..552b71e --- /dev/null +++ b/mycore_api/test/google_api_test.dart @@ -0,0 +1,25 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for GoogleApi +void main() { + final instance = GoogleApi(); + + group('tests for GoogleApi', () { + //Future googleCreate(GoogleAuthModel googleAuthModel) async + test('test googleCreate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/google_auth_model_test.dart b/mycore_api/test/google_auth_model_test.dart new file mode 100644 index 0000000..3fee505 --- /dev/null +++ b/mycore_api/test/google_auth_model_test.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GoogleAuthModel +void main() { + final instance = GoogleAuthModel(); + + group('test GoogleAuthModel', () { + // String authorizationCode + test('to test the property `authorizationCode`', () async { + // TODO + }); + + // String apiKey + test('to test the property `apiKey`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/group_api_test.dart b/mycore_api/test/group_api_test.dart new file mode 100644 index 0000000..6e44a50 --- /dev/null +++ b/mycore_api/test/group_api_test.dart @@ -0,0 +1,90 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for GroupApi +void main() { + final instance = GroupApi(); + + group('tests for GroupApi', () { + // Create a group + // + //Future groupCreate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async + test('test groupCreate', () async { + // TODO + }); + + // Create groups from provider + // + //Future> groupCreateDevicesFromZigbee2Mqtt(String userId) async + test('test groupCreateDevicesFromZigbee2Mqtt', () async { + // TODO + }); + + // Delete device from a group + // + //Future groupDelete(String deviceId, String groupId) async + test('test groupDelete', () async { + // TODO + }); + + // Delete a group + // + //Future groupDelete2(String groupId) async + test('test groupDelete2', () async { + // TODO + }); + + // Delete all group for a specified + // + //Future groupDeleteAllForUser(String userId) async + test('test groupDeleteAllForUser', () async { + // TODO + }); + + // Get all groups for the specified user + // + //Future> groupGetAll(String userId) async + test('test groupGetAll', () async { + // TODO + }); + + // Get detail info of a specified group + // + //Future groupGetDetail(String groupId, { String userId }) async + test('test groupGetDetail', () async { + // TODO + }); + + // Get list of group from a type + // + //Future> groupGetGroupsByType(String userId, String type) async + test('test groupGetGroupsByType', () async { + // TODO + }); + + // Get all zigbee2Mqtt groups + // + //Future> groupGetGroupsFromZigbee2Mqtt(String userId) async + test('test groupGetGroupsFromZigbee2Mqtt', () async { + // TODO + }); + + // Update a group + // + //Future groupUpdate(GroupCreateOrUpdateDetailDTO groupCreateOrUpdateDetailDTO) async + test('test groupUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/group_create_or_update_detail_dto_all_of_test.dart b/mycore_api/test/group_create_or_update_detail_dto_all_of_test.dart new file mode 100644 index 0000000..3977a0c --- /dev/null +++ b/mycore_api/test/group_create_or_update_detail_dto_all_of_test.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GroupCreateOrUpdateDetailDTOAllOf +void main() { + final instance = GroupCreateOrUpdateDetailDTOAllOf(); + + group('test GroupCreateOrUpdateDetailDTOAllOf', () { + // List deviceIds (default value: const []) + test('to test the property `deviceIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/group_create_or_update_detail_dto_test.dart b/mycore_api/test/group_create_or_update_detail_dto_test.dart new file mode 100644 index 0000000..fbf296f --- /dev/null +++ b/mycore_api/test/group_create_or_update_detail_dto_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GroupCreateOrUpdateDetailDTO +void main() { + final instance = GroupCreateOrUpdateDetailDTO(); + + group('test GroupCreateOrUpdateDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // bool isAlarm + test('to test the property `isAlarm`', () async { + // TODO + }); + + // List deviceIds (default value: const []) + test('to test the property `deviceIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/group_detail_dto_all_of_test.dart b/mycore_api/test/group_detail_dto_all_of_test.dart new file mode 100644 index 0000000..4690916 --- /dev/null +++ b/mycore_api/test/group_detail_dto_all_of_test.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GroupDetailDTOAllOf +void main() { + final instance = GroupDetailDTOAllOf(); + + group('test GroupDetailDTOAllOf', () { + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/group_detail_dto_test.dart b/mycore_api/test/group_detail_dto_test.dart new file mode 100644 index 0000000..854395b --- /dev/null +++ b/mycore_api/test/group_detail_dto_test.dart @@ -0,0 +1,61 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GroupDetailDTO +void main() { + final instance = GroupDetailDTO(); + + group('test GroupDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // bool isAlarm + test('to test the property `isAlarm`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/group_summary_dto_test.dart b/mycore_api/test/group_summary_dto_test.dart new file mode 100644 index 0000000..56cf15f --- /dev/null +++ b/mycore_api/test/group_summary_dto_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GroupSummaryDTO +void main() { + final instance = GroupSummaryDTO(); + + group('test GroupSummaryDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // bool isAlarm + test('to test the property `isAlarm`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/group_test.dart b/mycore_api/test/group_test.dart new file mode 100644 index 0000000..98ce30c --- /dev/null +++ b/mycore_api/test/group_test.dart @@ -0,0 +1,66 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Group +void main() { + final instance = Group(); + + group('test Group', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // int serviceIdentification + test('to test the property `serviceIdentification`', () async { + // TODO + }); + + // bool isAlarm + test('to test the property `isAlarm`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List devicesIds (default value: const []) + test('to test the property `devicesIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/iot_api_test.dart b/mycore_api/test/iot_api_test.dart new file mode 100644 index 0000000..eb6b467 --- /dev/null +++ b/mycore_api/test/iot_api_test.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for IOTApi +void main() { + final instance = IOTApi(); + + group('tests for IOTApi', () { + // Retrieve all SmartPrinterMessage + // + //Future> iOTGetSmartPrinterMessages(String idDevice, { int id }) async + test('test iOTGetSmartPrinterMessages', () async { + // TODO + }); + + // It's the method to post data from mqtt broker to Database (Thanks Rpi!) + // + //Future iOTPostToDBPrinter(int idDevice, List smartPrinterMessage) async + test('test iOTPostToDBPrinter', () async { + // TODO + }); + + // It's the method to post data from mqtt broker to Database (Thanks Rpi!) + // + //Future iOTPostToDBSmartGarden(int idDevice, List smartGardenMessage) async + test('test iOTPostToDBSmartGarden', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/layout_api_test.dart b/mycore_api/test/layout_api_test.dart new file mode 100644 index 0000000..dfe6a96 --- /dev/null +++ b/mycore_api/test/layout_api_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for LayoutApi +void main() { + final instance = LayoutApi(); + + group('tests for LayoutApi', () { + // It's a test ! :) + // + //Future> layoutGet() async + test('test layoutGet', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/location_dto_test.dart b/mycore_api/test/location_dto_test.dart new file mode 100644 index 0000000..e2e9db4 --- /dev/null +++ b/mycore_api/test/location_dto_test.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for LocationDTO +void main() { + final instance = LocationDTO(); + + group('test LocationDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/login_dto_test.dart b/mycore_api/test/login_dto_test.dart new file mode 100644 index 0000000..39508e0 --- /dev/null +++ b/mycore_api/test/login_dto_test.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for LoginDTO +void main() { + final instance = LoginDTO(); + + group('test LoginDTO', () { + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/means_of_communication_test.dart b/mycore_api/test/means_of_communication_test.dart new file mode 100644 index 0000000..87dd1a1 --- /dev/null +++ b/mycore_api/test/means_of_communication_test.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for MeansOfCommunication +void main() { + + group('test MeansOfCommunication', () { + + }); + +} diff --git a/mycore_api/test/mqtt_api_test.dart b/mycore_api/test/mqtt_api_test.dart new file mode 100644 index 0000000..fe8f38b --- /dev/null +++ b/mycore_api/test/mqtt_api_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for MQTTApi +void main() { + final instance = MQTTApi(); + + group('tests for MQTTApi', () { + // Publish mqtt test + // + //Future mQTTPublishMessage(MqttMessageDTO mqttMessageDTO) async + test('test mQTTPublishMessage', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/mqtt_message_dto_test.dart b/mycore_api/test/mqtt_message_dto_test.dart new file mode 100644 index 0000000..e53dbe5 --- /dev/null +++ b/mycore_api/test/mqtt_message_dto_test.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for MqttMessageDTO +void main() { + final instance = MqttMessageDTO(); + + group('test MqttMessageDTO', () { + // String topic + test('to test the property `topic`', () async { + // TODO + }); + + // String message + test('to test the property `message`', () async { + // TODO + }); + + // bool online + test('to test the property `online`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/odd_api_test.dart b/mycore_api/test/odd_api_test.dart new file mode 100644 index 0000000..8a147f5 --- /dev/null +++ b/mycore_api/test/odd_api_test.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for OddApi +void main() { + final instance = OddApi(); + + group('tests for OddApi', () { + // Get odds for one country and one odd value maximum + // + //Future> oddGetAll(double oddRequest) async + test('test oddGetAll', () async { + // TODO + }); + + // Get odds for one country and one odd value maximum + // + //Future> oddGetForCountry(String id, double oddRequest) async + test('test oddGetForCountry', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/odd_h2_h_test.dart b/mycore_api/test/odd_h2_h_test.dart new file mode 100644 index 0000000..41f302c --- /dev/null +++ b/mycore_api/test/odd_h2_h_test.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for OddH2H +void main() { + final instance = OddH2H(); + + group('test OddH2H', () { + // double homeOdd + test('to test the property `homeOdd`', () async { + // TODO + }); + + // double drawOdd + test('to test the property `drawOdd`', () async { + // TODO + }); + + // double visitOdd + test('to test the property `visitOdd`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/odd_nice_test.dart b/mycore_api/test/odd_nice_test.dart new file mode 100644 index 0000000..3cbc6e4 --- /dev/null +++ b/mycore_api/test/odd_nice_test.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for OddNice +void main() { + final instance = OddNice(); + + group('test OddNice', () { + // List teams (default value: const []) + test('to test the property `teams`', () async { + // TODO + }); + + // int commenceTime + test('to test the property `commenceTime`', () async { + // TODO + }); + + // String homeTeam + test('to test the property `homeTeam`', () async { + // TODO + }); + + // OneOfOddH2H odds + test('to test the property `odds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/panel_menu_item_test.dart b/mycore_api/test/panel_menu_item_test.dart new file mode 100644 index 0000000..c6866c1 --- /dev/null +++ b/mycore_api/test/panel_menu_item_test.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for PanelMenuItem +void main() { + final instance = PanelMenuItem(); + + group('test PanelMenuItem', () { + // String label + test('to test the property `label`', () async { + // TODO + }); + + // String route + test('to test the property `route`', () async { + // TODO + }); + + // String icon + test('to test the property `icon`', () async { + // TODO + }); + + // String color + test('to test the property `color`', () async { + // TODO + }); + + // int badgeValue + test('to test the property `badgeValue`', () async { + // TODO + }); + + // String badgeType + test('to test the property `badgeType`', () async { + // TODO + }); + + // List children (default value: const []) + test('to test the property `children`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/panel_section_test.dart b/mycore_api/test/panel_section_test.dart new file mode 100644 index 0000000..9070dd6 --- /dev/null +++ b/mycore_api/test/panel_section_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for PanelSection +void main() { + final instance = PanelSection(); + + group('test PanelSection', () { + // String label + test('to test the property `label`', () async { + // TODO + }); + + // String icon + test('to test the property `icon`', () async { + // TODO + }); + + // String color + test('to test the property `color`', () async { + // TODO + }); + + // String defaultRoute + test('to test the property `defaultRoute`', () async { + // TODO + }); + + // List children (default value: const []) + test('to test the property `children`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/provider_api_test.dart b/mycore_api/test/provider_api_test.dart new file mode 100644 index 0000000..4d48437 --- /dev/null +++ b/mycore_api/test/provider_api_test.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for ProviderApi +void main() { + final instance = ProviderApi(); + + group('tests for ProviderApi', () { + // Create a provider + // + //Future providerCreate(ProviderDTO providerDTO) async + test('test providerCreate', () async { + // TODO + }); + + // Delete a provider + // + //Future providerDelete(String providerId) async + test('test providerDelete', () async { + // TODO + }); + + // Get all user providers + // + //Future> providerGetAll(String userId) async + test('test providerGetAll', () async { + // TODO + }); + + // Update a provider + // + //Future providerUpdate(ProviderDTO providerDTO) async + test('test providerUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/provider_dto_test.dart b/mycore_api/test/provider_dto_test.dart new file mode 100644 index 0000000..e08b953 --- /dev/null +++ b/mycore_api/test/provider_dto_test.dart @@ -0,0 +1,66 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ProviderDTO +void main() { + final instance = ProviderDTO(); + + group('test ProviderDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String endpoint + test('to test the property `endpoint`', () async { + // TODO + }); + + // String username + test('to test the property `username`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // String apiKey + test('to test the property `apiKey`', () async { + // TODO + }); + + // bool active + test('to test the property `active`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/provider_test.dart b/mycore_api/test/provider_test.dart new file mode 100644 index 0000000..35cca6f --- /dev/null +++ b/mycore_api/test/provider_test.dart @@ -0,0 +1,71 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Provider +void main() { + final instance = Provider(); + + group('test Provider', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String username + test('to test the property `username`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // String endpoint + test('to test the property `endpoint`', () async { + // TODO + }); + + // String apiKey + test('to test the property `apiKey`', () async { + // TODO + }); + + // String value + test('to test the property `value`', () async { + // TODO + }); + + // bool active + test('to test the property `active`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/room_api_test.dart b/mycore_api/test/room_api_test.dart new file mode 100644 index 0000000..84ae05c --- /dev/null +++ b/mycore_api/test/room_api_test.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for RoomApi +void main() { + final instance = RoomApi(); + + group('tests for RoomApi', () { + // Create a room + // + //Future roomCreate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async + test('test roomCreate', () async { + // TODO + }); + + // Delete device from a room + // + //Future roomDelete(String deviceId, String roomId) async + test('test roomDelete', () async { + // TODO + }); + + // Delete a room + // + //Future roomDelete2(String roomId) async + test('test roomDelete2', () async { + // TODO + }); + + // Delete all room for a specified + // + //Future roomDeleteAllForUser(String userId) async + test('test roomDeleteAllForUser', () async { + // TODO + }); + + // Get all rooms for the specified user + // + //Future> roomGetAll(String userId) async + test('test roomGetAll', () async { + // TODO + }); + + // Get detail info of a specified room + // + //Future roomGetDetail(String roomId, { String userId }) async + test('test roomGetDetail', () async { + // TODO + }); + + // Update a room + // + //Future roomUpdate(RoomCreateOrUpdateDetailDTO roomCreateOrUpdateDetailDTO) async + test('test roomUpdate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/room_create_or_update_detail_dto_test.dart b/mycore_api/test/room_create_or_update_detail_dto_test.dart new file mode 100644 index 0000000..3956473 --- /dev/null +++ b/mycore_api/test/room_create_or_update_detail_dto_test.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for RoomCreateOrUpdateDetailDTO +void main() { + final instance = RoomCreateOrUpdateDetailDTO(); + + group('test RoomCreateOrUpdateDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // List deviceIds (default value: const []) + test('to test the property `deviceIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/room_detail_dto_test.dart b/mycore_api/test/room_detail_dto_test.dart new file mode 100644 index 0000000..2dd6b4a --- /dev/null +++ b/mycore_api/test/room_detail_dto_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for RoomDetailDTO +void main() { + final instance = RoomDetailDTO(); + + group('test RoomDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // DateTime createdDate + test('to test the property `createdDate`', () async { + // TODO + }); + + // DateTime updatedDate + test('to test the property `updatedDate`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/room_summary_dto_test.dart b/mycore_api/test/room_summary_dto_test.dart new file mode 100644 index 0000000..5f0819d --- /dev/null +++ b/mycore_api/test/room_summary_dto_test.dart @@ -0,0 +1,36 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for RoomSummaryDTO +void main() { + final instance = RoomSummaryDTO(); + + group('test RoomSummaryDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String userId + test('to test the property `userId`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/screen_configuration_test.dart b/mycore_api/test/screen_configuration_test.dart new file mode 100644 index 0000000..9e9ba3c --- /dev/null +++ b/mycore_api/test/screen_configuration_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ScreenConfiguration +void main() { + final instance = ScreenConfiguration(); + + group('test ScreenConfiguration', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // List widgets (default value: const []) + test('to test the property `widgets`', () async { + // TODO + }); + + // int height + test('to test the property `height`', () async { + // TODO + }); + + // int width + test('to test the property `width`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/screen_device_api_test.dart b/mycore_api/test/screen_device_api_test.dart new file mode 100644 index 0000000..bed3157 --- /dev/null +++ b/mycore_api/test/screen_device_api_test.dart @@ -0,0 +1,45 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for ScreenDeviceApi +void main() { + final instance = ScreenDeviceApi(); + + group('tests for ScreenDeviceApi', () { + //Future screenDeviceCreateDevice(ScreenDevice screenDevice) async + test('test screenDeviceCreateDevice', () async { + // TODO + }); + + //Future screenDeviceDeleteDevice(String deviceId) async + test('test screenDeviceDeleteDevice', () async { + // TODO + }); + + //Future> screenDeviceGetAllScreenDevices() async + test('test screenDeviceGetAllScreenDevices', () async { + // TODO + }); + + //Future screenDeviceGetDeviceInfo(String screenDeviceId) async + test('test screenDeviceGetDeviceInfo', () async { + // TODO + }); + + //Future screenDeviceUpdateDevice(int screenDeviceId, ScreenDevice screenDevice) async + test('test screenDeviceUpdateDevice', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/screen_device_test.dart b/mycore_api/test/screen_device_test.dart new file mode 100644 index 0000000..68cc588 --- /dev/null +++ b/mycore_api/test/screen_device_test.dart @@ -0,0 +1,56 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ScreenDevice +void main() { + final instance = ScreenDevice(); + + group('test ScreenDevice', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String location + test('to test the property `location`', () async { + // TODO + }); + + // String locationExplanation + test('to test the property `locationExplanation`', () async { + // TODO + }); + + // int height + test('to test the property `height`', () async { + // TODO + }); + + // int width + test('to test the property `width`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/smart_garden_message_test.dart b/mycore_api/test/smart_garden_message_test.dart new file mode 100644 index 0000000..6a4e8ae --- /dev/null +++ b/mycore_api/test/smart_garden_message_test.dart @@ -0,0 +1,61 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for SmartGardenMessage +void main() { + final instance = SmartGardenMessage(); + + group('test SmartGardenMessage', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String time + test('to test the property `time`', () async { + // TODO + }); + + // double temperature + test('to test the property `temperature`', () async { + // TODO + }); + + // double pressure + test('to test the property `pressure`', () async { + // TODO + }); + + // double humidity + test('to test the property `humidity`', () async { + // TODO + }); + + // int water + test('to test the property `water`', () async { + // TODO + }); + + // int light + test('to test the property `light`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/smart_printer_message_test.dart b/mycore_api/test/smart_printer_message_test.dart new file mode 100644 index 0000000..808e06d --- /dev/null +++ b/mycore_api/test/smart_printer_message_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for SmartPrinterMessage +void main() { + final instance = SmartPrinterMessage(); + + group('test SmartPrinterMessage', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // String time + test('to test the property `time`', () async { + // TODO + }); + + // double temperature + test('to test the property `temperature`', () async { + // TODO + }); + + // double pressure + test('to test the property `pressure`', () async { + // TODO + }); + + // int smoke + test('to test the property `smoke`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/state_test.dart b/mycore_api/test/state_test.dart new file mode 100644 index 0000000..fa989a5 --- /dev/null +++ b/mycore_api/test/state_test.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for State +void main() { + final instance = State(); + + group('test State', () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String value + test('to test the property `value`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/token_api_test.dart b/mycore_api/test/token_api_test.dart new file mode 100644 index 0000000..5c9b601 --- /dev/null +++ b/mycore_api/test/token_api_test.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for TokenApi +void main() { + final instance = TokenApi(); + + group('tests for TokenApi', () { + //Future tokenConnectUser(LoginDTO loginDTO) async + test('test tokenConnectUser', () async { + // TODO + }); + + //Future tokenCreate(User user) async + test('test tokenCreate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/trigger_test.dart b/mycore_api/test/trigger_test.dart new file mode 100644 index 0000000..419d2bc --- /dev/null +++ b/mycore_api/test/trigger_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Trigger +void main() { + final instance = Trigger(); + + group('test Trigger', () { + // String providerId + test('to test the property `providerId`', () async { + // TODO + }); + + // String deviceId + test('to test the property `deviceId`', () async { + // TODO + }); + + // String stateName + test('to test the property `stateName`', () async { + // TODO + }); + + // String stateValue + test('to test the property `stateValue`', () async { + // TODO + }); + + // TriggerType type + test('to test the property `type`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/trigger_type_test.dart b/mycore_api/test/trigger_type_test.dart new file mode 100644 index 0000000..78cfc13 --- /dev/null +++ b/mycore_api/test/trigger_type_test.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for TriggerType +void main() { + + group('test TriggerType', () { + + }); + +} diff --git a/mycore_api/test/twitter_api_test.dart b/mycore_api/test/twitter_api_test.dart new file mode 100644 index 0000000..84709f7 --- /dev/null +++ b/mycore_api/test/twitter_api_test.dart @@ -0,0 +1,25 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for TwitterApi +void main() { + final instance = TwitterApi(); + + group('tests for TwitterApi', () { + //Future twitterCreate(TwitterAuthModel twitterAuthModel) async + test('test twitterCreate', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/twitter_auth_model_test.dart b/mycore_api/test/twitter_auth_model_test.dart new file mode 100644 index 0000000..71e0971 --- /dev/null +++ b/mycore_api/test/twitter_auth_model_test.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for TwitterAuthModel +void main() { + final instance = TwitterAuthModel(); + + group('test TwitterAuthModel', () { + // String apiKey + test('to test the property `apiKey`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/user_api_test.dart b/mycore_api/test/user_api_test.dart new file mode 100644 index 0000000..cc8f2f4 --- /dev/null +++ b/mycore_api/test/user_api_test.dart @@ -0,0 +1,49 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + final instance = UserApi(); + + group('tests for UserApi', () { + //Future userCreateUser(UserInfo userInfo) async + test('test userCreateUser', () async { + // TODO + }); + + //Future userDeleteUser(String id) async + test('test userDeleteUser', () async { + // TODO + }); + + // Get a list of user + // + //Future userGet() async + test('test userGet', () async { + // TODO + }); + + // Get a specific user + // + //Future userGet2(String id) async + test('test userGet2', () async { + // TODO + }); + + //Future userUpdateUser(UserInfo userInfo) async + test('test userUpdateUser', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/user_info_detail_dto_test.dart b/mycore_api/test/user_info_detail_dto_test.dart new file mode 100644 index 0000000..bea7c7e --- /dev/null +++ b/mycore_api/test/user_info_detail_dto_test.dart @@ -0,0 +1,41 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for UserInfoDetailDTO +void main() { + final instance = UserInfoDetailDTO(); + + group('test UserInfoDetailDTO', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String firstName + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName + test('to test the property `lastName`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/user_info_test.dart b/mycore_api/test/user_info_test.dart new file mode 100644 index 0000000..7554b95 --- /dev/null +++ b/mycore_api/test/user_info_test.dart @@ -0,0 +1,131 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for UserInfo +void main() { + final instance = UserInfo(); + + group('test UserInfo', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String role + test('to test the property `role`', () async { + // TODO + }); + + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + // String firstName + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName + test('to test the property `lastName`', () async { + // TODO + }); + + // String token + test('to test the property `token`', () async { + // TODO + }); + + // DateTime birthday + test('to test the property `birthday`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // String address + test('to test the property `address`', () async { + // TODO + }); + + // String city + test('to test the property `city`', () async { + // TODO + }); + + // String state + test('to test the property `state`', () async { + // TODO + }); + + // String country + test('to test the property `country`', () async { + // TODO + }); + + // String language + test('to test the property `language`', () async { + // TODO + }); + + // String timeZone + test('to test the property `timeZone`', () async { + // TODO + }); + + // int postalCode + test('to test the property `postalCode`', () async { + // TODO + }); + + // List automations (default value: const []) + test('to test the property `automations`', () async { + // TODO + }); + + // List devices (default value: const []) + test('to test the property `devices`', () async { + // TODO + }); + + // List providers (default value: const []) + test('to test the property `providers`', () async { + // TODO + }); + + // List groups (default value: const []) + test('to test the property `groups`', () async { + // TODO + }); + + // List screenConfigurationIds (default value: const []) + test('to test the property `screenConfigurationIds`', () async { + // TODO + }); + + // List deviceIds (default value: const []) + test('to test the property `deviceIds`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/user_test.dart b/mycore_api/test/user_test.dart new file mode 100644 index 0000000..d66f7b6 --- /dev/null +++ b/mycore_api/test/user_test.dart @@ -0,0 +1,31 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + final instance = User(); + + group('test User', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String password + test('to test the property `password`', () async { + // TODO + }); + + + }); + +} diff --git a/mycore_api/test/values_api_test.dart b/mycore_api/test/values_api_test.dart new file mode 100644 index 0000000..30725b1 --- /dev/null +++ b/mycore_api/test/values_api_test.dart @@ -0,0 +1,47 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for ValuesApi +void main() { + final instance = ValuesApi(); + + group('tests for ValuesApi', () { + //Future valuesDelete(int id) async + test('test valuesDelete', () async { + // TODO + }); + + //Future valuesGet(int id) async + test('test valuesGet', () async { + // TODO + }); + + // It's a test ! :) + // + //Future> valuesGetAll() async + test('test valuesGetAll', () async { + // TODO + }); + + //Future valuesPost(String body) async + test('test valuesPost', () async { + // TODO + }); + + //Future valuesPut(int id, String body) async + test('test valuesPut', () async { + // TODO + }); + + }); +} diff --git a/mycore_api/test/view_by_test.dart b/mycore_api/test/view_by_test.dart new file mode 100644 index 0000000..6be97a1 --- /dev/null +++ b/mycore_api/test/view_by_test.dart @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ViewBy +void main() { + + group('test ViewBy', () { + + }); + +} diff --git a/mycore_api/test/widget_test.dart b/mycore_api/test/widget_test.dart new file mode 100644 index 0000000..603da4a --- /dev/null +++ b/mycore_api/test/widget_test.dart @@ -0,0 +1,86 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.0 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: lines_longer_than_80_chars + +import 'package:mycoreapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Widget +void main() { + final instance = Widget(); + + group('test Widget', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String displayName + test('to test the property `displayName`', () async { + // TODO + }); + + // String type + test('to test the property `type`', () async { + // TODO + }); + + // bool activated + test('to test the property `activated`', () async { + // TODO + }); + + // String form + test('to test the property `form`', () async { + // TODO + }); + + // String font + test('to test the property `font`', () async { + // TODO + }); + + // String color + test('to test the property `color`', () async { + // TODO + }); + + // String size + test('to test the property `size`', () async { + // TODO + }); + + // int width + test('to test the property `width`', () async { + // TODO + }); + + // int height + test('to test the property `height`', () async { + // TODO + }); + + // int positionX + test('to test the property `positionX`', () async { + // TODO + }); + + // int positionY + test('to test the property `positionY`', () async { + // TODO + }); + + + }); + +} diff --git a/pubspec.lock b/pubspec.lock index 74a8268..a946c23 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,48 +1,146 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "0.38.5" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.2" + version: "2.5.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.2" + version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.2" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.0" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.0" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.2" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "6.8.2" + built_value_generator: + dependency: "direct dev" + description: + name: built_value_generator + url: "https://pub.dartlang.org" + source: hosted + version: "6.8.2" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.4" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.2" + version: "1.2.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.2" + version: "1.1.0" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.4" + version: "1.15.0" convert: dependency: transitive description: @@ -57,13 +155,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.5" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.2" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.3" event_bus: dependency: transitive description: @@ -77,7 +189,21 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.2" + version: "1.2.0" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "5.2.1" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.11" flutter: dependency: "direct main" description: flutter @@ -88,94 +214,325 @@ packages: description: flutter source: sdk version: "0.0.0" + front_end: + dependency: transitive + description: + name: front_end + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.27" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+4" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + intl: + dependency: transitive + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" + kernel: + dependency: transitive + description: + name: kernel + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.27" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "0.11.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.2" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.5" + version: "1.3.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7" mqtt_client: dependency: "direct main" description: name: mqtt_client url: "https://pub.dartlang.org" source: hosted - version: "8.1.0" + version: "8.2.0" + mycoreapi: + dependency: "direct main" + description: + path: mycore_api + relative: true + source: path + version: "1.0.0" + node_interop: + dependency: transitive + description: + name: node_interop + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + node_io: + dependency: transitive + description: + name: node_io + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" + package_resolver: + dependency: transitive + description: + name: package_resolver + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.10" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.0" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.0" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.8" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + rxdart: + dependency: "direct main" + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.22.0" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.9" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.4+1" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.4+6" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.3" + version: "1.8.1" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.5" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.2" + version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.20" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.2" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.2" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.4" + version: "0.2.19" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+3" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.4" + version: "2.1.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7+15" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" sdks: - dart: ">=2.11.0-0.0 <2.12.0" + dart: ">=2.12.0-0.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index de72b54..f12f867 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -25,8 +25,9 @@ dependencies: sdk: flutter mqtt_client: ^8.1.0 - - + rxdart: 0.22.0 + mycoreapi: + path: mycore_api # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.0 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 4bfa0f3..8b6d468 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #include "generated_plugin_registrant.h" diff --git a/windows/flutter/generated_plugin_registrant.h b/windows/flutter/generated_plugin_registrant.h index 9846246..dc139d8 100644 --- a/windows/flutter/generated_plugin_registrant.h +++ b/windows/flutter/generated_plugin_registrant.h @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_